Skip to content

Kong unable to start due to permission error when using umask #129

@madx

Description

@madx

Bug report

Describe the bug

When starting the local development environment with supabase start, the Kong container fails to start because of a permission error if the umask is not 022:

$ supabase start
$ docker logs supabase_kong_projectname
2022/01/04 14:32:22 [warn] 1#0: load balancing method redefined in /usr/local/kong/nginx-kong.conf:59
nginx: [warn] load balancing method redefined in /usr/local/kong/nginx-kong.conf:59
2022/01/04 14:32:22 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:490: error parsing declarative config file /var/lib/kong/kong.yml:
/var/lib/kong/kong.yml: Permission denied
stack traceback:
        [C]: in function 'error'
        /usr/local/share/lua/5.1/kong/init.lua:490: in function 'init'
        init_by_lua:3: in main chunk

When checking the supabase/.temp/kong.yml file, it indeed lacks the others-read permission:

$ ls -hal supabase/.temp/
total 12K
drwxr-x--x 2 madx madx 4.0K Jan  4 15:32 .
drwxr-xr-x 5 madx madx 4.0K Jan  4 15:32 ..
-rw-r----- 1 madx madx 2.8K Jan  4 15:32 kong.yml

To Reproduce

  1. Change your default file creation mask:
$ umask 026
  1. Start supabase:
$ supabase start
  1. Try to access the API and see that it does not respond properly:
$ curl http://localhost:54321

Expected behavior

I expect the development environment to start and the APIs to be available

System information

  • OS: Arch Linux
  • Version of supabase-cli: 0.15.14
  • Version of Node.js: 17.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions