cli icon indicating copy to clipboard operation
cli copied to clipboard

Support for GitPod

Open Haberkamp opened this issue 3 years ago • 2 comments

Bug report

Describe the bug

It seems that it's not possible to start supabase in a gitpod workspace

To Reproduce

Steps to reproduce the behaviour, please provide code snippets or a repository:

  1. Create a new gitpod workspace
  2. Install supabase via homebrew
  3. Run supabase init and after that supabase start
  4. See error

Expected behaviour

All containers should start successfully without an error.

Screenshots

Bildschirmfoto 2022-05-17 um 14 19 26

System information

  • OS: Remote GitPod Server (probably a Linux machine)
  • Browser (if applies) Not relevant
  • Version of supabase-js: 1.34.0
  • Version of supabase-cli: 0.26.0
  • Version of Node.js: 16.15.0

Haberkamp avatar May 17 '22 12:05 Haberkamp

I'm not familiar with GitPod, but can you do everything the Docker CLI can do inside it?

soedirgo avatar May 18 '22 07:05 soedirgo

Yes, I was able to pull a docker image for adminer (a tool for database management with a web ui) and I could reach the application. So you're able to use the Docker CLI in GitPod.

EDIT: When working inside a GitPod instance you are already inside a docker container. I don't know if this is a problem since running the supabase start command creates new containers and you now have multiple containers inside another container.

Haberkamp avatar May 19 '22 06:05 Haberkamp

When working inside a GitPod instance you are already inside a docker container.

Running CLI in docker would require docker-in-docker support. I have not tested this myself but it appears to be supported on GitPod https://github.com/gitpod-io/gitpod/issues/52#issuecomment-738629624

sweatybridge avatar Mar 19 '23 05:03 sweatybridge

I have a similar problem, but different errors when I run supabase start.

failed to register layer: ApplyLayer exit status 1 stdout:  stderr: failed to Lchown "/usr/local/lib/node_modules/pm2/node_modules/nssocket/.npmignore" for UID 1389985163, GID 386085923 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /usr/local/lib/node_modules/pm2/node_modules/nssocket/.npmignore: invalid argument

and

Error: failed to register layer: ApplyLayer exit status 1 stdout:  stderr: failed to Lchown "/usr/local/lib/node_modules/pm2/node_modules/nssocket/.npmignore" for UID 1389985163, GID 386085923 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /usr/local/lib/node_modules/pm2/node_modules/nssocket/.npmignore: invalid argument
Try rerunning the command with --debug to troubleshoot the error.

See the attached log.txt file.

zivbk1 avatar Apr 09 '23 00:04 zivbk1

@Haberkamp Did you run supabase login before init and start?

To Reproduce

Steps to reproduce the behaviour, please provide code snippets or a repository:

  1. Create a new gitpod workspace
  2. Install supabase via homebrew
  3. Run supabase init and after that supabase start
  4. See error

zivbk1 avatar Apr 09 '23 00:04 zivbk1

I'm still getting exactly what @zivbk1 posted, even on CLI version 1.50.4. I've seen related issues on the internet that suggest modifying /etc/subuid and /etc/subgid, but even though those are writeable from the terminal in GitPod using sudo, I can't seem to get said modifications to have any effect (very possible I'm doing something wrong).

I can't find much else on the internet regarding this issue.

Related:

  • https://github.com/supabase/cli/pull/296 (I thought this would have fixed it, but this is old)
  • https://github.com/moby/moby/issues/43576

zlanich avatar Apr 16 '23 23:04 zlanich

I managed to run supabase start on GitPod using CLI v1.50.8. Here are the fixes we made

  1. bump storage-api to v0.37.4 which avoids installing nssocket
  2. updates health check to resolve localhost to ipv4 address
gitpod /workspace/cli (main) $ go run . start
Setting up Edge Functions runtime...
Seeding data supabase/seed.sql...
Started supabase local development setup.

         API URL: http://localhost:54321

Please give it another try after updating and feel free to reopen if it doesn't work.

sweatybridge avatar Apr 17 '23 13:04 sweatybridge

@sweatybridge YES, just bumping supabase in package.json fixed everything. Thank you!

zlanich avatar Apr 17 '23 23:04 zlanich