lhci-server docker image crashes when passed storage env variables in Node14
See original GitHub issueDescribe 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:
- Pull latest image down
patrickhulce/lhci-server:0.9.0
- Run a local postgres DB -
docker run --name postgres-docker -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
- 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. - Docker crashes
- 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:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
Yeah I had the same it took a bit of debugging but I believe it comes down to the node update.