zodern / meteor-up

Production Quality Meteor Deployment to Anywhere
http://meteor-up.com/
MIT License
1.27k stars 281 forks source link

write EPIPE error when running docker login with --password-stdin #1242

Closed Floriferous closed 2 years ago

Floriferous commented 3 years ago

On Mup 1.5.3, when deployment reaches docker login, it calls runCommand with the password piped through stdin.

Locally this doesn't cause any issues, but in CircleCI, it throws a write EPIPE error:

=> Updating base image
Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writeGeneric (internal/stream_base_commons.js:147:3)
    at Socket._writeGeneric (net.js:787:11)
    at Socket._write (net.js:799:8)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Socket.Writable.write (_stream_writable.js:318:11)
    at /home/circleci/app/node_modules/mup/lib/plugins/meteor/utils.js:184:28
    at new Promise (<anonymous>)
    at runCommand (/home/circleci/app/node_modules/mup/lib/plugins/meteor/utils.js:164:10)
    at prepareBundleLocally (/home/circleci/app/node_modules/mup/lib/plugins/meteor/prepare-bundle.js:79:31)
    at async PluginAPI.runCommand (/home/circleci/app/node_modules/mup/lib/plugin-api.js:135:9)
    at async PluginAPI.runCommand (/home/circleci/app/node_modules/mup/lib/plugin-api.js:135:9)
    at async PluginAPI._runHooks (/home/circleci/app/node_modules/mup/lib/plugin-api.js:78:13)
    at async PluginAPI._runPostHooks (/home/circleci/app/node_modules/mup/lib/plugin-api.js:113:9)
    at async PluginAPI.runCommand (/home/circleci/app/node_modules/mup/lib/plugin-api.js:140:7)

Not sure what can trigger this issue?

zodern commented 2 years ago

There is a race condition in node when trying to use stdin for a child process. I've fixed this in version 1.5.5 by switching back to passing the password as an argument. Docker will show a warning that it isn't secure, but in this situation it shouldn't be any less secure than what mup was doing.