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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker container crashes #1199

Merged
merged 1 commit into from Aug 26, 2019
Merged

Fix docker container crashes #1199

merged 1 commit into from Aug 26, 2019

Conversation

J12934
Copy link
Member

@J12934 J12934 commented Aug 26, 2019

Just noticed that ever since my docker image size improvements the docker containers crash on anything other than OpenShift. I've never seen an image that runs on OpenShift but not on normal Docker, always the reverse 馃槼

shame

This should fix that. Was basically missing the logs ownership as the folder gets created after the copy & own operation.

@J12934
Copy link
Member Author

J12934 commented Aug 26, 2019

Container are failing with the following error btw:

> juice-shop@9.0.0 start /juice-shop
> node app

info: All dependencies in ./package.json are satisfied (OK)
info: Detected Node.js version v12.9.0 (OK)
info: Detected OS linux (OK)
info: Detected CPU x64 (OK)
info: Required file index.html is present (OK)
info: Required file styles.css is present (OK)
info: Required file main-es2015.js is present (OK)
info: Required file polyfills-es2015.js is present (OK)
info: Required file runtime-es2015.js is present (OK)
info: Required file vendor-es2015.js is present (OK)
info: Required file main-es5.js is present (OK)
info: Required file polyfills-es5.js is present (OK)
info: Required file runtime-es5.js is present (OK)
info: Required file vendor-es5.js is present (OK)
info: Configuration juicy-ctf validated (OK)
2019-08-26T17:19:14.674Z [FileStreamRotator] Failed to store log audit at: ./logs/.audit.json Error: Error: EACCES: permission denied, open './logs/.audit.json'
    at Object.openSync (fs.js:448:3)
    at Object.writeFileSync (fs.js:1248:35)
    at Object.FileStreamRotator.writeAuditLog (/juice-shop/node_modules/file-stream-rotator/FileStreamRotator.js:246:12)
    at Object.FileStreamRotator.addLogToAudit (/juice-shop/node_modules/file-stream-rotator/FileStreamRotator.js:320:27)
    at EventEmitter.<anonymous> (/juice-shop/node_modules/file-stream-rotator/FileStreamRotator.js:437:36)
    at EventEmitter.emit (events.js:209:13)
    at /juice-shop/node_modules/file-stream-rotator/FileStreamRotator.js:483:20
    at processTicksAndRejections (internal/process/task_queues.js:75:11) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: './logs/.audit.json'
}
events.js:186
      throw er; // Unhandled 'error' event
      ^

Error: EACCES: permission denied, open './logs/access.log.2019-08-26'
Emitted 'error' event at:
    at WriteStream.<anonymous> (/juice-shop/node_modules/file-stream-rotator/FileStreamRotator.js:538:15)
    at WriteStream.emit (events.js:209:13)
    at internal/fs/streams.js:285:12
    at FSReqCallback.oncomplete (fs.js:154:23) {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: './logs/access.log.2019-08-26'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! juice-shop@9.0.0 start: `node app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the juice-shop@9.0.0 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!     /home/juicer/.npm/_logs/2019-08-26T17_19_14_863Z-debug.log

@J12934 J12934 changed the base branch from master to develop August 26, 2019 18:00
@bkimminich
Copy link
Member

Weird, I tested on Docker Win-native and never had this problem...

@J12934
Copy link
Member Author

J12934 commented Aug 26, 2019

Weird, I tested on Docker Win-native and never had this problem...

I think docker on win doesn't respect linux file owner ships.
At least there always comes a weird warning message when you build images.

@andifalk
Copy link

Weird, I tested on Docker Win-native and never had this problem...

I think docker on win doesn't respect linux file owner ships.
At least there always comes a weird warning message when you build images.

Can confirm this crash, happened to me as well on my linux machine (Linux Mint 19.2).
Great that a PR is already on its way :-)

@bkimminich bkimminich changed the base branch from develop to master August 26, 2019 20:10
@bkimminich bkimminich merged commit 00d3670 into master Aug 26, 2019
@J12934 J12934 deleted the docker-crash-fix branch September 13, 2019 08:05
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants