Seeing "Error 422 Unprocessable Entity" on deploys

Hello, I am seeing failing deploys (the fly command exits non-zero) with the “Error 422 Unprocessable Entity” message at the end. Here’s a snippet of the last bit of output for this app (fe-anchor-stg-anchordotdev):

--> Pushing image done
==> Creating release
--> release v129 created

--> You can detach the terminal anytime without stopping the deployment
==> Release command detected: bin/rails db:reset db:migrate db:seed

--> This release will not be available until the release command succeeds.
Error 422 Unprocessable Entity

I encountering this both locally and in a github action.

release command fail, stop the progress.

The release command is weird, db:reset will drop the db and recreate it, it should not use in production env. Usually db:migrate is enough.

What is your deployment method? images or buildpacks?

It’s a staging app that reseeds the database on every deploy. On a normal failure, i get something like the following:

  Tasks: TOP => db:migrate:with_data
  (See full trace by running task with --trace)
  Main child exited normally with code: 1
  Main child exited normally with code: 1
  Starting clean up.
  Starting clean up.
Error release command failed, deployment aborted

I don’t see any exit code or indication of an error, and the deploy seems to have succeeded despite the “Error 422” message. Is this a problem with the platform or something in my own deploy scripts?

/cc @jsierles @eli

Migrate task fails, I’m not sure how to check release logs, maybe try flyctl logs.

Can you try again with LOG_LEVEL=debug and post the result? This will help determine which request is getting the 422 response.

Thanks for the LOG_LEVEL tip, I’ve added it to my deploy script but i’m not seeing the 422 response anymore. I’ll reply here with the debug output if it happens again.