Error: Error response from daemon: Conflict. The container name "/supabase_gen_types_typescript" is already in use by container ...
Bug report
First of all, I am so happy about the changes in Launch Week! Great work. Hyped to try out the Type Generator and the New V2 Supabase JS. But I encountered some issues with it.
Describe the bug
I want to run the typescript generator for a remote url. It errors. See below for details.
To Reproduce
I am trying to get the typescript generator to run. I followed the documentation and ran:
brew install supabase/tap/supabase
supabase login
supabase init
supabase start
So now I have an container running. I see I have to do this, even though I just want to run the typescript generator from my live DB URL. Is that correct? Maybe this should be possible without spinning up a completely local container.
I now run
supabase gen types typescript --db-url 'postgres://postgres:[email protected]_ID.supabase.co:6543/postgres' > generatedTypes.ts
and getting
Error: Error response from daemon: Conflict. The container name "/supabase_gen_types_typescript" is already in use by container "SOME_LONG_RANDOM_ID". You have to remove (or rename) that container to be able to reuse that name.
Expected behavior
I expect to use the typescript generator like described in the supabase docs. I am not a docker expert, so I don't know if I did something wrong while installing and configuring. Following the blog post and docs though, I am not able to get it to run. I was thinking, maybe I have to link the project first with
supabase link --project-ref REF_ID
and entering my DB password, but this just throws an error
Error: failed to connect to `host=db.REF_ID.supabase.co user=postgres database=postgres`: dial error (dial tcp 54.93.86.227:5432: connect: connection refused)
System information
- OS: macOS 12.5 (21G72)
- Version of Node.js: v.16.16
- Version of Supabase CLI v1.0.1
- Upgraded to v1.0.2 as I saw it was recently published.
- Also resetted my DB password to make sure it's the right one
- Restarted the Supabase Live Instance still the same behaviour.
Hi @kryptovergleichde , thanks for reporting. I think our previous code was not removing containers reliably. This should be fixed in v1.0.3 where we rely on docker to auto remove. https://github.com/supabase/cli/pull/374
The new version should appear in homebrew in a few minutes.
@sweatybridge Thank you for your quick answer! Installed v1.0.3, and yes indeed, I am able to generate types. I still have errors with linking, but this would may be another issue. Will try to find a solution. Closing this then.
The linking error is probably due to a connection limit on the backend. I've changed the default to use pg bouncer port in v1.0.4. https://github.com/supabase/cli/commit/540466c05f133b9b60f5f702becdd0948832fb87
Feel free to open another ticket if link still doesn't work.