Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: goof docker build fails. #1290

Open
1 task done
santhosmails opened this issue Jan 3, 2023 · 2 comments
Open
1 task done

[BUG]: goof docker build fails. #1290

santhosmails opened this issue Jan 3, 2023 · 2 comments
Labels

Comments

@santhosmails
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

goof docker build fails and the container is exited.

santa@roli:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e7a8788d5e4d nodejs-goof_goof "npm start" 7 minutes ago Exited (9) 7 minutes ago goof
86ffaea201b0 mysql:5 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp goof-mysql
b6ca72bb5cfe mongo "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:27017->27017/tcp goof-mongo

santa@roli:~$ docker logs goof

[email protected] start /usr/src/goof
NODE_OPTIONS=--openssl-legacy-provider node app.js

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! [email protected] start: NODE_OPTIONS=--openssl-legacy-provider node app.js
npm ERR! Exit status 9
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-01-03T06_00_22_312Z-debug.log
santa@roli:~$ docker logs /root/.npm/_logs/2023-01-03T06_00_22_312Z-debug.log
Error: No such container: /root/.npm/_logs/2023-01-03T06_00_22_312Z-debug.log

Steps To Reproduce

git clone https://github.com/snyk-labs/nodejs-goof.git
cd nodejs-goof
docker-compose up --build

Additional Information

No response

@noraj
Copy link

noraj commented Jan 21, 2023

goof        | > [email protected] start
goof        | > NODE_OPTIONS=--openssl-legacy-provider node app.js
goof        |
goof        | {"app":{},"services":{},"isLocal":true,"name":"goof","port":6001,"bind":"localhost","urls":["http://localhost:6001"],"url":"http://localhost:6001"}
goof        | Using Mongo URI mongodb://goof-mongo/express-todo
goof-mysql  | 2023-01-21T13:20:45.366472Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
goof        | Sat, 21 Jan 2023 13:20:45 GMT express-session deprecated undefined resave option; provide resave option at app.js:42:9
goof        | Sat, 21 Jan 2023 13:20:45 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at app.js:42:9
goof        | token: SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9
goof        | Express server listening on port 3001
goof        | failed connecting and seeding users to the MySQL database
goof        | Error: connect ECONNREFUSED 127.0.0.1:3306
goof        |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)
goof        |     --------------------
goof        |     at Protocol._enqueue (/usr/src/goof/node_modules/mysql/lib/protocol/Protocol.js:144:48)
goof        |     at Protocol.handshake (/usr/src/goof/node_modules/mysql/lib/protocol/Protocol.js:51:23)
goof        |     at PoolConnection.connect (/usr/src/goof/node_modules/mysql/lib/Connection.js:116:18)
goof        |     at Pool.getConnection (/usr/src/goof/node_modules/mysql/lib/Pool.js:48:16)
goof        |     at /usr/src/goof/node_modules/typeorm/driver/mysql/MysqlDriver.js:903:18
goof        |     at new Promise (<anonymous>)
goof        |     at MysqlDriver.createPool (/usr/src/goof/node_modules/typeorm/driver/mysql/MysqlDriver.js:900:16)
goof        |     at MysqlDriver.<anonymous> (/usr/src/goof/node_modules/typeorm/driver/mysql/MysqlDriver.js:301:51)
goof        |     at step (/usr/src/goof/node_modules/tslib/tslib.js:144:27)
goof        |     at Object.next (/usr/src/goof/node_modules/tslib/tslib.js:125:57)
goof        |     at /usr/src/goof/node_modules/tslib/tslib.js:118:75
goof        |     at new Promise (<anonymous>)
goof        |     at __awaiter (/usr/src/goof/node_modules/tslib/tslib.js:114:16)
goof        |     at MysqlDriver.connect (/usr/src/goof/node_modules/typeorm/driver/mysql/MysqlDriver.js:286:38)
goof        |     at Connection.<anonymous> (/usr/src/goof/node_modules/typeorm/connection/Connection.js:112:58)
goof        |     at step (/usr/src/goof/node_modules/tslib/tslib.js:144:27) {
goof        |   errno: -111,
goof        |   code: 'ECONNREFUSED',
goof        |   syscall: 'connect',
goof        |   address: '127.0.0.1',
goof        |   port: 3306,
goof        |   fatal: true
goof        | }
goof        |
goof        | /usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/server.js:235
goof        |         process.nextTick(function() { throw err; })
goof        |                                       ^
goof        | Error: connect ECONNREFUSED 172.20.0.2:27017
goof        |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)
goof        | Emitted 'error' event on NativeConnection instance at:
goof        |     at Connection.error (/usr/src/goof/node_modules/mongoose/lib/connection.js:425:8)
goof        |     at /usr/src/goof/node_modules/mongoose/lib/connection.js:452:14
goof        |     at /usr/src/goof/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:52:21
goof        |     at /usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/db.js:226:14
goof        |     at Server.<anonymous> (/usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/server.js:233:9)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Server.emit (node:events:513:28)
goof        |     at Pool.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/topologies/server.js:263:68)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Pool.emit (node:events:513:28)
goof        |     at Connection.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/connection/pool.js:77:12)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Connection.emit (node:events:513:28)
goof        |     at Socket.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/connection/connection.js:121:49)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Socket.emit (node:events:513:28)
goof        |     at emitErrorNT (node:internal/streams/destroy:151:8)
goof        |     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
goof        |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
goof        |   name: 'MongoError'
goof        | }

@owen-eternal
Copy link

Goof container runs and exits with code 1 after a couple of minutes.

docker-compose up --build initially runs all three containers: goof, mongo & mysql but goof exits after a few minutes of running.

goof        | 
goof        | /usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/server.js:235
goof        |         process.nextTick(function() { throw err; })
goof        |                                       ^
goof        | Error: connect ETIMEDOUT 172.24.0.3:27017
goof        |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
goof        | Emitted 'error' event on NativeConnection instance at:
goof        |     at Connection.error (/usr/src/goof/node_modules/mongoose/lib/connection.js:425:8)
goof        |     at /usr/src/goof/node_modules/mongoose/lib/connection.js:452:14
goof        |     at /usr/src/goof/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:52:21
goof        |     at /usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/db.js:226:14
goof        |     at Server.<anonymous> (/usr/src/goof/node_modules/mongoose/node_modules/mongodb/lib/server.js:233:9)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Server.emit (node:events:513:28)
goof        |     at Pool.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/topologies/server.js:263:68)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Pool.emit (node:events:513:28)
goof        |     at Connection.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/connection/pool.js:77:12)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Connection.emit (node:events:513:28)
goof        |     at Socket.<anonymous> (/usr/src/goof/node_modules/mongodb-core/lib/connection/connection.js:121:49)
goof        |     at Object.onceWrapper (node:events:628:26)
goof        |     at Socket.emit (node:events:513:28)
goof        |     at emitErrorNT (node:internal/streams/destroy:151:8)
goof        |     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
goof        |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
goof        |   name: 'MongoError'
goof        | }
goof        | 
goof        | Node.js v18.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@noraj @owen-eternal @santhosmails and others