cli icon indicating copy to clipboard operation
cli copied to clipboard

Supabase db remote commit failing

Open oliviercperrier opened this issue 4 years ago • 5 comments

Bug report

Describe the bug

When running supabase db remote commit the following error occur: Error: unexpected end of JSON input

To Reproduce

  1. Run: supabase init
  2. Run: supabase db remote set [your-db-url]
  3. Run: supabase db remote commit
  4. See error

Expected behavior

Should work as excepted and as said in the documentation: https://github.com/supabase/cli/tree/main/examples/tour

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of supabase cli: 0.15.10

oliviercperrier avatar Dec 27 '21 08:12 oliviercperrier

Could be the same issue as https://github.com/supabase/cli/issues/116 - I've updated the CLI to validate the URL passed to db remote set in v0.15.12.

soedirgo avatar Dec 28 '21 20:12 soedirgo

I have the same problem using 0.15.15. What I have tried:

  • I have created a new Supabase project and used a password that does not contain any characters that require url encoding. Setting the remote db is possible but it fails when executing the commit command.
  • I built the latest version from the source code and applied it to my project. For me it fails here. Maybe it's related to https://github.com/supabase/pgadmin4/issues/24?
  • Since the old link command worked for me at some point, I tried to downgrade the cli to 0.12.4. I checked out 68e580d and ran the old link command by building from source (I also had to cherry-pick this). I got the message Finished `supabase link`. although no XX_link.sql migration was created.

I have no experience with Go, so I don't know if this information is helpful.

damianfrizzi avatar Jan 06 '22 23:01 damianfrizzi

I am also getting this, on a relatively simple db that I just set up.

I don't believe there's anything in the password that requires url escaping.

Any word on this issue?

jamesyu avatar Jan 18 '22 22:01 jamesyu

I haven't been able to replicate this, but I think it might be what Damian linked above (some logging in the schema diff). I'm currently working on other open issues, but will loop back once I have any updates.

soedirgo avatar Jan 19 '22 07:01 soedirgo

I just tried the latest cli version 0.17.0 with a fresh supabase project and it worked.

I created a dump of the old database structure and applied it to the new supabase project via a migration. On the old, "broken" project there were some tables that had "supabase-admin" as an owner. I had to change this to "postgres". Not sure this is related to this issue, though.

damianfrizzi avatar Feb 02 '22 10:02 damianfrizzi

Closing this for staleness - there's been a lot of change since this issue was raised, so if anyone's still bumping into this, please create a new issue.

soedirgo avatar Sep 29 '22 10:09 soedirgo