引用Bcrypt的OpenShift错误

时间:2016-11-20 23:26:57

标签: node.js openshift bcrypt

我在OpenShift上使用了近两个月的应用程序,突然之间我收到了引用Bcrypt的错误。直到上周,一切都很好。我已经用尽了我的搜索,在等待故障响应时,想看看是否有其他人对此有任何问题。

这是我正在使用的依赖

“bcryptjs”:“~2.3.0”,

Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 942 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Stopping NodeJS cartridge
remote: Stopping PHPMyAdmin cartridge
remote: Repairing links for 1 deployments
remote: Saving away previously installed Node modules
remote: Building git ref 'master', commit 0470fcd
remote: Building NodeJS cartridge
remote: npm info it worked if it ends with ok
remote: npm info using npm@2.14.13
remote: npm info using node@v0.10.35
remote: npm info preinstall givingtrac@1.0.0
remote: npm info package.json fs@0.0.2 fs is also the name of a node core module.
remote: npm info package.json fs@0.0.2 No description
remote: npm info package.json fs@0.0.2 No repository field.
remote: npm info package.json fs@0.0.2 No README data
remote: npm info package.json bcrypt-nodejs@0.0.3 No license field.
remote: npm info package.json sendgrid@1.6.0 No license field.
remote: npm info build /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo
remote: npm info linkStuff givingtrac@1.0.0
remote: npm info build /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt
remote: npm info preinstall bcrypt@0.8.7
remote: npm info linkStuff bcrypt@0.8.7
remote: npm info install bcrypt@0.8.7
remote: 
remote: > bcrypt@0.8.7 install /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt
remote: > node-gyp rebuild
remote: 
remote: gyp info it worked if it ends with ok
remote: gyp info using node-gyp@3.2.0
remote: gyp info using node@0.10.35 | linux | x64
remote: gyp info spawn /usr/bin/python2
remote: gyp info spawn args [ '/opt/rh/v8314/root/usr/bin/gyp',
remote: gyp info spawn args   'binding.gyp',
remote: gyp info spawn args   '-f',
remote: gyp info spawn args   'make',
remote: gyp info spawn args   '-I',
remote: gyp info spawn args   '/var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt/build/config.gypi',
remote: gyp info spawn args   '-I',
remote: gyp info spawn args   '/opt/rh/nodejs010/root/usr/lib/node_modules/node-gyp/addon-rpm.gypi',
remote: gyp info spawn args   '-I',
remote: gyp info spawn args   '/opt/rh/nodejs010/root/usr/include/node/common.gypi',
remote: gyp info spawn args   '-Dlibrary=shared_library',
remote: gyp info spawn args   '-Dvisibility=default',
remote: gyp info spawn args   '-Dnode_root_dir=/opt/rh/nodejs010/root/usr/share/node',
remote: gyp info spawn args   '-Dnode_gyp_dir=/opt/rh/nodejs010/root/usr/lib/node_modules/node-gyp',
remote: gyp info spawn args   '-Dnode_lib_file=node.lib',
remote: gyp info spawn args   '-Dmodule_root_dir=/var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt',
remote: gyp info spawn args   '--depth=.',
remote: gyp info spawn args   '--generator-output',
remote: gyp info spawn args   'build',
remote: gyp info spawn args   '-Goutput_dir=.' ]
remote: gyp info spawn make
remote: gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
remote: make: Entering directory `/var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt/build'
remote: make: Warning: File `../binding.gyp' has modification time 2e+02 s in the future
remote:   ACTION Regenerating Makefile
remote: gyp: binding.gyp not found (cwd: /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt/build) while trying to load binding.gyp
remote: make: *** [Makefile] Error 1
remote: make: Leaving directory `/var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt/build'
remote: gyp ERR! build error 
remote: gyp ERR! stack Error: `make` failed with exit code: 2
remote: gyp ERR! stack     at ChildProcess.onExit (/opt/rh/nodejs010/root/usr/lib/node_modules/node-gyp/lib/build.js:276:23)
remote: gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
remote: gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
remote: gyp ERR! System Linux 2.6.32-642.6.2.el6.x86_64
remote: gyp ERR! command "node" "/opt/rh/nodejs010/root/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
remote: gyp ERR! cwd /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/node_modules/bcrypt
remote: gyp ERR! node -v v0.10.35
remote: gyp ERR! node-gyp -v v3.2.0
remote: gyp ERR! not ok 
remote: 
remote: npm info bcrypt@0.8.7 Failed to exec install script
remote: npm ERR! Linux 2.6.32-642.6.2.el6.x86_64
remote: npm ERR! argv "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "-d
remote: npm ERR! node v0.10.35
remote: npm ERR! npm  v2.14.13
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'.
remote: npm ERR! This is most likely a problem with the bcrypt package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR!     node-gyp rebuild
remote: npm ERR! You can get their info via:
remote: npm ERR!     npm owner ls bcrypt
remote: npm ERR! There is likely additional logging output above.
remote: 
remote: npm ERR! Please include the following file with any support request:
remote: npm ERR!     /var/lib/openshift/57e0858289f5cf73ea0000bd/app-root/runtime/repo/npm-debug.log
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/57e0858289f5cf73ea0000bd/nodejs
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.

我不确定为什么突然间我收到这个错误。

1 个答案:

答案 0 :(得分:0)

你的错误的本质是这= = /binding.gyp' has modification time 2e+02 s in the future

这是因为您的Openshift容器过去曾以某种方式阻止其系统时钟。

轻松修复
简单的方法是将bindings.gyp文件的修改时间戳修改为容器的修改时间戳。所以在你的Dockerfile中,运行以下

RUN echo 'Getting current timestamp'
RUN date
RUN echo 'Getting timestamp of binding.gyp'
RUN stat -c %y binding.gyp
RUN touch -m binding.gyp
RUN npm install

长期修复
更好的解决方案是调查容器时钟偏差的原因。 Mac客户端的Docker存在一个已知问题,即只要你让Mac进入睡眠状态,容器就会让时钟发生偏差= https://forums.docker.com/t/syncing-clock-with-host/10432/22