You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re #1287 , seems like there are cases where gRPC won't be able to be initialized. I understand if a service that requires gRPC (ie, Bigtable) failed in these cases, but if an unrelated module fails because of the unused gRPC import, that makes me sad....
Can we try to fail gracefully if gRPC isn't installed in the environment for whatever reason?
Yeah, you would think the gRPC installation would have errored if the system couldn't handle it. @pputhran -- when you were running the code from #1287, did you let the server run npm install for itself, or did you push the exact files from your local node_modules directory?
@stephenplusplus, in aws lambda, we need to package and push the node_modules from local. It does not have a way to run npm install. I was able to work around the problem by using the gcloud module which was install on linux box.
Ah, okay. Does that "Native Modules" section in this guide explain something similar to what you had to do?
@jgeewax Code that was compiled for one environment was copied to another that didn't match. Under a normal installation -> run cycle, if a dependency cannot be installed, npm install would fail, so it wouldn't be expected for our library to operate correctly. I don't believe we should try/catch our own dependencies, because that's what npm install is supposed to handle for us.
OK, I hear where you're coming from @stephenplusplus , however the end goal is "gcloud-node should work inside AWS lambda"... Can we figure out how to do that ?
Yeah, I think @pputhran can fill us in on that experience. That guide I linked above is from AWS specifically for using Node modules that have native dependencies, like ours. We of course aren't the only such dependency a user might have, so the solution should likely come from the AWS side on how it can be made as easy as possible.
I'm developing on a mac. What I did was compile 2 versions of the module, 1 locally on my mac and 1 on an ec2 instance which I copied down locally. I put these two in a separate folder (/bin). I then set up hook scripts to copy the version needed for the environment i'm running on to the node_modules folder. I haven't tested the lambda-packager yet, but this would save me from manually compiling it on an ec2 instance if it works.
I have encountered the same issue. Can someone help me resolve this issue?
Since there hasn't been any recent posts on this issue, I assume there is a way to resolve this. I tried lambda-packager and it seems like the repository is deprecated.
Hi @JustinBeckwith, I am using the module @google-cloud/automl. It is working perfectly fine in the local environment but when pushed to lambda, it fails giving the following error:
Unable to import module 'handlers/classification': Error
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/task/node_modules/google-gax/build/src/grpc.js:87:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Activity
stephenplusplus commentedon May 9, 2016
Yeah, you would think the gRPC installation would have errored if the system couldn't handle it. @pputhran -- when you were running the code from #1287, did you let the server run
npm installfor itself, or did you push the exact files from your localnode_modulesdirectory?pputhran commentedon May 10, 2016
@stephenplusplus, in aws lambda, we need to package and push the node_modules from local. It does not have a way to run npm install. I was able to work around the problem by using the gcloud module which was install on linux box.
stephenplusplus commentedon May 10, 2016
Ah, okay. Does that "Native Modules" section in this guide explain something similar to what you had to do?
@jgeewax Code that was compiled for one environment was copied to another that didn't match. Under a normal installation -> run cycle, if a dependency cannot be installed,
npm installwould fail, so it wouldn't be expected for our library to operate correctly. I don't believe we shouldtry/catchour own dependencies, because that's whatnpm installis supposed to handle for us.jgeewax commentedon May 10, 2016
OK, I hear where you're coming from @stephenplusplus , however the end goal is "gcloud-node should work inside AWS lambda"... Can we figure out how to do that ?
stephenplusplus commentedon May 10, 2016
Yeah, I think @pputhran can fill us in on that experience. That guide I linked above is from AWS specifically for using Node modules that have native dependencies, like ours. We of course aren't the only such dependency a user might have, so the solution should likely come from the AWS side on how it can be made as easy as possible.
ajagnanan commentedon May 14, 2016
Im running into this issue too, is there a way to build an aws lambda friendly gcloud-node module?
stephenplusplus commentedon May 16, 2016
@pputhran @ajagnanan can you guys try out https://github.com/tomdale/lambda-packager? Looks like it might be just what we need.
pputhran commentedon May 16, 2016
@stephenplusplus thank you. this looks like what we need. will try this and let you know
stephenplusplus commentedon May 17, 2016
Great, if it works for you and @ajagnanan, we'll add it to our Troubleshooting guide.
ajagnanan commentedon May 17, 2016
I'm developing on a mac. What I did was compile 2 versions of the module, 1 locally on my mac and 1 on an ec2 instance which I copied down locally. I put these two in a separate folder (/bin). I then set up hook scripts to copy the version needed for the environment i'm running on to the node_modules folder. I haven't tested the lambda-packager yet, but this would save me from manually compiling it on an ec2 instance if it works.
For reference, I'm using https://github.com/serverless/serverless with plugin https://github.com/kennu/serverless-plugin-hookscripts.
stephenplusplus commentedon May 23, 2016
Thanks for the breakdown @ajagnanan. Have you tried lambda-packager yet?
stephenplusplus commentedon Jun 1, 2016
@pputhran if you've tried it yet, how did it go?
anil100nair commentedon Sep 9, 2018
I have encountered the same issue. Can someone help me resolve this issue?
Since there hasn't been any recent posts on this issue, I assume there is a way to resolve this. I tried lambda-packager and it seems like the repository is deprecated.
JustinBeckwith commentedon Sep 9, 2018
👋 Which specific module are you trying to use?
anil100nair commentedon Sep 10, 2018
Hi @JustinBeckwith, I am using the module
@google-cloud/automl. It is working perfectly fine in the local environment but when pushed to lambda, it fails giving the following error:JustinBeckwith commentedon Sep 10, 2018
@anil100nair thanks for the details! Would you mind opening a new issue on this repository? Thank you :)
https://github.com/googleapis/nodejs-automl
anil100nair commentedon Sep 11, 2018
Thanks you for your time. I'll open an issue.
chore(deps): update dependency @types/node to v20 (#1297)
feat: add option for returning Spanner commit stats (#1297)
chore(main): release 10.0.4 (#1297)