Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Elastic Beanstalk deploy failed #93

Closed
DzmitryU opened this issue Oct 2, 2017 · 8 comments
Closed

AWS Elastic Beanstalk deploy failed #93

DzmitryU opened this issue Oct 2, 2017 · 8 comments

Comments

@DzmitryU
Copy link

DzmitryU commented Oct 2, 2017

  • Operating System version: CentOS
  • Firebase SDK version: 5.3.0
  • Firebase Product: Cloud Messaging

I use AWS Elastic Beanstalk for my application deployment.
Using of firebase-admin library causes deployment failures:

ERROR: Failed to run npm install. Snapshot logs for more details. ERROR: [Instance: i-068bd9d30a1d8df4b] Command failed on instance. Return code: 1 Output: (TRUNCATED)...pt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install raise e subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 254. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1]. ERROR: Unsuccessful command execution on instance id(s) 'i-068bd9d30a1d8df4b'. Aborting the operation. ERROR: Failed to deploy application.

The same problem is reproduced on t2.micro and t2.small.

Similar issue is described here, but I don't want to use EC2 with bigger CPU:
parse-community/parse-server#1276

Looks like you have some problems with memory leaks during dependency installation.

P.S. - no problem with deployment during using library from https://www.npmjs.com/package/fcm-node

@hiranya911
Copy link
Contributor

@DzmitryU Can you share the contents of /var/log/eb-activity.log?

@DzmitryU
Copy link
Author

DzmitryU commented Oct 3, 2017

@hiranya911 Sure

  npm ERR! Linux 4.4.51-40.60.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm" "--production" "rebuild"
  npm ERR! node v6.10.0
  npm ERR! npm  v3.10.10
  npm ERR! path /tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv
  npm ERR! code ENOENT
  npm ERR! errno -2
  npm ERR! syscall chmod
  
  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'
  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'
  npm ERR! enoent This is most likely not a problem with npm itself
  npm ERR! enoent and is related to npm not being able to find a file.
  npm ERR! enoent 
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /tmp/deployment/application/npm-debug.log
  Running npm install:  /opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm
  Setting npm config jobs to 1
  npm config jobs set to 1
  Running npm with --production flag
  Failed to run npm install. Snapshot logs for more details.
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
      self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 254 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
  npm WARN lifecycle project-server@0.0.0~preinstall: cannot run in wd %s %s (wd=%s) project-server@0.0.0 npm install -g gulp && npm install -g typings /tmp/deployment/application

  npm ERR! Linux 4.4.51-40.60.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm" "--production" "rebuild"
  npm ERR! node v6.10.0
  npm ERR! npm  v3.10.10
  npm ERR! path /tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv
  npm ERR! code ENOENT
  npm ERR! errno -2
  npm ERR! syscall chmod
  
  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'
  npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'
  npm ERR! enoent This is most likely not a problem with npm itself
  npm ERR! enoent and is related to npm not being able to find a file.
  npm ERR! enoent 
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /tmp/deployment/application/npm-debug.log
  Running npm install:  /opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm
  Setting npm config jobs to 1
  npm config jobs set to 1
  Running npm with --production flag
  Failed to run npm install. Snapshot logs for more details.
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
      self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 254 (Executor::NonZeroExitStatus)

And npm-debug.log:

6235 verbose rebuild bundle /tmp/deployment/application/node_modules/firebase-admin/node_modules/signal-exit

6236 info build /tmp/deployment/application/node_modules/firebase-admin/node_modules/signal-exit

6237 info lifecycle signal-exit@3.0.2~preinstall: signal-exit@3.0.2

6238 silly lifecycle signal-exit@3.0.2~preinstall: no script for preinstall, continuing

6239 info linkStuff signal-exit@3.0.2

6240 silly linkStuff signal-exit@3.0.2 has /tmp/deployment/application/node_modules/firebase-admin/node_modules as its parent node_modules

6241 verbose linkBins signal-exit@3.0.2

6242 verbose linkMans signal-exit@3.0.2

6243 verbose rebuildBundles signal-exit@3.0.2

6244 info lifecycle signal-exit@3.0.2~install: signal-exit@3.0.2

6245 silly lifecycle signal-exit@3.0.2~install: no script for install, continuing

6246 info lifecycle signal-exit@3.0.2~postinstall: signal-exit@3.0.2

6247 silly lifecycle signal-exit@3.0.2~postinstall: no script for postinstall, continuing

6248 verbose rebuild bundle /tmp/deployment/application/node_modules/firebase-admin/node_modules/sntp

6249 info build /tmp/deployment/application/node_modules/firebase-admin/node_modules/sntp

6250 info lifecycle sntp@2.0.2~preinstall: sntp@2.0.2

6251 silly lifecycle sntp@2.0.2~preinstall: no script for preinstall, continuing

6252 info linkStuff sntp@2.0.2

6253 silly linkStuff sntp@2.0.2 has /tmp/deployment/application/node_modules/firebase-admin/node_modules as its parent node_modules

6254 verbose linkBins sntp@2.0.2

6255 verbose linkMans sntp@2.0.2

6256 verbose rebuildBundles sntp@2.0.2

6257 info lifecycle sntp@2.0.2~install: sntp@2.0.2

6258 silly lifecycle sntp@2.0.2~install: no script for install, continuing

6259 info lifecycle sntp@2.0.2~postinstall: sntp@2.0.2

6260 silly lifecycle sntp@2.0.2~postinstall: no script for postinstall, continuing

6261 verbose rebuild bundle /tmp/deployment/application/node_modules/firebase-admin/node_modules/split-array-stream

6262 info build /tmp/deployment/application/node_modules/firebase-admin/node_modules/split-array-stream

6263 info lifecycle split-array-stream@1.0.3~preinstall: split-array-stream@1.0.3

6264 silly lifecycle split-array-stream@1.0.3~preinstall: no script for preinstall, continuing

6265 info linkStuff split-array-stream@1.0.3

6266 silly linkStuff split-array-stream@1.0.3 has /tmp/deployment/application/node_modules/firebase-admin/node_modules as its parent node_modules

6267 verbose linkBins split-array-stream@1.0.3

6268 verbose linkMans split-array-stream@1.0.3

6269 verbose rebuildBundles split-array-stream@1.0.3

6270 info lifecycle split-array-stream@1.0.3~install: split-array-stream@1.0.3

6271 silly lifecycle split-array-stream@1.0.3~install: no script for install, continuing

6272 info lifecycle split-array-stream@1.0.3~postinstall: split-array-stream@1.0.3

6273 silly lifecycle split-array-stream@1.0.3~postinstall: no script for postinstall, continuing

6274 verbose rebuild bundle /tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk

6275 info build /tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk

6276 info lifecycle sshpk@1.13.1~preinstall: sshpk@1.13.1

6277 silly lifecycle sshpk@1.13.1~preinstall: no script for preinstall, continuing

6278 info linkStuff sshpk@1.13.1

6279 silly linkStuff sshpk@1.13.1 has /tmp/deployment/application/node_modules/firebase-admin/node_modules as its parent node_modules

6280 verbose linkBins sshpk@1.13.1

6281 verbose link bins [ { 'sshpk-conv': 'bin\\sshpk-conv',

6281 verbose link bins     'sshpk-sign': 'bin\\sshpk-sign',

6281 verbose link bins     'sshpk-verify': 'bin\\sshpk-verify' },

6281 verbose link bins   '/tmp/deployment/application/node_modules/firebase-admin/node_modules/.bin',

6281 verbose link bins   false ]

6282 verbose linkMans sshpk@1.13.1

6283 verbose rebuildBundles sshpk@1.13.1

6284 verbose stack Error: ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'

6284 verbose stack     at Error (native)

6285 verbose cwd /tmp/deployment/application

6286 error Linux 4.4.51-40.60.amzn1.x86_64

6287 error argv "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm" "--production" "rebuild"

6288 error node v6.10.0

6289 error npm  v3.10.10

6290 error path /tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv

6291 error code ENOENT

6292 error errno -2

6293 error syscall chmod

6294 error enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'

6295 error enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/firebase-admin/node_modules/sshpk/bin\sshpk-conv'

6295 error enoent This is most likely not a problem with npm itself

6295 error enoent and is related to npm not being able to find a file.

6296 verbose exit [ -2, true ]

@hiranya911
Copy link
Contributor

I don't think this is a problem in the Admin SDK. It's unclear why the Beanstalk environment looks for the sshpk binary within firebase-admin. It looks like others have run into similar issues:

https://forums.aws.amazon.com/thread.jspa?messageID=787343

I'd recommend reaching out to AWS Beanstalk support forums for some guidance.

@YamanSehzade
Copy link

YamanSehzade commented Oct 10, 2017

Hi,

I am using meteor server and i have same error;

npm ERR! path /app/bundle/programs/server/npm/node_modules/firebase-admin/node_modules/grpc/node_modules/sshpk/bin\sshpk-conv
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/app/bundle/programs/server/npm/node_modules/firebase-admin/node_modules/grpc/node_modules/sshpk/bin\sshpk-conv'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

what is interesting is that; the local server is running but the cloud server is failing and
\node_modules\firebase-admin\node_modules\grpc\node_modules\sshpk\bin\sshpk-conv this file actually exists.
Do you have any suggestion ? @DzmitryU

@hiranya911
Copy link
Contributor

hiranya911 commented Oct 10, 2017

This might be related: npm/npm#9633 (comment)

Unfortunately, we don't have any better explanation right now. But given that this only occurs in some environments, chances are the issue environment-specific.

@DzmitryU
Copy link
Author

@YamanSehzade Hi!
I've just moved from firebase-admin to fcm-node. It's build on callbacks instead of promises, but there is no problems with deployment.

@karthikgollapudi
Copy link

karthikgollapudi commented Nov 17, 2017

@DzmitryU @YamanSehzade fcm-node works because it changes the firebase-admin dependency to 4.2.1. It would be a quicker fix to just change the version of firebase-admin you're using as long as all the features still work.

@hiranya911
Copy link
Contributor

I believe a lot of the gRPC issues are now resolved, or has known workarounds. Other issues are app or platform specific and need to be debugged independently.

lahirumaramba added a commit that referenced this issue Apr 28, 2022
* Add Functions API

* PR fixes

* Refactor internal Functions implementation

* Adding unit tests first pass

* Complete unit tests, add integration tests

* rename service account email helper

* Add support for partial resource names

* Update unit tests

* Make url public for beta

* PR fixes

* Fix docstrings

* remove validation for data payload

* fix docs

* minor fixes

* fixed a capitalization creep
lahirumaramba added a commit that referenced this issue Apr 28, 2022
* Add Functions API

* PR fixes

* Refactor internal Functions implementation

* Adding unit tests first pass

* Complete unit tests, add integration tests

* rename service account email helper

* Add support for partial resource names

* Update unit tests

* Make url public for beta

* PR fixes

* Fix docstrings

* remove validation for data payload

* fix docs

* minor fixes

* fixed a capitalization creep
lahirumaramba added a commit that referenced this issue May 4, 2022
* Add Functions API

* PR fixes

* Refactor internal Functions implementation

* Adding unit tests first pass

* Complete unit tests, add integration tests

* rename service account email helper

* Add support for partial resource names

* Update unit tests

* Make url public for beta

* PR fixes

* Fix docstrings

* remove validation for data payload

* fix docs

* minor fixes

* fixed a capitalization creep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants