Error 500: ERROR: syntax error at or near "<number_in_app_name>" (SQLSTATE 42601)

Hi there! I spin up a simple preview stack in my CI pipeline, and name it with the short git SHA and PR number followed by the app name, e.g. 25e102d-pr86-beacon with 25e102d-pr86-beacon-db for the database.

Yesterday I saw the following errors when trying to attach my Postgres DB to the app:

$ fly pg attach -a 95cebe9-pr86-beacon --postgres-app 95cebe9-pr86-beacon-db
Error 500: ERROR: syntax error at or near "95" (SQLSTATE 42601)

and again with a second run:

$ fly pg attach -a 25e102d-pr86-beacon --postgres-app 25e102d-pr86-beacon-db
Error 500: ERROR: syntax error at or near "25e102" (SQLSTATE 42601)

It seems like when the app name begins with a number there are problems – I think in the second case it’s interpreting 25e102 as 25 * 10^102. I could of course change this to start with a letter, but I’m not sure if that’s actually the issue.

This preview naming pattern has been in use for about a month, so I’m curious if something may have changed on the fly.io side?

Update: the above errors happen in GitHub Actions with the superfly/flyctl-actions@1.1 action. But when I run the attach command locally it seems to work…?

Update 2: I’ve since renamed my previews to start with prXX- first, and haven’t had any failures so far.

1 Like