self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

auth container fails to start because of missing variable

Open r3361 opened this issue 4 years ago • 2 comments

Logs

auth_1                      | query: SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = 'standard_notes_db' AND `TABLE_NAME` = 'migrations'
auth_1                      | query: SELECT * FROM `migrations` `migrations`  ORDER BY `id` DESC
auth_1                      | No migrations are pending
auth_1                      | /var/www/dist/src/Bootstrap/Env.js:22
auth_1                      |             throw new Error(`Environment variable ${key} not set`);
auth_1                      |                   ^
auth_1                      |
auth_1                      | Error: Environment variable VERSION not set
auth_1                      |     at Env.get (/var/www/dist/src/Bootstrap/Env.js:22:19)
auth_1                      |     at ContainerConfigLoader.load (/var/www/dist/src/Bootstrap/Container.js:199:69)
auth_1                      |     at processTicksAndRejections (node:internal/process/task_queues:94:5)
auth_1                      | error Command failed with exit code 1.
auth_1                      | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My docker-compose looks like this, docker/auth.env is pulled from your example auth.env:

  auth:
    image: standardnotes/auth:latest
    depends_on:
      - db
      - cache
      - syncing-server-js
    entrypoint: [
      "./wait-for.sh", "db", "3306",
      "./wait-for.sh", "cache", "6379",
      "./wait-for.sh", "syncing-server-js", "3000",
      "./docker/entrypoint.sh", "start-web"
    ]
    env_file: docker/auth.env
    environment:
      PORT: 3000
      DB_HOST: '${DB_HOST}'
      DB_REPLICA_HOST: '${DB_REPLICA_HOST}'
      DB_PORT: '${DB_PORT}'
      DB_DATABASE: '${DB_DATABASE}'
      DB_USERNAME: '${DB_USERNAME}'
      DB_PASSWORD: '${DB_PASSWORD}'
      DB_DEBUG_LEVEL: '${DB_DEBUG_LEVEL}'
      DB_MIGRATIONS_PATH: '${DB_MIGRATIONS_PATH}'
      REDIS_URL: '${REDIS_URL}'
      AUTH_JWT_SECRET: '${AUTH_JWT_SECRET}'

This Issue only happens on "latest" tag as of yesterday. standardnotes/auth:1.13.1 is working fine.

r3361 avatar Jul 27 '21 09:07 r3361

@karolsojko what should users put for VERSION env var (and can this var auto-assume a value if not provided)?

@Rastaman3 in any case the current value we are using here for VERSION is 1.13.3.

moughxyz avatar Jul 27 '21 14:07 moughxyz

@Rastaman3 please use the standalone repo for self-hosting purposes. The standalone repo does not include the changes that require the VERSION variable yet.

I assume you are using the syncing-server-js version - that one is meant for development purposes only

karolsojko avatar Jul 28 '21 11:07 karolsojko