Deploy error with flyctl-actions - Failed to launch: determine start command / failed due to unhealthy allocations

Hey there,

I’m trying to deploy with superfly/flyctl-actions@master. My app has been deploying perfectly with this setup so far, but today I keep getting this error at the end of the process, when trying to release:

ERROR: failed to launch: determine start command: when there is no default process a command is required

(adding some stuff before the error for context)

Recent Events
TIMESTAMP           	TYPE      	MESSAGE                         
2022-01-21T14:09:10Z	Received  	Task received by client        	
2022-01-21T14:09:10Z	Task Setup	Building Task Directory        	
2022-01-21T14:09:48Z	Started   	Task started by client         	
2022-01-21T14:09:50Z	Terminated	Exit Code: 82                  	
2022-01-21T14:09:50Z	Restarting	Task restarting in 1.107794263s	
2022-01-21T14:09:56Z	Started   	Task started by client         	
2022-01-21T14:09:58Z	Terminated	Exit Code: 82                  	
2022-01-21T14:09:58Z	Restarting	Task restarting in 1.164060929s	
2022-01-21T14:10:05Z	Started   	Task started by client         	


2022-01-21T14:09:48.000 [info] 2022/01/21 14:09:48 listening on [fdaa:0:2dc7:a7b:28df:3be6:763e:2]:22 (DNS: [fdaa::3]:53)

2022-01-21T14:09:48.000 [info] ERROR: failed to launch: determine start command: when there is no default process a command is required

I’m running a node app using heroku/buildpacks:20.

Is there anything new that I need to add to my project, like a Dockerfile?

I’m not sure if it’s related or not, but the end of the job says “Failed due to unhealthy allocations”.

Many thanks if someone can help me out with this!!

So I managed to solve this by adding cmd = "npm start" to the [experimental] section of fly.toml. I think this was being guessed by fly before, but I needed to make it explicit now. I’m okay with this, and like it more even, but what might have changed?

Do you still have a Procfile in your app? The buildpack should detect a Procfile and then default to launching the web process in it, I think.

Your workaround is fine! But I’m surprised that broke. :confused:

Oh, I don’t think I ever had a Procfile!

I ran into the same issue today (first deploy this year). No procfile, but @Claudia’s fix worked. Here are some CI/CD logs shown in Github that might be useful:

[Installing Node]
[INFO] Getting Node version
[INFO] Resolving Node version
[INFO] Downloading and extracting Node v16.13.2
[INFO] Setting NODE_ENV to production

[Parsing package.json]
[INFO] Parsing package.json

[Installing yarn]
[INFO] Installing yarn@1.22.17
[INFO] No file to start server
[INFO] either use 'docker run' to start container or add index.js or server.js
1 Like

Good (I mean not really lol)… my suspicion gains legitimacy.

This is related -

… which in turn points to Start script not used for Yarn buildpack · Issue #183 · heroku/buildpacks-nodejs · GitHub

1 Like

I added this to my package.json:

"scripts": {
  "start": "node dist/app.js"
}

Just replace app.js with whatever you call the entry point to your Node app

1 Like

Thanks! This solved my error. It was definitely looking for an entry point.