Microsoft Release Management - build fails with Internal Server Error - ms-release-management

I am trying to implement RM for releasing a website (on prem). When I que a build or invoke the release from the RM client, i am getting the following error. I turned on logs for the client, server and monitor as described here.
Our setup:
TFS Version: TFS2010
RM Version: 2013
VS Version: 2013
Build controller. build Agent, RM Server, RM Client all on the same Windows Server 2008 R2 SP1 box. TFS on a separate box.
I would really appreciate any help in troubleshooting this.
Thanks.
Image of my template designer as requested in the comment below. :
11/16/2015 12:06:48 AM - Error - (9428, 12556) - The remote server returned an error: (500) Internal Server Error.: \r\n\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.PlatformHttpClient.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndPost(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.HttpRequestor.<>c__DisplayClass1.<GetPostCaller>b__0(String url, String body)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.PopulateTaggedActivities(String workflowXml, Int32 environmentId)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BuildReleaseStages(ReleasePath selectedReleasePath, XElement applicationVersion)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BringDataFromApplicationVersion()
at Microsoft.TeamFoundation.Release.Data.Model.Release.OnPropertyChanged(String propertyName, Boolean setDirty)
at Microsoft.TeamFoundation.Release.Data.Model.PropertyChangedBase.OnPropertyChanged(String propertyName)
at Microsoft.TeamFoundation.Release.Data.Model.Release.set_ApplicationVersionId(Int32 value)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.Initialize(Int32 modelId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel..ctor(String viewMode, Dictionary`2 popupParameters)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Int32 releaseTemplateId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateRelease(XElement selectedItem)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Object selectedItems)
at Microsoft.VisualStudio.Release.ViewModel.Helpers.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Below is what I find in the Microsoft.TeamFoundation.Release.Build.log
Microsoft.TeamFoundation.Release.Build starting process...
Processing using the following parameters:
TeamFoundationServerUrl: http://MyTFSServer.MyDomain.com:8080/tfs/MyCollection
TeamProjectName: MYProjectName
TeamProjectWithCollection: MyCollection/MYProjectName
BuildDefinitionName: MyBuildName
BuildNumber: MyBuildName_20151115.1
TargetStage:
Creating the release and waiting for deployment result...
ERROR: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndPost(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.PopulateTaggedActivities(String workflowXml, Int32 environmentId)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BuildReleaseStages(ReleasePath selectedReleasePath, XElement applicationVersion)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BringDataFromApplicationVersion()
at Microsoft.TeamFoundation.Release.Data.Model.Release.OnPropertyChanged(String propertyName, Boolean setDirty)
at Microsoft.TeamFoundation.Release.Workflow.Services.ReleaseWorkflowService.InitiateFromBuild(Uri teamFoundationServerUrl, String teamProject, String buildDefinition, String buildNumber, String targetStageName)
at Microsoft.TeamFoundation.Release.Build.Program.Release()
at Microsoft.TeamFoundation.Release.Build.Program.MainImplementation(String[] args, Action`1 consoleWriter, Action releaseAction)
Exit: 1
For the service, the text log is not getting generated. Following are the entries from the event log with Source "Release Management Monitor". Sorry for the formatting. This is the best I could do to copy from the machine event log:
Log Name: Application
Source: Microsoft Deployment Agent
Date: 11/16/2015 10:24:26 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServerMachine.MyDomain.com
Description:
Timestamp: 11/16/2015 10:24:26 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Data.Model.SystemSettings.LoadXml(Int32 id)
at Microsoft.TeamFoundation.Release.Data.Model.ModelFactory.Load[T](Int32 id)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.DeploymentEventFetcherBase.DeployNextComponent()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: Log Name: Application
Source: Microsoft Deployment Agent
Date: 11/16/2015 10:24:26 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServerMachine.MyDomain.com
Description:
Timestamp: 11/16/2015 10:24:26 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Data.Model.SystemSettings.LoadXml(Int32 id)
at Microsoft.TeamFoundation.Release.Data.Model.ModelFactory.Load[T](Int32 id)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.DeploymentEventFetcherBase.DeployNextComponent()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServerMachine
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 8176
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft Deployment Agent" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:24:26.000000000Z" />
<EventRecordID>474148</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServerMachine.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:24:26 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Data.Model.SystemSettings.LoadXml(Int32 id)
at Microsoft.TeamFoundation.Release.Data.Model.ModelFactory.Load[T](Int32 id)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.DeploymentEventFetcherBase.DeployNextComponent()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServerMachine
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 8176
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 8176
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft Deployment Agent" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:24:26.000000000Z" />
<EventRecordID>474148</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServerMachine.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:24:26 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Data.Model.SystemSettings.LoadXml(Int32 id)
at Microsoft.TeamFoundation.Release.Data.Model.ModelFactory.Load[T](Int32 id)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.DeploymentEventFetcherBase.DeployNextComponent()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServerMachine
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 8176
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>
Also, the following keeps getting logged from the monitor:
Log Name: Application
Source: Release Management Monitor
Date: 11/16/2015 10:26:36 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServer.MyDomain.com
Description:
Timestamp: 11/16/2015 10:26:36 AM
Message: An existing connection was forcibly closed by the remote host: \r\n\r\n at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Release Management Monitor" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:26:36.000000000Z" />
<EventRecordID>474201</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServer.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:26:36 AM
Message: An existing connection was forcibly closed by the remote host: \r\n\r\n at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>
Log Name: Application
Source: Release Management Monitor
Date: 11/16/2015 10:26:36 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServer.MyDomain.com
Description:
Timestamp: 11/16/2015 10:26:36 AM
Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.: \r\n\r\n at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Release Management Monitor" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:26:36.000000000Z" />
<EventRecordID>474200</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServer.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:26:36 AM
Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.: \r\n\r\n at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>
Log Name: Application
Source: Release Management Monitor
Date: 11/16/2015 10:26:36 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServer.MyDomain.com
Description:
Timestamp: 11/16/2015 10:26:36 AM
Message: The underlying connection was closed: An unexpected error occurred on a receive.: \r\n\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndGet(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseWorkflowAutomationEngineServiceProxy.GetStalledDeploymentActivities(Int32 timeout)
at Microsoft.TeamFoundation.Release.Monitor.Services.MonitorServiceExtensions.FailAllV2StalledDeployment(MonitorService monitorService, String serviceName)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Release Management Monitor" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:26:36.000000000Z" />
<EventRecordID>474199</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServer.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:26:36 AM
Message: The underlying connection was closed: An unexpected error occurred on a receive.: \r\n\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndGet(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseWorkflowAutomationEngineServiceProxy.GetStalledDeploymentActivities(Int32 timeout)
at Microsoft.TeamFoundation.Release.Monitor.Services.MonitorServiceExtensions.FailAllV2StalledDeployment(MonitorService monitorService, String serviceName)
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>
Log Name: Application
Source: Release Management Monitor
Date: 11/16/2015 10:22:15 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MyRMServer.MyDomain.com
Description:
Timestamp: 11/16/2015 10:22:15 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Monitor.Services.MonitorService.FailAllStalledDeployment()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Release Management Monitor" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-16T16:22:15.000000000Z" />
<EventRecordID>474098</EventRecordID>
<Channel>Application</Channel>
<Computer>MyRMServer.MyDomain.com</Computer>
<Security />
</System>
<EventData>
<Data>Timestamp: 11/16/2015 10:22:15 AM
Message: Object reference not set to an instance of an object.: \r\n\r\n at Microsoft.TeamFoundation.Release.Monitor.Services.MonitorService.FailAllStalledDeployment()
Category: General
Priority: -1
EventId: 0
Severity: Error
Title:
Machine: MyRMServer
Application Domain: ReleaseManagementMonitor.exe
Process Id: 1652
Process Name: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\bin\ReleaseManagementMonitor.exe
Win32 Thread Id: 9896
Thread Name:
Extended Properties: </Data>
</EventData>
</Event>

Related

Google Cloud Api Gateway - {"message":"no healthy upstream","code":503}

I am building an api that is hosted on App Engine Standard (Python).
I have test it with curl and I was able to make a successfully post request:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"amount":xxxx,"currency":"xxx","date":xxxx,"name":"xxxx","symbol":"xxx"}' \
https://xxxxxxxxxx.appspot.com/api/add/
Then I deployed an Api Gateway to access my App Engine Standard back end.
Getting started with API Gateway and App Engine
I tested and it worked fine for GET requests.
Now I am having issue performing a POST request. This is my code from config.yaml file:
/add:
post:
summary: Creates a new transaction.
operationId: create-transaction
consumes:
- application/json
parameters:
- in: body
name: transaction
description: The transaction to create.
schema:
type: object
required:
- name
symbol
currency
amount
date
properties:
name:
type: string
symbol:
type: string
currency:
type: string
amount:
type: number
date:
type: integer
x-google-backend:
address: https://xxxxxxx.appspot.com
path_translation: [ APPEND_PATH_TO_ADDRESS ]
jwt_audience: 272804158038-6kc250fms52o33b7dcfjrl1f9d8rripb.apps.googleusercontent.com
responses:
'201':
description: A successful transaction created
schema:
type: string
When I am trying to run the same curl command :
curl --header "Content-Type: application/json"
--request POST
--data '{"amount":xxxx,"currency":"xxx","date":xxxx,"name":"xxxx","symbol":"xxxx"}'
https://saxxx-xxxxxxx-gateway.dev/add/
I receive :
{"message":"no healthy upstream","code":503}
Can somebody please help me troubleshooting this error message ? Again, I am able to run successfully GET requests on the same Gateway.
This is the log I found on Logging :
{
httpRequest: {
latency: "0s"
protocol: "http"
remoteIp: ""
requestMethod: "POST"
requestSize: "936"
requestUrl: "/add"
responseSize: "158"
status: 503
}
insertId: ""
jsonPayload: {
api_key_state: "NOT CHECKED"
api_method: "1.xxxxxx_2ere0etrrw81sxxxxxxxxxxxxxx_cloud_goog.Createtransaction"
api_name: "1.xxxxxxxxxxx_api_2exxxxxx_cloud_goog"
api_version: "1.0.0"
location: ""
log_message: "1.sxxxxxxxxxxx.Createtransaction is called"
producer_project_id: "xxxxxx"
response_code_detail: "no_healthy_upstream"
service_agent: "ESPv2/2.21.0"
service_config_id: "sxxxxxxxx4jvuvmlcb"
timestamp: 1616270864.269634
}
logName: "projects/sagexxxxxxxx.apigateway.xxxxxxxxx.cloud.goog%2Fendpoints_log"
receiveTimestamp: "2021-03-20T20:07:46.372838475Z"
resource: {
labels: {
location: ""
method: "1.xxxxxxxxxxxx_goog.Createtransaction"
project_id: ""
service: "xxxxxxxxxxxxx.cloud.goog"
version: "1.0.0"
}
type: "api"
}
severity: "ERROR"
timestamp: "2021-03-20T20:07:44.269633934Z"
}
I had a problem with my config.yaml file code:
/add:
post:
summary: Creates a new transaction.
operationId: create-transaction
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/Model0'
x-google-backend:
address: https://appspot.com
path_translation: [ APPEND_PATH_TO_ADDRESS ]
jwt_audience: .googleusercontent.com
responses:
'201':
description: A successful transaction created
schema:
type: string
definitions:
Model0:
properties:
amount:
type: number
format: double
currency:
type: string
date:
type: integer
format: int64
name:
type: string
symbol:
type: string

How to handle existing data during MongoDB document creation?

I have a mongodb database that is storing time-series data. Let's assume this is the data that is already in there.
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:35:00+00:00"
}
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:40:00+00:00"
}
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:45:00+00:00"
}
As you can see, what matters here is the date field.
After my API call, I receive some new data, that might look like that.
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:35:00+00:00"
}
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:40:00+00:00"
}
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:45:00+00:00"
}
{
asset: "BTC/EUR",
timeframe: "5m",
stream: {O,H,L,C,V},
date: "2020-06-18T11:50:00+00:00"
}
So, all the other 3 entries are already in the db, I just would like to add the data that is not in the db, in our case, the last entry dated 2020-06-18T11:50:00+00:00 - or potentially fill in any gaps in the previous records.
Do I need to pull all the previous entries from the db and compare them to my latest payload, then filter out the existing ones and then make my db entry?
This is how my schema looks:

Limit access to Google Endpoint URL

I am trying to build a service to service API call. I am using Google Endpoints with open API.
My problem is that after adding "securityDefinitions:" I'm still able to access the endpoint without authentication. (Able to access it from anywhere)
How do I make sure that only Compute Engine with a particular Service Account can access the REST API.
swagger: "2.0"
info:
description: "A simple Google Cloud Endpoints API example."
title: "Endpoints Example"
version: "1.0.0"
host: "echo-api.endpoints.projectid.cloud.goog"
x-google-endpoints:
- name: "echo-api.endpoints.projectid.cloud.goog"
target: "SOME IP"
# [END swagger]
basePath: "/"
consumes:
- "application/json"
produces:
- "application/json"
schemes:
- "http"
paths:
"/list":
get:
description: "list"
operationId: "Project.get"
produces:
- "application/json"
responses:
200:
description: "lists"
schema:
$ref: "#/definitions/Project"
parameters:
- description: "Project Name"
in: body
name: project_id
required: true
schema:
$ref: "#/definitions/Res"
security:
- google_jwt_client-1: []
definitions:
Res:
properties:
apierrmsg:
type: "string"
apiresults:
type: "Array"
definitions:
Project:
properties:
project_id:
type: "string"
securityDefinitions:
google_jwt_client-1:
authorizationUrl: ""
flow: "implicit"
type: "oauth2"
x-google-issuer: "some#projectid.iam.gserviceaccount.com"
x-google-jwks_uri: "https://www.googleapis.com/robot/v1/metadata/x509/some#projectid.iam.gserviceaccount.com"

Cloudformation template for creating wordpress on 4 ec2 instances with on single RDS Mysql

Currently i am writing a cloudformation template which installing wordpress on 4 instances with on single RDS MySql instance . so far i wrote code for launching complete wordpress on one single ec2 instance and database on RDS instance. i want to do this for 3 more instance with 3 different (or same will do trick also) databases but on same Single RDS instance... how should i proceed??? here is the code which launches 1 ec2 ,1 rds with wordpress installed on it. The code is in YAML language. any suggestion ???what should i add an how to do this... thankYou.
CLOUDFORMATION TEMPLATE...
AWSTemplateFormatVersion: "2010-09-09"
Description: "Wordpress: highly available and scalable, a cloudonaut.io template"
Parameters:
BlogID:
Description: "A unique identifier for your blog. For internal use only."
Type: String
AllowedPattern: "[A-Za-z0-9\\-]+"
ConstraintDescription: "Only letters, digits or dash allowed."
BlogTitle:
Description: "The title of the Wordpress blog."
Type: String
Default: "Just another Wordpress blog"
BlogAdminUsername:
Description: "A username for the Wordpress admin."
Type: String
Default: "admin"
BlogAdminPassword:
Description: "A password for the Wordpress admin."
Type: String
NoEcho: "true"
BlogAdminEMail:
Description: "The email address of the Wordpress admin."
Type: String
WebServerKeyName:
Description: "The key pair to establish a SSH connection to the web servers."
Type: "AWS::EC2::KeyPair::KeyName"
WebServerInstanceType:
Description: "The instance type of web servers (e.g. t2.micro)."
Type: String
Default: "t2.micro"
DBServerInstanceType:
Description: "The instance type of database server (e.g. db.t2.micro)."
Type: String
Default: "db.t2.micro"
Mappings:
EC2RegionMap:
ap-northeast-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-cbf90ecb" }
ap-southeast-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-68d8e93a" }
ap-southeast-2: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-fd9cecc7" }
eu-central-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-a8221fb5" }
eu-west-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-a10897d6" }
sa-east-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-b52890a8" }
us-east-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-1ecae776" }
us-west-1: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-d114f295" }
us-west-2: { AmazonLinuxAMIHVMEBSBacked64bit: "ami-e7527ed7" }
Resources:
VPC:
Type: "AWS::EC2::VPC"
Properties:
CidrBlock: "172.31.0.0/16"
EnableDnsHostnames: "true"
InternetGateway:
Type: "AWS::EC2::InternetGateway"
Properties: {}
VPCGatewayAttachment:
Type: "AWS::EC2::VPCGatewayAttachment"
Properties:
VpcId: {"Ref": "VPC"}
InternetGatewayId: {"Ref": "InternetGateway"}
SubnetA:
Type: "AWS::EC2::Subnet"
Properties:
AvailabilityZone: {"Fn::Select": ["0", {"Fn::GetAZs": ""}]}
CidrBlock: "172.31.38.0/24"
VpcId: {"Ref": "VPC"}
SubnetB:
Type: "AWS::EC2::Subnet"
Properties:
AvailabilityZone: {"Fn::Select": ["1", {"Fn::GetAZs": ""}]}
CidrBlock: "172.31.37.0/24"
VpcId: {"Ref": "VPC"}
RouteTable:
Type: "AWS::EC2::RouteTable"
Properties:
VpcId: {"Ref": "VPC"}
RouteTableAssociationA:
Type: "AWS::EC2::SubnetRouteTableAssociation"
Properties:
SubnetId: {"Ref": "SubnetA"}
RouteTableId: {"Ref": "RouteTable"}
RouteTableAssociationB:
Type: "AWS::EC2::SubnetRouteTableAssociation"
Properties:
SubnetId: {"Ref": "SubnetB"}
RouteTableId: {"Ref": "RouteTable"}
RoutePublicNATToInternet:
Type: "AWS::EC2::Route"
Properties:
RouteTableId: {"Ref": "RouteTable"}
DestinationCidrBlock: "0.0.0.0/0"
GatewayId: {"Ref": "InternetGateway"}
DependsOn: "VPCGatewayAttachment"
NetworkAcl:
Type: "AWS::EC2::NetworkAcl"
Properties:
VpcId: {"Ref": "VPC"}
SubnetNetworkAclAssociationA:
Type: "AWS::EC2::SubnetNetworkAclAssociation"
Properties:
SubnetId: {"Ref": "SubnetA"}
NetworkAclId: {"Ref": "NetworkAcl"}
SubnetNetworkAclAssociationB:
Type: "AWS::EC2::SubnetNetworkAclAssociation"
Properties:
SubnetId: {"Ref": "SubnetB"}
NetworkAclId: {"Ref": "NetworkAcl"}
NetworkAclEntryIngress:
Type: "AWS::EC2::NetworkAclEntry"
Properties:
NetworkAclId: {"Ref": "NetworkAcl"}
RuleNumber: "100"
Protocol: "-1"
RuleAction: "allow"
Egress: "false"
CidrBlock: "0.0.0.0/0"
NetworkAclEntryEgress:
Type: "AWS::EC2::NetworkAclEntry"
Properties:
NetworkAclId: {"Ref": "NetworkAcl"}
RuleNumber: "100"
Protocol: "-1"
RuleAction: "allow"
Egress: "true"
CidrBlock: "0.0.0.0/0"
LoadBalancer:
Type: "AWS::ElasticLoadBalancing::LoadBalancer"
Properties:
Subnets: [{"Ref": "SubnetA"}, {"Ref": "SubnetB"}]
LoadBalancerName: {"Ref": "BlogID"}
Listeners:
- InstancePort: "80"
InstanceProtocol: "HTTP"
LoadBalancerPort: "80"
Protocol: "HTTP"
HealthCheck:
HealthyThreshold: "2"
Interval: "5"
Target: "TCP:80"
Timeout: "3"
UnhealthyThreshold: "2"
SecurityGroups: [{"Ref": "LoadBalancerSecurityGroup"}]
Scheme: "internet-facing"
CrossZone: "true"
LoadBalancerSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: "wordpress-elb"
VpcId: {"Ref": "VPC"}
SecurityGroupIngress:
- CidrIp: "0.0.0.0/0"
FromPort: 80
IpProtocol: "tcp"
ToPort: 80
WebServerSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: "wordpress-ec2"
VpcId: {"Ref": "VPC"}
SecurityGroupIngress:
- CidrIp: "0.0.0.0/0"
FromPort: 22
IpProtocol: "tcp"
ToPort: 22
- FromPort: 80
IpProtocol: "tcp"
SourceSecurityGroupId: {"Ref": "LoadBalancerSecurityGroup"}
ToPort: 80
DatabaseSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: "wordpress-rds"
VpcId: {"Ref": "VPC"}
SecurityGroupIngress:
- IpProtocol: "tcp"
FromPort: "3306"
ToPort: "3306"
SourceSecurityGroupId: {"Ref": "WebServerSecurityGroup"}
Database:
Type: "AWS::RDS::DBInstance"
Properties:
AllocatedStorage: "5"
BackupRetentionPeriod: "0"
DBInstanceClass: {"Ref": "DBServerInstanceType"}
DBInstanceIdentifier: {"Ref": "BlogID"}
DBName: "wordpress"
Engine: "MySQL"
MasterUsername: "wordpress"
MasterUserPassword: "wordpress"
VPCSecurityGroups: [{"Fn::GetAtt": ["DatabaseSecurityGroup", "GroupId"]}]
DBSubnetGroupName: {"Ref": "DBSubnetGroup"}
MultiAZ: "true"
StorageType: "gp2"
DBSubnetGroup:
Type: "AWS::RDS::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "DB subnet group"
SubnetIds: [{"Ref": "SubnetA"}, {"Ref": "SubnetB"}]
S3Bucket:
Type: "AWS::S3::Bucket"
Properties:
BucketName: {"Ref": "BlogID"}
IAMUser:
Type: "AWS::IAM::User"
Properties:
Path: "/"
Policies:
- PolicyName: "UploadToS3"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action: ["s3:*"]
Resource:
- {"Fn::Join": ["", ["arn:aws:s3:::", {"Ref": "BlogID"} ,"/*"]]}
IAMAccessKey:
Type: "AWS::IAM::AccessKey"
Properties:
UserName: {"Ref": "IAMUser"}
LaunchConfiguration:
Type: "AWS::AutoScaling::LaunchConfiguration"
Metadata:
"AWS::CloudFormation::Init":
config:
packages:
yum:
"php": []
"php-mysql": []
"mysql": []
"httpd": []
sources: {"/var/www/html": "https://wordpress.org/wordpress-4.2.4.tar.gz"}
files:
"/root/config.sh":
content:
"Fn::Join":
- ""
- [
"#!/bin/bash -ex\n",
"cp wp-config-sample.php wp-config.php\n",
"sed -i \"s/'database_name_here'/'wordpress'/g\" wp-config.php\n",
"sed -i \"s/'username_here'/'wordpress'/g\" wp-config.php\n",
"sed -i \"s/'password_here'/'wordpress'/g\" wp-config.php\n",
"sed -i \"s/'localhost'/'", {"Fn::GetAtt": ["Database", "Endpoint.Address"]}, "'/g\" wp-config.php\n",
"echo \"define('AWS_ACCESS_KEY_ID', '", {"Ref": "IAMAccessKey"},"'); \" >> wp-config.php \n",
"echo \"define('AWS_SECRET_ACCESS_KEY', '", {"Fn::GetAtt": ["IAMAccessKey", "SecretAccessKey"]},"'); \" >> wp-config.php \n",
"echo \"define( 'DISALLOW_FILE_MODS', true ); \" >> wp-config.php \n",
"echo \"define( 'WP_AUTO_UPDATE_CORE', false ); \" >> wp-config.php \n",
"chmod -R 777 wp-content/ \n",
"curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \n",
"php wp-cli.phar core install --url=\"", {"Fn::GetAtt": ["LoadBalancer", "DNSName"]}, "\" --title=\"", {"Ref": "BlogTitle"}, "\" --admin_user=\"", {"Ref": "BlogAdminUsername"}, "\" --admin_password=\"", {"Ref": "BlogAdminPassword"}, "\" --admin_email=\"", {"Ref": "BlogAdminEMail"}, "\" \n",
"php wp-cli.phar plugin install --activate amazon-web-services \n",
"php wp-cli.phar plugin install --activate amazon-s3-and-cloudfront \n",
"CHARCOUNT=`printf \"",{"Ref": "BlogID"} ,"\" | wc -c` \n",
"php wp-cli.phar db query \"DELETE FROM wp_options WHERE option_name = 'tantan_wordpress_s3'; INSERT INTO wp_options (option_name, option_value, autoload) VALUES('tantan_wordpress_s3', 'a:15:{s:17:\\\"post_meta_version\\\";i:1;s:6:\\\"bucket\\\";s:", "$CHARCOUNT", ":\\\"", {"Ref": "BlogID"},"\\\";s:6:\\\"region\\\";s:0:\\\"\\\";s:6:\\\"domain\\\";s:9:\\\"subdomain\\\";s:7:\\\"expires\\\";s:1:\\\"0\\\";s:10:\\\"cloudfront\\\";s:0:\\\"\\\";s:13:\\\"object-prefix\\\";s:19:\\\"wp-content/uploads/\\\";s:10:\\\"copy-to-s3\\\";s:1:\\\"1\\\";s:13:\\\"serve-from-s3\\\";s:1:\\\"1\\\";s:17:\\\"remove-local-file\\\";s:1:\\\"0\\\";s:3:\\\"ssl\\\";s:7:\\\"request\\\";s:12:\\\"hidpi-images\\\";s:1:\\\"0\\\";s:17:\\\"object-versioning\\\";s:1:\\\"0\\\";s:21:\\\"use-yearmonth-folders\\\";s:1:\\\"1\\\";s:20:\\\"enable-object-prefix\\\";s:1:\\\"1\\\";}', 'yes');\" \n"
]
mode: "000500"
owner: "root"
group: "root"
commands:
01_mv:
command: "mv * ../"
cwd: "/var/www/html/wordpress"
02_config:
command: "/root/config.sh"
cwd: "/var/www/html"
services:
sysvinit:
httpd:
enabled: "true"
ensureRunning: "true"
Properties:
ImageId: {"Fn::FindInMap": ["EC2RegionMap", {"Ref": "AWS::Region"}, "AmazonLinuxAMIHVMEBSBacked64bit"]}
InstanceType: {"Ref": "WebServerInstanceType"}
SecurityGroups: [{"Ref": "WebServerSecurityGroup"}]
KeyName: {"Ref": "WebServerKeyName"}
AssociatePublicIpAddress: "true"
UserData:
"Fn::Base64":
"Fn::Join":
- ""
- [
"#!/bin/bash -ex\n",
"yum update -y aws-cfn-bootstrap\n",
"/opt/aws/bin/cfn-init -v --stack ", {"Ref": "AWS::StackName"}, " --resource LaunchConfiguration --region ", {"Ref": "AWS::Region"}, "\n",
"/opt/aws/bin/cfn-signal -e $? --stack ", {"Ref": "AWS::StackName"}, " --resource AutoScalingGroup --region ", {"Ref": "AWS::Region"}, "\n"
]
InstanceMonitoring: "true"
AutoScalingGroup:
Type: "AWS::AutoScaling::AutoScalingGroup"
Properties:
LoadBalancerNames: [{"Ref": "LoadBalancer"}]
LaunchConfigurationName: {"Ref": "LaunchConfiguration"}
MinSize: "2"
MaxSize: "4"
DesiredCapacity: "2"
Cooldown: "60"
HealthCheckGracePeriod: "120"
HealthCheckType: "ELB"
VPCZoneIdentifier: [{"Ref": "SubnetA"}, {"Ref": "SubnetB"}]
Tags:
- PropagateAtLaunch: "true"
Value: "wordpress"
Key: "Name"
CreationPolicy:
ResourceSignal:
Timeout: "PT10M"
ScalingUpPolicy:
Type: "AWS::AutoScaling::ScalingPolicy"
Properties:
AdjustmentType: "PercentChangeInCapacity"
MinAdjustmentStep: "1"
AutoScalingGroupName: {"Ref": "AutoScalingGroup"}
Cooldown: "300"
ScalingAdjustment: "25"
CPUHighAlarm:
Type: "AWS::CloudWatch::Alarm"
Properties:
EvaluationPeriods: "1"
Statistic: "Average"
Threshold: "75"
AlarmDescription: "Alarm if CPU load is high."
Period: "60"
AlarmActions: [{"Ref": "ScalingUpPolicy"}]
Namespace: "AWS/EC2"
Dimensions:
- Name: "AutoScalingGroupName"
Value: {"Ref": "AutoScalingGroup"}
ComparisonOperator: "GreaterThanThreshold"
MetricName: "CPUUtilization"
ScalingDownPolicy:
Type: "AWS::AutoScaling::ScalingPolicy"
Properties:
AdjustmentType: "PercentChangeInCapacity"
MinAdjustmentStep: "1"
AutoScalingGroupName: {"Ref": "AutoScalingGroup"}
Cooldown: "300"
ScalingAdjustment: "-25"
CPULowAlarm:
Type: "AWS::CloudWatch::Alarm"
Properties:
EvaluationPeriods: "1"
Statistic: "Average"
Threshold: "25"
AlarmDescription: "Alarm if CPU load is low."
Period: "60"
AlarmActions: [{"Ref": "ScalingDownPolicy"}]
Namespace: "AWS/EC2"
Dimensions:
- Name: "AutoScalingGroupName"
Value: {"Ref": "AutoScalingGroup"}
ComparisonOperator: "LessThanThreshold"
MetricName: "CPUUtilization"
Outputs:
URL:
Value: {"Fn::Join": ["", ["http://", {"Fn::GetAtt": ["LoadBalancer", "DNSName"]}]]}
Description: "URL to Wordpress"
The template you provided (which seems to be from cloudonaut) does not create a single EC2 instance, it creates an Auto Scaling Group containing 2-4 EC2 instances in order to provide high-availability and load-based scaling to the Wordpress installation.
You will need to copy the following resources once for each new Wordpress installation you require (e.g., the resource named LoadBalancer should be copied with new names like LoadBalancer2, LoadBalancer3, etc):
LoadBalancer
LaunchConfiguration
AutoScalingGroup
ScalingUpPolicy
CPUHighAlarm
ScalingDownPolicy
CPULowAlarm
You will also need to change the reference to the database from wordpress to wordpress2, wordpress3, etc in each updated LaunchConfiguration user-data script, in the following line:
"sed -i \"s/'database_name_here'/'wordpress'/g\" wp-config.php\n",
This should give you a working template, though it will have a lot of repetition across each installation's resources. You could probably refactor the duplicated resources into a nested stack that you can reuse across each instance, passing the database reference through stack outputs, and so on.

Getting blob data from database using apache camel

I try to get a blob out of a database using camel (2.15.1). The data size is about 20 mb. This is my route:
<route streamCache="true">
<from uri="file://c:/tmp/trigger" />
<to uri="jdbc:datasourceCosima" />
<log message="done 1."/>
<to uri="direct:a" />
</route>
<route streamCache="true">
<from uri="direct:a" />
<to uri="file:blobdata" />
<log message="done 2."/>
</route>
To start it i place a file with the sql command in c:/tmp/trigger. The content is something like select bls_data from blob_storage where io_id='2fe0...'
This is the result:
[2016-02-18 12:44:15.539] INFO: org.apache.camel.util.CamelLogger log - done 1.
[2016-02-18 12:44:16.553] SEVERE: org.apache.camel.util.CamelLogger log - Failed delivery for (MessageId: ID-GHD13044-49732-1455793836517-2-2382 on ExchangeId: ID-GHD13044-49732-1455793836517-2-2381). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[org.apache.camel.component.file.GenericFileMessage#7a0613]
Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId ProcessorId Processor Elapsed (ms)
[route9 ] [route9 ] [file://c:/tmp/trigger ] [ 1635]
[route9 ] [to13 ] [jdbc:datasourceCosima ] [ 822]
[route9 ] [log12 ] [log ] [ 1]
[route9 ] [to14 ] [direct:a ] [ 813]
[route10 ] [to15 ] [file:blobdata ] [ 812]
Exchange
---------------------------------------------------------------------------------------------------------------------------------------
Exchange[
Id ID-GHD13044-49732-1455793836517-2-2381
ExchangePattern InOnly
Headers {breadcrumbId=ID-GHD13044-49732-1455793836517-2-2380, CamelFileAbsolute=true, CamelFileAbsolutePath=c:\tmp\trigger\select.txt, CamelFileContentType=null, CamelFileLastModified=1455793414658, CamelFileLength=179, CamelFileName=select.txt, CamelFileNameConsumed=select.txt, CamelFileNameOnly=select.txt, CamelFileParent=c:\tmp\trigger, CamelFilePath=c:\tmp\trigger\select.txt, CamelFileRelativePath=select.txt, CamelJdbcColumnNames=[bls_data], CamelJdbcRowCount=1, CamelRedelivered=false, CamelRedeliveryCounter=0}
BodyType java.util.ArrayList
Body [{bls_data=255044462D312E360D25E2E3CFD30D0A3...
]
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[org.apache.camel.component.file.GenericFileMessage#7a0613]
at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1635)
at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:308)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433)
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.OutOfMemoryError: Java heap space
I thought that streamCache would do the job and cache the data on disc or whatever.
So the question is: How to get blob data from a database into a file without size restriction?

Resources