question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lhci-server docker image crashes when passed storage env variables in Node14

See original GitHub issue

Describe the bug Docker Image for 0.9.0 crashes when passed ENV variables for Database parameters. This is due to Node14 and an older version of Sequelize in the server package. Upgrading Sequelize resolved the issue for me.

To Reproduce Steps to reproduce the behavior:

  1. Pull latest image down patrickhulce/lhci-server:0.9.0
  2. Run a local postgres DB - docker run --name postgres-docker -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
  3. Run docker run -p 9001:9001 -e LHCI_STORAGE__SQL_DIALECT=postgres -e LHCI_STORAGE__SQL_CONNECTION_URL=postgres://postgres:postgres@host.docker.internal:5432/postgres patrickhulce/lhci-server:0.9.0 * if not on mac change host.docker.internal to reference the postgres container or host address.
  4. Docker crashes
  5. Go to step 3 but with release 0.8.2 and it works as expected.

Expected behavior A clear and concise description of what you expected to happen. Application runs and does not crash as seen in 0.8.2

Logs/Screenshots If applicable, add LHCI logs or screenshots to help explain your problem.

issue when running with docker

➜  docker run -p 9001:9001  -e LHCI_STORAGE__SQL_DIALECT=postgres -e LHCI_STORAGE__SQL_CONNECTION_URL=postgres://postgres:postgres@host.docker.internal:5432/postgres lhci-server
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'start',
npm verb cli   '--verbose',
npm verb cli   '-ddd'
npm verb cli ]
npm info using npm@6.14.16
npm info using node@v14.19.1
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle lhci@0.0.0~prestart: lhci@0.0.0
npm info lifecycle lhci@0.0.0~start: lhci@0.0.0

> lhci@0.0.0 start /usr/src/lhci
> lhci server --config=./lighthouserc.json

npm verb lifecycle lhci@0.0.0~start: unsafe-perm in lifecycle true
npm verb lifecycle lhci@0.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/lhci/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle lhci@0.0.0~start: CWD: /usr/src/lhci
npm sill lifecycle lhci@0.0.0~start: Args: [ '-c', 'lhci server --config=./lighthouserc.json' ]
npm sill lifecycle lhci@0.0.0~start: Returned: code: 0  signal: null
npm info lifecycle lhci@0.0.0~poststart: lhci@0.0.0
npm verb exit [ 0, true ]
npm timing npm Completed in 1613ms
npm info ok

on Local machine from docs/recipes/docker-server directory:

➜ LHCI_STORAGE__SQL_DIALECT="postgres" LHCI_STORAGE__SQL_CONNECTION_URL="postgres://postgres:postgres@localhost:5432/postgres" npm --verbose start
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/Users/user1/.nvm/versions/node/v14.19.0/bin/node',
npm verb cli   '/Users/user1/.nvm/versions/node/v14.19.0/bin/npm',
npm verb cli   '--verbose',
npm verb cli   'start'
npm verb cli ]
npm info using npm@6.14.16
npm info using node@v14.19.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle lhci@0.0.0~prestart: lhci@0.0.0
npm info lifecycle lhci@0.0.0~start: lhci@0.0.0

> lhci@0.0.0 start /Users/user1/Codebase/forks/lighthouse-ci/docs/recipes/docker-server
> lhci server --config=./lighthouserc.json

npm verb lifecycle lhci@0.0.0~start: unsafe-perm in lifecycle true
npm verb lifecycle lhci@0.0.0~start: PATH: /Users/user1/.nvm/versions/node/v14.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/user1/Codebase/forks/lighthouse-ci/docs/recipes/docker-server/node_modules/.bin:/Users/user1/.nvm/versions/node/v14.19.0/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/sbin:/usr/local/opt/openjdk@11/bin:/Users/user1/.nvm/versions/node/v12.14.1/bin:/Users/user1/.nvm/versions/node/v12.14.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/sbin:/usr/local/opt/openjdk@11/bin:/Users/user1/.nvm/versions/node/v12.14.1/bin
npm verb lifecycle lhci@0.0.0~start: CWD: /Users/user1/Codebase/forks/lighthouse-ci/docs/recipes/docker-server
npm info lifecycle lhci@0.0.0~poststart: lhci@0.0.0
npm verb exit [ 0, true ]
npm timing npm Completed in 1154ms
npm info ok 

Environment (please complete the following information):

  • OS: MacOS Host within Docker environment
  • Browser: N/A
  • Version: 0.9.0

Additional context Seems to work locally when using Node12.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SanjuTechie87commented, Aug 4, 2022

@connorjclark Hi, I can see the issue is fixed but the last available release is 0.9.0 which doesn’t contain this fix. Can a new release be made with this fix along with docker image. It would be very helpful . Thanks

1reaction
metalix2commented, Mar 28, 2022

Yeah I had the same it took a bit of debugging but I believe it comes down to the node update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker doesn't get the environment variables and fails to start ...
Turns out the env variables had to be in capital case environment: SERVER_USER: "user" SERVER_PASS: "pass" SERVER_PORT: 1234 SERVER_IP: nats ...
Read more >
Environment variable not processed - General
I'm trying to run an elasticsearch docker container passing the following environment variable, which is required in my case.
Read more >
Dockerizing a Node.js Web Application - Semaphore Tutorial
Handle persistence of data using Docker Volumes. Set environment variables. Build or download container images as required. Docker Compose uses ...
Read more >
wYi - River Thames Conditions - Environment Agency - GOV.UK
#apensar Sea lamprey lake champlain, Colander microeconomics quiz, Past times ... Fsa bb30 bearing installation, Quadcon shipping container, Andre hazes ...
Read more >
Automating Google Lighthouse audits and uploading results ...
... CI server Docker container running both locally and in Azure. ... The upload target of temporary-public-storage means once run, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found