2

I'm trying to move from Heroku to Fly.io + Supabase.

I managed to have my app working on fly.io when connected to the postgres database of my heroku app, using the command:

fly secrets set DATABASE_URL="XXX"

where XXX is the value of the DATABASE_URL found in the config vars of the settings of my heroku app, which looks like postgres://....

great !

Now I'm trying to replace it with the Connection (Pooling) String from my Supabase database settings :

fly secrets set DATABASE_URL="postgres://[USER]:[PWD]@[SERVER]:6543/[DBNAME]"

But then, I get

--> v11 failed - Failed due to unhealthy allocations - rolling back to job version 10 and deploying as v12.

I'm certain that my Supabase database password is okay since I'm able to connect to it in my terminal using

psql -h [HOST] -p 6543 -d [DBNAME] -U [USER]

I also tested to add the domains of my app (both my real app URL and my fly.io url) in Supabase > Settings > Redirect URLs, but it is not working either : I still get the same error.

If I rollback to my Heroku database URL, it works.

So it seems that my app CAN work on fly.io, but that there is an error connecting to Supabase, correct ?

Does anyone have a clue of how achieving this ?

Thanks !

gordie
  • 1,637
  • 3
  • 21
  • 41

1 Answers1

1

I found out that this was due because of my database password containing special characters - as mentionned in the documentation of Supabase. After I have URL-encoded it, it works fine !

gordie
  • 1,637
  • 3
  • 21
  • 41