Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[bug] Changing the sourcebot config and starting a new container causes DB permission errors #568

@tanner-barnes-tinder

Description

@tanner-barnes-tinder

Describe the bug

There seems to be a permissions error when trying to update a config file. I needed to add a new connection but that requires a new container since you can't update the env variables of an existing container. When I tried to make a new one it fails with a permission denied when trying to access the DB.

[Info] Sourcebot version: v4.7.3
[Info] Disabling telemetry since SOURCEBOT_TELEMETRY_DISABLED was set.
[Info] Initializing database at /data/.sourcebot/db...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with this locale configuration:
  provider:    libc
  LC_COLLATE:  C
  LC_CTYPE:    C.UTF-8
  LC_MESSAGES: C
  LC_MONETARY: C
  LC_NUMERIC:  C
  LC_TIME:     C
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: error: could not access directory "/data/.sourcebot/db": Permission denied
``

### To reproduce

1. create a config file with a connection
2. start container like so:

sudo docker run -d -p 80:3000 --pull=always -v $(pwd):/data -e CONFIG_PATH=/data/configs/auth.json -e GITHUB_HOSTED= -e AWS_BEDROCK_ACCESS_KEY_ID= -e AWS_BEDROCK_SECRET_ACCESS_KEY= -e GITHUB_CLOUD= -e AUTH_URL=https://sourcebot..net -e SOURCEBOT_TELEMETRY_DISABLED=true -e SOURCEBOT_LOG_LEVEL=debug --name sourcebot ghcr.io/sourcebot-dev/sourcebot:latest

3. stop the container and add a new connection to the config file
4. start a new container:

sudo docker run -d -p 80:3000 --pull=always -v $(pwd):/data -e CONFIG_PATH=/data/configs/auth.json -e GITHUB_HOSTED= -e AWS_BEDROCK_ACCESS_KEY_ID= -e AWS_BEDROCK_SECRET_ACCESS_KEY= -e GITHUB_CLOUD= -e AUTH_URL=https://sourcebot..net -e SOURCEBOT_TELEMETRY_DISABLED=true -e SOURCEBOT_LOG_LEVEL=debug -e SHARED= --name sourcebot-shared ghcr.io/sourcebot-dev/sourcebot:latest


### Sourcebot deployment information

version: 4.7.2
AWS linux instance
self-contained single container
mounted host folder for data

### Additional information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions