error retrieving logs and release command fails

i’m deploying a fastify app to fly pretty much for the first time… i’ve done a few successful deployments now, I have the thing deploying using a Dockerfile image, and works so far pretty good.

Now i’m trying to get the release command working, and I added a shell script which works locally ie.

[deploy]
  release_command = "./scripts/release-command.sh"

however it fails the deployment with no message:


--> You can detach the terminal anytime without stopping the deployment
==> Release command detected: ./scripts/release-command.sh

--> This release will not be available until the release command succeeds.
Error release command failed, deployment aborted

also flyctl logs doesn’t give me anything… in the UI it even fails with a 422 unprocessable entity… even successful deployments give me no logs. i’ve tried re-authing and it’s pretty much the same.

also, the activity list does not show the failed deployment/release with the release command:

How can I figure out why it’s failing or see an error message?

Current deployment url/app: https://pure-api.fly.dev/ – from pervious deployment… works fine

logs:

Regarding the logs, there is a current issue with those (in the UI anyway). So logs won’t be showing up there:

That may be affecting the CLI too now.

As regards seeing the cause of the failure … if your release shows you a vm id at any point (the easy place to get that is the logs, but, well …) an alternative way to get at that would be to look at one’s status:

fly vm status [id here]

… and that may show issues/errors to show what went wrong. However it too may be affected if logging in general is not being output. Not sure how intertwined those two are.

Getting historical logs from a release command is unecessarily difficult, here’s what yours printed:

Starting init (commit: 6f9865f)...
Preparing to run: `docker-entrypoint.sh ./scripts/release-command.sh` as root
2022/03/25 11:29:15 listening on [fdaa:0:55af:a7b:2809:a3:434e:2]:22 (DNS: [fdaa::3]:53)
yarn run v1.22.18
$ yarn workspace @purenorth/prisma prisma migrate deploy
$ /home/nodejs/app/node_modules/.bin/prisma migrate deploy
Prisma schema loaded from schema.prisma
Datasource "db": MySQL database "pure-api" at "...psdb.cloud:3306"
Error: P1011: Error opening a TLS connection: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /usr/local/bin/node
Arguments: /opt/yarn-v1.22.18/lib/cli.js prisma migrate deploy
Directory: /home/nodejs/app/prisma
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Main child exited normally with code: 1
Starting clean up.

What does your Dockerfile look like? You may need to install a ca-certificates package or somehow point Prisma to the root ca store.

1 Like

Yep, I agree with @kurt. It’s failing at the database connection.

Since the error mentions psdb.cloud I recognise that as being PlanetScale, so this page may be useful:

1 Like

yeah, it’s a planetscale db… those are really helpful… as soon as i see those messages I believe I know what’s up… agree that it convoluted to see these errors and the docs dont have any info about how to go about debugging a release command failure.

thanks a lot @kurt - how did you get the historical log from the release command?

1 Like

I ended up abandoning planetscale and moved the db over the the fly postgres… ended up being a lot simpler :slight_smile:

1 Like

I went and looked internally. We temporarily disabled a log API endpoint that prevented you from seeing them. I think if you hit a similar issue now, you’d see it in your deploy output (it should definitely show there).