1

I am working on a project that requires me to use the gcloud nodejs module. I am testing this project locally using node app and locally on gcloud using gcloud preview app run app.yaml . When I have the following code in my file the project runs with node app but doesn't run with gcloud using gcloud preview app run app.yaml - I get the an invalid ELF Header error .

var gcloud = require('gcloud');

I believe the project doesn't run with the gcloud command because it has something to do with me using the gcloud module in my project. If I remove that code from my file, the project runs just fine with the gcloud command. What should I do to fix this?

I was able to get the error by using a try-catch

try {
   var gcloud = require('gcloud');

}  catch (e) {
   e = 'Error loading required classes for gcloud: '+gcloud+ ':  '+e
   console.log(e)
   res.status(200).send(e);
}

The Error:

Error loading required classes for gcloud: undefined: Error:
/app/node_modules/gcloud/node_modules/hash-stream-
validation/node_modules/sse4_crc32/build/Release/sse4_crc32.node: invalid ELF header
DynamoBooster
  • 175
  • 12
  • Could you elaborate in what way it is failing? It sounds like the deployment succeeds but the app itself returns 500s... if so please include the app engine log entries from the developers console for the failing HTTP requests. – David Sep 22 '15 at 17:37
  • I am emulating it locally right now with the 'run' (gcloud preview app run app.yaml) command, I am not deploying it because if it doesn't run using the 'run' command locally it won't work online. If I go to localhost:8080 when I have the gcloud code uncommented it won't load anything and just gives me timeout error but if I uncomment the gcloud code then I works perfectly fine. – DynamoBooster Sep 24 '15 at 09:13
  • Even if I just have var gcloud = require('gcloud') it doesn't work – DynamoBooster Sep 24 '15 at 09:33
  • The error looks like http://stackoverflow.com/q/32679728/3645370. Can you try following the answer there? – David Sep 24 '15 at 20:54
  • That question doesn't really have an answer - he said he moved out of the eclipse IDE and it worked. I am not using an IDE - I am using Sublime Text. I actually commented on that question earlier in an attempt to reach out to the guy and get more insight on how he solved the problem but haven't heard back yet. – DynamoBooster Sep 24 '15 at 21:28

1 Answers1

2

I was able to fix this problem by removing the node_modules directory and then deploying the project. The problem had to do with an OS X compiled library not working on a Linux machine. Therefore it need a fresh install on the Linux machine - removing the node_modules directly forces it to fresh install on the linux machine.

DynamoBooster
  • 175
  • 12