Repository navigation
Exception throw by sse4_crc32 #781
Description
Activity
What version of Node are you running? Have you changed recently? Try doing an 'npm rebuild'.
I am using
gcloud preview app run app.yamlto test locally. So npm rebuild won't answer any questions since the docker container pulls the node modules each time its run.$ node --version v0.12.4@anandsuresh sorry to bug you again :) Any thoughts on what may have gone wrong here?
@stephenplusplus No worries. ;)
@abelino I had released v3.3.0 a couple of days ago and had upgraded to NAN v2, which as it turns out has issues on certain versions of node. I then released v3.4.0 which reverts the changes back to NAN v1.7.0. Please try again with version v3.4.0.
Also please try running
make clean && make && npm run-script debugand paste the output here, if there is an issue.@anandsuresh sorry for barely looking at this. Let me test and will let you know.
$ make clean ./node_modules/.bin/node-gyp clean make: ./node_modules/.bin/node-gyp: No such file or directory make: [clean] Error 1 (ignored) $ make ./node_modules/.bin/node-gyp clean make: ./node_modules/.bin/node-gyp: No such file or directory make: [clean] Error 1 (ignored) npm install . npm WARN prefer global [email protected] should be installed with -g > [email protected] install /node_modules/sse4_crc32 > node-gyp rebuild CXX(target) Release/obj.target/sse4_crc32/src/sse4_crc32.o SOLINK_MODULE(target) Release/sse4_crc32.node [email protected] node_modules/crc32 [email protected] node_modules/chai ├── [email protected] └── [email protected] ([email protected]) [email protected] node_modules/mocha ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected]) [email protected] node_modules/node-gyp ├── [email protected] ├── [email protected] ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ./node_modules/.bin/node-gyp configure gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | x64 gyp info spawn python gyp info spawn args [ '/node_modules/sse4_crc32/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/node_modules/sse4_crc32/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/node_modules/sse4_crc32/common.gypi', gyp info spawn args '-I', gyp info spawn args '/node_modules/sse4_crc32/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/.node-gyp/0.12.4/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/.node-gyp/0.12.4', gyp info spawn args '-Dnode_gyp_dir=/node_modules/sse4_crc32/node_modules/node-gyp', gyp info spawn args '-Dmodule_root_dir=/node_modules/sse4_crc32', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info ok ./node_modules/.bin/node-gyp build gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | x64 gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make[1]: Nothing to be done for `all'. gyp info ok ./node_modules/.bin/mocha test/*.test.js Sse4Crc32 .calculate ✓ should handle input of type string ✓ should handle input of type buffer CRC32 ✓ should be callable ✓ should not throw an error upon instantiation ✓ should default the initial CRC to 0 ✓ should accept an initial CRC value ✓ should immediately calculate the value of the passed input ✓ should progressively calculate CRC for additional input 8 passing (14ms) $ npm run-script debug > [email protected] debug /node_modules/sse4_crc32 > echo "platform: $(uname -a)"; echo "node.js: $(node -v)"; echo "npm: $(npm -v)"; echo "node-gyp: $(./node_modules/.bin/node-gyp -v)"; node -e "console.log('H/w CRC Support: ' + require('./sse4_crc32').isHardwareCrcSupported());"; node -pe "require('./sse4_crc32');" platform: Darwin user.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64 node.js: v0.12.4 npm: 2.13.2 node-gyp: v2.0.2 H/w CRC Support: true { isHardwareCrcSupported: [Function: isHardwareCrcSupported], calculateInSoftware: [Function: swCrc32c], calculateOnHardware: [Function: hwCrc32c], CRC32: [Function: Crc32C], calculate: [Function: hwCrc32c] }
So locally everything works. I was having the issue when running the under the docker container
FROM google/nodejs-runtimeI'm going to assume the node version in that docker container is not compatible. I'm going to retest soon, and see if the docker container has been updated.ok so locally with
node v0.12.4...sse4_crc32does not throw an exception. However, the google docker container usesnode-v0.10.40-linux-x64. So tomorrow, when I get a chance I am going to create my own docker formula and see what is going on. I'll have more info tomorrow. Thanks guys.- @ajessup -- any idea who is responsible for the node js image ?
Also /cc @JustinBeckwith
ok so I came to a starbucks because my data service was extremely slow and couldn't get past a docker udp timeout issue. I made a custom Dockerfile just to debug this further. I updated
nodetov0.12.7and leftnpmalone. Same issue:> [email protected] prestart /app > npm install > [email protected] start /app > node app.js debug:is dev yes /app/node_modules/gcloud/node_modules/sse4_crc32/node_modules/bindings/bindings.js:83 throw e ^ Error: /app/node_modules/gcloud/node_modules/sse4_crc32/build/Release/sse4_crc32.node: invalid ELF header at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at bindings (/app/node_modules/gcloud/node_modules/sse4_crc32/node_modules/bindings/bindings.js:76:44) at Object.<anonymous> (/app/node_modules/gcloud/node_modules/sse4_crc32/sse4_crc32.js:8:36) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) npm ERR! Linux 4.0.5-boot2docker npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: `node app.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'node app.js'. npm ERR! This is most likely a problem with the nocaptcha package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node app.js npm ERR! You can get their info via: npm ERR! npm owner ls nocaptcha npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /app/npm-debug.log
The Docckerfile contents:
FROM google/debian:wheezy RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates RUN mkdir /nodejs && curl https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1 ENV PATH $PATH:/nodejs/bin WORKDIR /app ADD . /app RUN npm install EXPOSE 8080 CMD [] ENTRYPOINT ["/nodejs/bin/npm", "start"]
Here is an interesting log directly from the docker container
INFO 2015-08-13 19:19:36,564 containers.py:282] Step 8 : RUN cd node_modules/gcloud/node_modules/sse4_crc32/ && make clean && make && npm run-script debug INFO 2015-08-13 19:19:36,664 containers.py:282] ---> Running in d17811214e3f INFO 2015-08-13 19:19:37,193 containers.py:282] ./node_modules/.bin/node-gyp clean INFO 2015-08-13 19:19:37,194 containers.py:282] make: ./node_modules/.bin/node-gyp: Command not found INFO 2015-08-13 19:19:37,194 containers.py:282] make: [clean] Error 127 (ignored) INFO 2015-08-13 19:19:37,196 containers.py:282] ./node_modules/.bin/node-gyp clean INFO 2015-08-13 19:19:37,196 containers.py:282] make: ./node_modules/.bin/node-gyp: Command not found INFO 2015-08-13 19:19:37,197 containers.py:282] make: [clean] Error 127 (ignored) INFO 2015-08-13 19:19:37,197 containers.py:282] npm install . WARNING 2015-08-13 19:19:42,541 module.py:1935] All instances may not have restarted INFO 2015-08-13 19:19:48,156 containers.py:282] npm INFO 2015-08-13 19:19:48,157 containers.py:282] INFO 2015-08-13 19:19:48,158 containers.py:282] WARN INFO 2015-08-13 19:19:48,158 containers.py:282] prefer global [email protected] should be installed with -g INFO 2015-08-13 19:19:48,174 containers.py:282] npm WARN INFO 2015-08-13 19:19:48,174 containers.py:282] cannot run in wd [email protected] node-gyp rebuild (wd=/app/node_modules/gcloud/node_modules/sse4_crc32) INFO 2015-08-13 19:19:48,543 containers.py:282] [email protected] node_modules/crc32 [email protected] node_modules/chai ├── [email protected] └── [email protected] ([email protected]) [email protected] node_modules/mocha ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected]) [email protected] node_modules/node-gyp ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) INFO 2015-08-13 19:19:48,587 containers.py:282] ./node_modules/.bin/node-gyp configure INFO 2015-08-13 19:19:48,784 containers.py:282] gyp INFO 2015-08-13 19:19:48,785 containers.py:282] INFO 2015-08-13 19:19:48,786 containers.py:282] info INFO 2015-08-13 19:19:48,786 containers.py:282] it worked if it ends with INFO 2015-08-13 19:19:48,787 containers.py:282] ok INFO 2015-08-13 19:19:48,793 containers.py:282] gyp info using [email protected] gyp info using [email protected] | linux | x64 INFO 2015-08-13 19:19:49,197 containers.py:282] gyp INFO 2015-08-13 19:19:49,198 containers.py:282] http INFO 2015-08-13 19:19:49,198 containers.py:282] INFO 2015-08-13 19:19:49,198 containers.py:282] GET https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz INFO 2015-08-13 19:19:51,746 containers.py:282] gyp http 200 INFO 2015-08-13 19:19:51,748 containers.py:282] https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz INFO 2015-08-13 19:22:37,191 containers.py:282] gyp INFO 2015-08-13 19:22:37,191 containers.py:282] INFO 2015-08-13 19:22:37,192 containers.py:282] http INFO 2015-08-13 19:22:37,192 containers.py:282] GET https://nodejs.org/dist/v0.12.7/SHASUMS256.txt INFO 2015-08-13 19:22:37,899 containers.py:282] gyp INFO 2015-08-13 19:22:37,900 containers.py:282] http 200 https://nodejs.org/dist/v0.12.7/SHASUMS256.txt INFO 2015-08-13 19:22:37,917 containers.py:282] gyp info INFO 2015-08-13 19:22:37,917 containers.py:282] spawn python2 INFO 2015-08-13 19:22:37,918 containers.py:282] gyp INFO 2015-08-13 19:22:37,918 containers.py:282] info spawn args [ '/app/node_modules/gcloud/node_modules/sse4_crc32/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', INFO 2015-08-13 19:22:37,919 containers.py:282] gyp info INFO 2015-08-13 19:22:37,919 containers.py:282] spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/app/node_modules/gcloud/node_modules/sse4_crc32/build/config.gypi', gyp INFO 2015-08-13 19:22:37,919 containers.py:282] info spawn args '-I', gyp info INFO 2015-08-13 19:22:37,919 containers.py:282] spawn args '/app/node_modules/gcloud/node_modules/sse4_crc32/common.gypi', gyp info spawn args '-I', gyp info spawn args '/app/node_modules/gcloud/node_modules/sse4_crc32/node_modules/node-gyp/addon.gypi', INFO 2015-08-13 19:22:37,920 containers.py:282] gyp info spawn args INFO 2015-08-13 19:22:37,920 containers.py:282] '-I', gyp info spawn args '/root/.node-gyp/0.12.7/common.gypi', INFO 2015-08-13 19:22:37,920 containers.py:282] gyp INFO 2015-08-13 19:22:37,921 containers.py:282] info spawn args '-Dlibrary=shared_library', gyp INFO 2015-08-13 19:22:37,921 containers.py:282] info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/root/.node-gyp/0.12.7', gyp info spawn args '-Dnode_gyp_dir=/app/node_modules/gcloud/node_modules/sse4_crc32/node_modules/node-gyp', gyp info spawn args '-Dmodule_root_dir=/app/node_modules/gcloud/node_modules/sse4_crc32', gyp info spawn args '--depth=.', gyp info INFO 2015-08-13 19:22:37,921 containers.py:282] spawn args INFO 2015-08-13 19:22:37,922 containers.py:282] '--no-parallel', INFO 2015-08-13 19:22:37,922 containers.py:282] gyp info INFO 2015-08-13 19:22:37,923 containers.py:282] INFO 2015-08-13 19:22:37,923 containers.py:282] spawn args '--generator-output', INFO 2015-08-13 19:22:37,924 containers.py:282] gyp info spawn args INFO 2015-08-13 19:22:37,924 containers.py:282] 'build', gyp info INFO 2015-08-13 19:22:37,924 containers.py:282] spawn args '-Goutput_dir=.' ] INFO 2015-08-13 19:22:38,174 containers.py:282] gyp INFO 2015-08-13 19:22:38,174 containers.py:282] info ok INFO 2015-08-13 19:22:38,178 containers.py:282] ./node_modules/.bin/node-gyp build INFO 2015-08-13 19:22:38,311 containers.py:282] gyp INFO 2015-08-13 19:22:38,311 containers.py:282] INFO 2015-08-13 19:22:38,312 containers.py:282] info it worked if it ends with INFO 2015-08-13 19:22:38,312 containers.py:282] ok INFO 2015-08-13 19:22:38,312 containers.py:282] gyp info INFO 2015-08-13 19:22:38,321 containers.py:282] using [email protected] INFO 2015-08-13 19:22:38,321 containers.py:282] gyp info INFO 2015-08-13 19:22:38,322 containers.py:282] using [email protected] | linux | x64 INFO 2015-08-13 19:22:38,351 containers.py:282] gyp INFO 2015-08-13 19:22:38,351 containers.py:282] info spawn make INFO 2015-08-13 19:22:38,352 containers.py:282] gyp INFO 2015-08-13 19:22:38,352 containers.py:282] info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] INFO 2015-08-13 19:22:38,354 containers.py:282] make[1]: Entering directory `/app/node_modules/gcloud/node_modules/sse4_crc32/build' INFO 2015-08-13 19:22:38,359 containers.py:282] CXX(target) Release/obj.target/sse4_crc32/src/sse4_crc32.o INFO 2015-08-13 19:22:39,299 containers.py:282] SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node INFO 2015-08-13 19:22:39,361 containers.py:282] COPY Release/sse4_crc32.node INFO 2015-08-13 19:22:39,371 containers.py:282] make[1]: Leaving directory `/app/node_modules/gcloud/node_modules/sse4_crc32/build' INFO 2015-08-13 19:22:39,372 containers.py:282] gyp INFO 2015-08-13 19:22:39,372 containers.py:282] info ok INFO 2015-08-13 19:22:39,372 containers.py:282] INFO 2015-08-13 19:22:39,375 containers.py:282] ./node_modules/.bin/mocha test/*.test.js INFO 2015-08-13 19:22:39,635 containers.py:282] INFO 2015-08-13 19:22:39,637 containers.py:282] INFO 2015-08-13 19:22:39,642 containers.py:282] Sse4Crc32 INFO 2015-08-13 19:22:39,642 containers.py:282] .calculate INFO 2015-08-13 19:22:39,646 containers.py:282] INFO 2015-08-13 19:22:39,646 containers.py:282] ✓ should handle input of type string INFO 2015-08-13 19:22:39,649 containers.py:282] INFO 2015-08-13 19:22:39,649 containers.py:282] ✓ should handle input of type buffer INFO 2015-08-13 19:22:39,650 containers.py:282] CRC32 INFO 2015-08-13 19:22:39,652 containers.py:282] INFO 2015-08-13 19:22:39,652 containers.py:282] ✓ should be callable INFO 2015-08-13 19:22:39,652 containers.py:282] ✓ should not throw an error upon instantiation INFO 2015-08-13 19:22:39,653 containers.py:282] INFO 2015-08-13 19:22:39,653 containers.py:282] ✓ should default the initial CRC to 0 ✓ should accept an initial CRC value INFO 2015-08-13 19:22:39,654 containers.py:282] ✓ should immediately calculate the value of the passed input INFO 2015-08-13 19:22:39,657 containers.py:282] ✓ should progressively calculate CRC for additional input 8 passing (25ms) INFO 2015-08-13 19:22:40,099 containers.py:282] > [email protected] debug /app/node_modules/gcloud/node_modules/sse4_crc32 > echo "platform: $(uname -a)"; echo "node.js: $(node -v)"; echo "npm: $(npm -v)"; echo "node-gyp: $(./node_modules/.bin/node-gyp -v)"; node -e "console.log('H/w CRC Support: ' + require('./sse4_crc32').isHardwareCrcSupported());"; node -pe "require('./sse4_crc32');" INFO 2015-08-13 19:22:40,113 containers.py:282] platform: Linux ece227541990 4.0.5-boot2docker #1 SMP Tue Jun 16 01:39:56 UTC 2015 x86_64 GNU/Linux INFO 2015-08-13 19:22:40,116 containers.py:282] node.js: v0.12.7 INFO 2015-08-13 19:22:40,341 containers.py:282] npm: 2.11.3 INFO 2015-08-13 19:22:40,471 containers.py:282] node-gyp: v2.0.2 INFO 2015-08-13 19:22:40,546 containers.py:282] H/w CRC Support: false INFO 2015-08-13 19:22:40,627 containers.py:282] { isHardwareCrcSupported: [Function: isHardwareCrcSupported], calculateInSoftware: [Function: swCrc32c], calculateOnHardware: [Function: hwCrc32c], CRC32: [Function: Crc32C], calculate: [Function: swCrc32c] } INFO 2015-08-13 19:22:41,489 containers.py:282] ---> 70cbf301fae1 INFO 2015-08-13 19:22:41,625 containers.py:282] Removing intermediate container d17811214e3f INFO 2015-08-13 19:22:41,625 containers.py:282] Successfully built 70cbf301fae1
For the above dockerfile I modified it to run the test instead of running the server
FROM google/debian:wheezy RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates RUN mkdir /nodejs && curl https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1 ENV PATH $PATH:/nodejs/bin # RUN npm install npm -g WORKDIR /app ADD . /app RUN npm install RUN cd node_modules/gcloud/node_modules/sse4_crc32/ && make clean && make && npm run-script debug # EXPOSE 8080 # CMD [] # ENTRYPOINT ["/nodejs/bin/npm", "start"]
ok so I managed to get the server running.
if I run in the dockerfile
RUN cd node_modules/gcloud/node_modules/sse4_crc32/ && make clean && make && npm run-script debugbefore the
ENTRYPOINTthen the module runs properly when required in myapp.jsor wherever it is I am require-ing it. But if I comment that line out in the Dockerfile then the exception as mention in 781#issuecomment-130781411working Dockerfile:
FROM google/debian:wheezy RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl python build-essential git ca-certificates RUN mkdir /nodejs && curl https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1 ENV PATH $PATH:/nodejs/bin WORKDIR /app ADD . /app RUN npm install RUN cd node_modules/gcloud/node_modules/sse4_crc32/ && make clean && make && npm run-script debug EXPOSE 8080 CMD [] ENTRYPOINT ["/nodejs/bin/npm", "start"]
@anandsuresh wooops I forgot to check the current version of gcloud I was using. At the time of opening this issue the problem existed but as you said you later published 3.4.0, which fixes the prob. Since this isn't an issue with the latest version of [email protected] I am going to close this issue. THANKS for the help everyone, its been interesting.
14 remaining items
- added 7 commits that reference this issue
on Jan 28, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026
This module worked on my system before. Going to tweak version and see where the problems comes from.