Closed Masahigo closed 2 years ago
So the errors re startup probes: there is a default health probe for apps so that we as a service can ensure your app is up and running before we forward traffic to it- that is the probe that you see failing. You can override the default probe by applying any health probe
As an aside, we don't support the concept of "Jobs" natively in aca today. Apps are considered always running so I have a feeling this could be based on your use of cron within the app itself. Jobs are currently being designed and will support triggering via cron. I am unsure if this workload will run properly based on your use of cron within the app itself.
It's hard to troubleshoot this without access to your env. Do you mind opening a support ticket so we can properly address? If not can you send your env details and this github issue to acasupport@microsoft.com?
Can you instruct how to override the default health probe via Azure CLI? I couldn't find an example from here.
I noticed the NodeJS http server implementation was having some race condition issues, I was able to reproduce that same error ".. connection refused" locally.
Via the CLI you can pass in a yaml file: https://learn.microsoft.com/en-us/azure/container-apps/health-probes?tabs=yaml#http-probes to override the default. Is not required to override them, more so just wanted to indicate that is what that error message is coming from :)
The race condition issue I mentioned about was fixed by making the following change: adding return
to close the HTTP connections from the startup probe
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
return res.end('Background worker\n');
});
But the service itself is still stuck to provisioning state - at least in that Revision management UI view. Seems the way I've implemented the cron job within the service is the root cause for it.
Nevertheless, the service is working as intended to so closing this issue for now.
This issue is a: (mark with an x)
Issue description
I have a simple NodeJS based background worker type of app which should always be "on". The app is served in Node process and written using TypeScript.
Here's the source file
index.ts
This is containerised to a container image.
When I deploy it to ACA as an internal service - the revision is stuck in the provisioning state and never becomes fully active. The scheduled job seems to execute ok but the service never reaches a healthy state. Azure Container Registry is used as the registry and managed user identity to allow pulling off images from it.
Here are the main commands related to the deployment
Steps to reproduce
Expected behavior [What you expected to happen.]
The service should run without issues like in local dev environment.
Actual behavior [What actually happened.]
From system logs I'm able to see the following error
"Startup probe failed: dial tcp 10.250.0.110:3002: connect: connection refused"
But it's confusing as there is no startup probe defined for the service.
Also the following errors are present in system logs
"Back-off restarting failed container" "ScaledObject doesn't have correct scaleTargetRef specification"
Screenshots
Additional context
In the Azure portal view as shown in the screenshot above.
When run in local environment, the root url of the service responds with HTTP 200