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

v2.2.4 Deploy failing on Amazon Elastic Beanstalk #1276

Closed
tanmays opened this issue Mar 30, 2016 · 56 comments
Closed

v2.2.4 Deploy failing on Amazon Elastic Beanstalk #1276

tanmays opened this issue Mar 30, 2016 · 56 comments

Comments

@tanmays
Copy link

tanmays commented Mar 30, 2016

I was trying out the latest release and I'm why not sure why but I'm not able to successfully deploy to elastic beanstalk anymore.

Last successfu eb deployment was on parse-server release v2.2.2

Local installation however is successful.

Here is the eb activity log:

-------------------------------------
/var/log/eb-activity.log
-------------------------------------
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

  > [email protected] install /tmp/deployment/application/node_modules/kerberos
  > (node-gyp rebuild) || (exit 0)

  make: Entering directory `/tmp/deployment/application/node_modules/kerberos/build'
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
  In file included from ../lib/kerberos.cc:1:0:
  ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory
   #include <gssapi/gssapi.h>
                             ^
  compilation terminated.
  make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
  make: Leaving directory `/tmp/deployment/application/node_modules/kerberos/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
  gyp ERR! stack     at emitTwo (events.js:87:13)
  gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
  gyp ERR! System Linux 4.1.17-22.30.amzn1.x86_64
  gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/kerberos
  gyp ERR! node -v v4.3.0
  gyp ERR! node-gyp -v v3.0.3
  gyp ERR! not ok 
  npm WARN optional dep failed, continuing [email protected]

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)


[2016-03-30T08:25:32.615Z] INFO  [2918]  - [Application update/AppDeployStage0/AppDeployPreHook/50npm.sh] : Activity failed.
[2016-03-30T08:25:32.617Z] INFO  [2918]  - [Application update/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2016-03-30T08:25:32.617Z] INFO  [2918]  - [Application update/AppDeployStage0] : Activity failed.
[2016-03-30T08:25:32.618Z] INFO  [2918]  - [Application update] : Completed activity. Result:
  Application update - Command CMD-AppDeploy failed
-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

  > [email protected] install /tmp/deployment/application/node_modules/kerberos
  > (node-gyp rebuild) || (exit 0)

  make: Entering directory `/tmp/deployment/application/node_modules/kerberos/build'
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
  In file included from ../lib/kerberos.cc:1:0:
  ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory
   #include <gssapi/gssapi.h>
                             ^
  compilation terminated.
  make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
  make: Leaving directory `/tmp/deployment/application/node_modules/kerberos/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
  gyp ERR! stack     at emitTwo (events.js:87:13)
  gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
  gyp ERR! System Linux 4.1.17-22.30.amzn1.x86_64
  gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/kerberos
  gyp ERR! node -v v4.3.0
  gyp ERR! node-gyp -v v3.0.3
  gyp ERR! not ok 
  npm WARN optional dep failed, continuing [email protected]

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)


[2016-03-30T08:25:32.618Z] ERROR [2918]  : Command CMD-AppDeploy failed!

Possibly related issue #1082

@tanmays
Copy link
Author

tanmays commented Apr 1, 2016

Searched a bit and this issue is probably same as this #https://github.com/christkv/kerberos/issues/33

Looks like this issue is limited to AWS Elastic beanstalk. I'm still not sure why I'm facing it now, been trying hard to figure out what changed between v2.2.2 and v2.2.4 that caused this.

@flovilmart
Copy link
Contributor

Are you running EB over CentOS 6? Maybe try changing the distro to debian, ubuntu or something else if you can.

@flovilmart
Copy link
Contributor

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

@flovilmart Elastic beanstalk provides only Amazon Linux as an option.

As for the workaround mentioned in the link you posted, it seemed to work at first but subsequent deploys are still failing. It fails sometimes due to some issue with parse-server-gcs-adapter and sometimes due to some random compiling error. I'll try to narrow down the issue and if I can't I'll post some more detailed logs again.

@flovilmart
Copy link
Contributor

Ok... So the solution would be to remove the GCS adapter dependency from parse-server, and let the users that use it depend on it by themselves.

That would be the quick/dirty fix.

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Yes and I feel all 3rd party integrations should be an external dependancy. OneSignal in case of push is already separated, Even Mailgun, S3, GCS and maybe if in future an Azure based file adapter or mandrill based mail adapter comes along, it makes sense to keep those external.

@flovilmart
Copy link
Contributor

They have been all externalizer already. We just kept them in as this is a breaking change, not backwards compatible.

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Ah I see. I don't think anyone is using parse-server yet for production so I guess the sooner you introduce these breaking changes the better since we are getting so close to a stable product. Most of the people are keeping up to date with releases.

Thanks again for all the hard work.

@flovilmart
Copy link
Contributor

We may need to release a Major that's what's problematic... We can't really assume that. Not sure of the proportions using it as a npm module

Opened #1339

@flovilmart flovilmart reopened this Apr 2, 2016
@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Tried to deploy again and it failed. Here are the logs

-------------------------------------
/var/log/eb-activity.log
-------------------------------------
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

  > [email protected] install /tmp/deployment/application/node_modules/kerberos
  > (node-gyp rebuild) || (exit 0)

  make: Entering directory `/tmp/deployment/application/node_modules/kerberos/build'
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
    CXX(target) Release/obj.target/kerberos/lib/worker.o
    CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
  ../lib/kerberosgss.c:36:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic push
   ^
  ../lib/kerberosgss.c:37:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic ignored "-Wdeprecated-declarations"
   ^
  ../lib/kerberosgss.c: In function ‘authenticate_gss_client_wrap’:
  ../lib/kerberosgss.c:377:19: warning: variable ‘server_conf_flags’ set but not used [-Wunused-but-set-variable]
     char buf[4096], server_conf_flags;
                     ^
  ../lib/kerberosgss.c: At top level:
  ../lib/kerberosgss.c:945:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic pop
   ^
    CC(target) Release/obj.target/kerberos/lib/base64.o
    CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
    SOLINK_MODULE(target) Release/obj.target/kerberos.node
    COPY Release/kerberos.node
  make: Leaving directory `/tmp/deployment/application/node_modules/kerberos/build'
  npm WARN optional dep failed, continuing [email protected]

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)


[2016-04-02T18:11:02.352Z] INFO  [4956]  - [Application update/AppDeployStage0/AppDeployPreHook/50npm.sh] : Activity failed.
[2016-04-02T18:11:02.352Z] INFO  [4956]  - [Application update/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2016-04-02T18:11:02.352Z] INFO  [4956]  - [Application update/AppDeployStage0] : Activity failed.
[2016-04-02T18:11:02.356Z] INFO  [4956]  - [Application update] : Completed activity. Result:
  Application update - Command CMD-AppDeploy failed

-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

  > [email protected] install /tmp/deployment/application/node_modules/kerberos
  > (node-gyp rebuild) || (exit 0)

  make: Entering directory `/tmp/deployment/application/node_modules/kerberos/build'
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
    CXX(target) Release/obj.target/kerberos/lib/worker.o
    CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
  ../lib/kerberosgss.c:36:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic push
   ^
  ../lib/kerberosgss.c:37:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic ignored "-Wdeprecated-declarations"
   ^
  ../lib/kerberosgss.c: In function ‘authenticate_gss_client_wrap’:
  ../lib/kerberosgss.c:377:19: warning: variable ‘server_conf_flags’ set but not used [-Wunused-but-set-variable]
     char buf[4096], server_conf_flags;
                     ^
  ../lib/kerberosgss.c: At top level:
  ../lib/kerberosgss.c:945:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   #pragma clang diagnostic pop
   ^
    CC(target) Release/obj.target/kerberos/lib/base64.o
    CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
    SOLINK_MODULE(target) Release/obj.target/kerberos.node
    COPY Release/kerberos.node
  make: Leaving directory `/tmp/deployment/application/node_modules/kerberos/build'
  npm WARN optional dep failed, continuing [email protected]

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build



  Running npm install:  /opt/elasticbeanstalk/node-install/node-v4.3.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 681, in <module>
      main()
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
      node_version_manager.run_npm_install(options.app_path)
    File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
      raise e
  subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)


[2016-04-02T18:11:02.355Z] ERROR [4956]  : Command CMD-AppDeploy failed!
[2016-04-02T18:11:02.470Z] INFO  [4956]  : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...\"/opt/elasticbeanstalk/containerfiles/ebnode.py\", line 166, in npm_install\n    raise e\nsubprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1. \nHook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[{"msg":"Failed to run npm install. Snapshot logs for more details.","severity":"ERROR","timestamp":1459620662469}]}],"truncated":"true"}

I'm afraid we have no choice but to make parse-server-gcs-adapter optional. I'm sure a lot of people would be using AWS EB for its ease of use and price-to-feature benefit.

@flovilmart
Copy link
Contributor

If you add gcc-c++.x86_64 to the yum packages elastic beanstalk config, does it help?

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

How do I add that? I already have gcc. Here are the packages I'm installing according to the link you mentioned at the top:

packages:
  yum:
    gcc: []
    make: []
    openssl-devel: []
    libxml2: []
    libxml2-devel: []
    krb5-devel: []

@flovilmart
Copy link
Contributor

node needs a c++ compiler too... I'm testing now. that would be gcc-c++.noarch or gcc-c++

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Adde this gcc-c++.x86_64: []to the yum packages list. Will let you know in a few minutes.

@flovilmart
Copy link
Contributor

on my eb the package was not found, set to gcc-c++ instad

@flovilmart
Copy link
Contributor

still no luck for me, I start suspecting the problem is that node-gyp is missing.

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Same here, didn't work.

I've noticed that the first time EB tries to deploy the app it works, any subsequent deployment fails. Right now I have to terminate the env and create it again to get 2.2.4 to work OR remove parse-server dep from the example express app, deploy, let it fail and then add it back, deploy and it works. So I'm not exactly sure why it works the first time and fails the rest.

@flovilmart
Copy link
Contributor

hmmmm that's interesting... we should put a not to the EB guys

@markuswinkler
Copy link

2.2.4 works for me (multiple deployments so far).

This is my setup:

  "dependencies": {
    "express": "~4.13.4",
    "kerberos": "~0.0.x",
    "parse": "~1.8.1",
    "parse-server": "~2.2.4",
    "parse-server-onesignal-push-adapter": ">= 1.0.0",
    "underscore": "~1.8.3"
  },

It was failing for me first because the machine didn't have enough memory (t2.micro),
switching to t2.small solved that.

@flovilmart
Copy link
Contributor

@markuswinkler you're using elastic beanstalk?

@markuswinkler
Copy link

yes

@flovilmart
Copy link
Contributor

you gotta be kidding me....

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

t2.micro has about 1Gb of memory, are you saying that 1gb ain't enough? Surely something is not right.

@markuswinkler
Copy link

Looks like it needs more than 1GB during install.

Found this in the install log, maybe this helps:

  > [email protected] install /tmp/deployment/application/node_modules/kerberos
  > (node-gyp rebuild) || (exit 0)

  make: Entering directory `/tmp/deployment/application/node_modules/kerberos/build'
    CXX(target) Release/obj.target/kerberos/lib/kerberos.o
  In file included from ../lib/kerberos.cc:1:0:
  ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory
   #include <gssapi/gssapi.h>
                             ^
  compilation terminated.
  make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
  make: Leaving directory `/tmp/deployment/application/node_modules/kerberos/build'
  gyp ERR! build error 
  gyp ERR! stack Error: `make` failed with exit code: 2
  gyp ERR! stack     at ChildProcess.onExit (/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
  gyp ERR! stack     at emitTwo (events.js:87:13)
  gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
  gyp ERR! System Linux 4.1.17-22.30.amzn1.x86_64
  gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
  gyp ERR! cwd /tmp/deployment/application/node_modules/kerberos
  gyp ERR! node -v v4.3.0
  gyp ERR! node-gyp -v v3.0.3
  gyp ERR! not ok 

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc
  > node-pre-gyp install --fallback-to-build

  [grpc] Success: "/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node" already installed
  Pass --update-binary to reinstall or --build-from-source to recompile

  > [email protected] install /tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32
  > node-gyp rebuild

  make: Entering directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
    CXX(target) Release/obj.target/crc32c_sse42/src/crc32c_sse42.o
    AR(target) Release/obj.target/crc32c_sse42.a
    COPY Release/crc32c_sse42.a
    CXX(target) Release/obj.target/sse4_crc32/src/crc32c.o
    SOLINK_MODULE(target) Release/obj.target/sse4_crc32.node
    COPY Release/sse4_crc32.node
  make: Leaving directory `/tmp/deployment/application/node_modules/parse-server/node_modules/parse-server-gcs-adapter/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/fast-crc32c/node_modules/sse4_crc32/build'

@flovilmart
Copy link
Contributor

That's entirely possible that the memory pressure is high during install, as this is a python script that orchestrates the deployment and that spawns the npm install / rebuild process. @markuswinkler even with those logs, the installation don't fail right?

@markuswinkler
Copy link

yes, works all the way through (takes about 5 minutes to deploy). just thought I share my findings.

@flovilmart
Copy link
Contributor

@markuswinkler that is definitely helpful!

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

If true then it's all the more reason not to include unwanted deps and keep them external only.

I am going to try monitoring memory when installing and get back. https://www.otreva.com/blog/monitoring-memory-ram-aws-elasticbeanstalk-ec2-instances-cloudwatch/

@markuswinkler
Copy link

Are there any log files that could help? I am by no means an AWS expert.

@flovilmart
Copy link
Contributor

I had a custom .ebextension thing, I'll try without. I'll post the logs when I get them

@flovilmart
Copy link
Contributor

@markuswinkler
Copy link

are your package requirements all the same as mine? maybe there is a weird dependency.

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

@markuswinkler @flovilmart I monitored the memory and the memory utilisation is indeed very high. Peaked at about 927mb during installation. We definitely need to work on cutting down memory usage during installation.

screen shot 2016-04-03 at 1 55 59 am

That being said I'm still not sure if this is indeed the cause of failure. Will try with a t2.small and report back.

@flovilmart
Copy link
Contributor

@markuswinkler just parse-server as a dependency

@markuswinkler
Copy link

try my full stack with the version numbers below. so far that's the only main difference.

"dependencies": {
    "express": "~4.13.4",
    "kerberos": "~0.0.x",
    "parse": "~1.8.1",
    "parse-server": "~2.2.4",
    "parse-server-onesignal-push-adapter": ">= 1.0.0",
    "underscore": "~1.8.3"
  },

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Well what do you know, using a t2.small worked! Tried deploying 5 times and all of them succeeded!

But there's a huge issue. With every subsequent deploy the memory required to install keeps increasing. Take a look at the memory usage below. All of those peak points are deployments. There seems to be a memory leak/cleanup issue. This explains why the remove parse-server - deploy - add parse-server - deploy routine I tried worked for me with t2.micro, since it probably purges the previously held memory.

screen shot 2016-04-03 at 2 32 33 am

I'm going to re-deploy a few more times and check whether even this eventually fails.

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

Update: Spoke too soon, thankfully the memory peaked at about 1.07Gb and never went above that. Average was about 900mb for the 7 deployments I tried.

@flovilmart here are the packages I've specified in .ebextensions config file. Try adding them and then deploy.

packages:
  yum:
    gcc: []
    make: []
    openssl-devel: []
    libxml2: []
    libxml2-devel: []
    krb5-devel: []
    gcc-c++: []

@flovilmart
Copy link
Contributor

so that's great! I'm glad that's fixed for you!

@tanmays @markuswinkler now, what would be the most awesome thing ever would be to write a little blog article :)

@markuswinkler
Copy link

For that I would need to have a blog first ;)
It took me almost a full miserable day until I figured out that all it was purely a memory issue,
didn't want anyone else lose hair over this. Just glad I could share. :)

@flovilmart
Copy link
Contributor

Thanks for sharing! We'll keep that in mind. The PR that removes those dependencies is still open and would I believe dramatically reduce the memory usage when running install / rebuild. Not sure if we're gonna merge it as it introduces a breaking change.

@tanmays I'll let you close that as you opened it when you feel it's good!

@markuswinkler
Copy link

well, if there is any good time to make a breaking change for the greater good it is now I guess.

@flovilmart
Copy link
Contributor

I've already externalized all the adapters (besides GridStoreAdapter, but it will go to) into external repositories, we decided to still depend on them to avoid the breaking changes. In the end, what matters most is the benefit for the community.

Thanks for helping on that! That was a really meaningful contribution!

@tanmays
Copy link
Author

tanmays commented Apr 2, 2016

@flovilmart I'll close this one, I hope the PR with breaking changes but improved memory efficiency gets merged, it'd be good in the long run. Alongside running a production server, a lot of people including me will also be using it for limited user beta releases, for which a micro instance would be perfect. I'm sure the community would present a lot of similar cases.

@dmennis
Copy link

dmennis commented Apr 6, 2016

@flovilmart, @tanmays, @markuswinkler

I know this issue is now closed but wanted to update you all on this issue. I'm on the AWS Mobile team and worked with the Elastic Beanstalk engineers to identify the issue and we are working on more permanent solution. You all have figured out a workaround but I wanted to document this and let others know they have options.

First of all, we (and you all) have identified TWO issues when upgrading Parse Server running on AWS Elastic Beanstalk.

Problem #1: The persistent error: fatal error: gssapi/gssapi.h: No such file or directory
#include <gssapi/gssapi.h> when deploying or updating Parse Server from any 2.x.x to 2.2 version.
Issue: Parse Server is attempting to build a kerberos module with native extensions. When attempting to retrieve a header file on the instance, it fails, and the error halts the deployment.
Solution: Add the following to the .ebextensions/app.config file:

packages:
  yum:
    krb5-devel: []

Save and re-deploy.

Tip: The easiest way to manage your Parse Server application on Elastic Beantalk is to install and configure the EB CLI here. I'm not a command-line user typically but this tool works great for both PC and Mac. Here's the quick overview for modifying an existing Parse Server application using the EB CLI:

  1. $ mkdir parseserver
  2. $ cd parseserver
  3. $ eb init //choose region and your application
  4. $ eb labs download //this will download your running application into the root of this folder
  5. Modify the .ebextensions/app.config file and apply the suggested changes, save.
  6. $ eb deploy
    Done. That's it. The updated application code will be zipped up and uploaded to S3 and deployed to your environment. This is the same process you can use to add environment variables, add modules, etc...

Problem #2: As @markuswinkler found out, the default t1.micro instance type for Elastic Beanstalk is running out of memory on subsequent deploys or reboots and so we thought the solution to #1 wasn't working.

Solution: If you are running a t1.micro and with the current Parse Server dependencies, you'll want to upgrade the instance type to something with more memory. This may not be an issue if the breaking PR gets pulled in, from what I hear. However, in the meantime, upgrade the instance type to avoid getting out-of-memory when the application starts up.

To change your instance type, click on Configuration in the EB Console then click the edit icon for the "Instances" card. This will let you set the instance type that determines the processing power of the Parse Server in your environment.

Conclusion: Applying the changes to the app.config for issue #1 and upgrading the instance type for issue #2 should resolve any "current" issues when attempting to modify, upgrade, or reboot your Parse Server application on AWS Elastic Beanstalk.

Next Steps: We'll be submitting a PR to modify the .ebextenstions/app.config for parse-server-example repo so that any future deployments don't need to worry about applying the changes for issue #1. For issue #2, AWS will most likely specify (explicitly) a larger instance type in their solution offered on the AWS Mobile Blog here. Currently, the solution does not explicitly specify the type and it defaults to the free-tier t1.micro in the us-east-1 region.

@flovilmart
Copy link
Contributor

We've also removed parse-server-gcs-adapter that was attempting to compile a native module. This is likely that since 2.2.6, t1.micro deploy again.

@markuswinkler
Copy link

deployment of t2.micro (1 GB RAM) still fails on 2.2.6. I also added the .ebextensions/app.config file @dennisAWS suggested.

btw, @dennisAWS, what's the best way to force go back to a working configuration? Once you select t2.micro instead of t2.small the configuration is locked in a reboot/install/fail cycle and aborting takes about 15 minutes.

@tanmays
Copy link
Author

tanmays commented Apr 7, 2016

@markuswinkler looks like 'parse-server-gcs-adapter' was removed after 2.2.6. We probably have to wait for 2.2.7.

@markuswinkler
Copy link

yes, but that one should actually reduce the memory foot print (gcs is used for google cloud storage), but alas, still fails.

@markuswinkler
Copy link

markuswinkler commented Apr 18, 2016

Great news, 2.2.7 runs stable on a t2.micro instance on AWS.
Sometimes even on a t2.nano. Data is inconclusive. Seems like each deployment uses a different amount of RAM. I ran t2.nano for a couple days without a problem but my latest deployment failed, had to go back to t2.micro.

@henrikperrochon
Copy link

henrikperrochon commented Oct 31, 2016

Hello,
I've been struggling with this issue and I don't know what to do now.
In my case, I want to update Parse Server from 2.2.17 (first install) to 2.2.23 on Elastic Beanstalk (node v6.9.1, npm v4.0.1).

I tryed to add @dennisAWS or @tanmays packages to .ebextensions, tryed with t2.micro and t2.small but in every case I got an error. Here is the full log in case you have a hint. Thanks!

`-------------------------------------

/var/log/nodejs/npm-debug.log

4268 verbose linkMans [email protected]
4269 verbose rebuildBundles [email protected]
4270 info lifecycle [email protected]install: [email protected]
4271 silly lifecycle [email protected]
install: no script for install, continuing
4272 info lifecycle [email protected]postinstall: [email protected]
4273 silly lifecycle [email protected]
postinstall: no script for postinstall, continuing
4274 info build /tmp/deployment/application/node_modules/eyes
4275 info lifecycle [email protected]preinstall: [email protected]
4276 silly lifecycle [email protected]
preinstall: no script for preinstall, continuing
4277 info linkStuff [email protected]
4278 silly linkStuff [email protected] has /tmp/deployment/application/node_modules as its parent node_modules
4279 verbose linkBins [email protected]
4280 verbose linkMans [email protected]
4281 verbose rebuildBundles [email protected]
4282 info lifecycle [email protected]install: [email protected]
4283 silly lifecycle [email protected]
install: no script for install, continuing
4284 info lifecycle [email protected]postinstall: [email protected]
4285 silly lifecycle [email protected]
postinstall: no script for postinstall, continuing
4286 info build /tmp/deployment/application/node_modules/pkginfo
4287 info lifecycle [email protected]preinstall: [email protected]
4288 silly lifecycle [email protected]
preinstall: no script for preinstall, continuing
4289 info linkStuff [email protected]
4290 silly linkStuff [email protected] has /tmp/deployment/application/node_modules as its parent node_modules
4291 verbose linkBins [email protected]
4292 verbose linkMans [email protected]
4293 verbose rebuildBundles [email protected]
4294 info lifecycle [email protected]install: [email protected]
4295 silly lifecycle [email protected]
install: no script for install, continuing
4296 info lifecycle [email protected]postinstall: [email protected]
4297 silly lifecycle [email protected]
postinstall: no script for postinstall, continuing
4298 info build /tmp/deployment/application/node_modules/stack-trace
4299 info lifecycle [email protected]preinstall: [email protected]
4300 silly lifecycle [email protected]
preinstall: no script for preinstall, continuing
4301 info linkStuff [email protected]
4302 silly linkStuff [email protected] has /tmp/deployment/application/node_modules as its parent node_modules
4303 verbose linkBins [email protected]
4304 verbose linkMans [email protected]
4305 verbose rebuildBundles [email protected]
4306 info lifecycle [email protected]install: [email protected]
4307 silly lifecycle [email protected]
install: no script for install, continuing
4308 info lifecycle [email protected]postinstall: [email protected]
4309 silly lifecycle [email protected]
postinstall: no script for postinstall, continuing
4310 info build /tmp/deployment/application/node_modules/winston-daily-rotate-file
4311 info lifecycle [email protected]preinstall: [email protected]
4312 silly lifecycle [email protected]
preinstall: no script for preinstall, continuing
4313 info linkStuff [email protected]
4314 silly linkStuff [email protected] has /tmp/deployment/application/node_modules as its parent node_modules
4315 verbose linkBins [email protected]
4316 verbose linkMans [email protected]
4317 verbose rebuildBundles [email protected]
4318 info lifecycle [email protected]install: [email protected]
4319 silly lifecycle [email protected]
install: no script for install, continuing
4320 info lifecycle [email protected]postinstall: [email protected]
4321 silly lifecycle [email protected]
postinstall: no script for postinstall, continuing
4322 info build /tmp/deployment/application/node_modules/bcrypt
4323 info lifecycle [email protected]preinstall: [email protected]
4324 silly lifecycle [email protected]
preinstall: no script for preinstall, continuing
4325 info linkStuff [email protected]
4326 silly linkStuff [email protected] has /tmp/deployment/application/node_modules as its parent node_modules
4327 verbose linkBins [email protected]
4328 verbose linkMans [email protected]
4329 verbose rebuildBundles [email protected]
4330 info lifecycle [email protected]install: [email protected]
4331 verbose lifecycle [email protected]
install: unsafe-perm in lifecycle false
4332 verbose lifecycle [email protected]install: PATH: /opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/lib/node_modules/npm/bin/node-gyp-bin:/tmp/deployment/application/node_modules/bcrypt/node_modules/.bin:/tmp/deployment/application/node_modules/.bin:/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
4333 verbose lifecycle [email protected]
install: CWD: /tmp/deployment/application/node_modules/bcrypt
4334 silly lifecycle [email protected]install: Args: [ '-c', 'node-gyp rebuild' ]
4335 silly lifecycle [email protected]
install: Returned: code: 1 signal: null
4336 info lifecycle [email protected]~install: Failed to exec install script
4337 verbose stack Error: [email protected] install: node-gyp rebuild
4337 verbose stack Exit status 1
4337 verbose stack at EventEmitter. (/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
4337 verbose stack at emitTwo (events.js:106:13)
4337 verbose stack at EventEmitter.emit (events.js:191:7)
4337 verbose stack at ChildProcess. (/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
4337 verbose stack at emitTwo (events.js:106:13)
4337 verbose stack at ChildProcess.emit (events.js:191:7)
4337 verbose stack at maybeClose (internal/child_process.js:877:16)
4337 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
4338 verbose pkgid [email protected]
4339 verbose cwd /tmp/deployment/application
4340 error Linux 4.4.23-31.54.amzn1.x86_64
4341 error argv "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/npm" "--production" "rebuild"
4342 error node v6.9.1
4343 error npm v4.0.1
4344 error code ELIFECYCLE
4345 error [email protected] install: node-gyp rebuild
4345 error Exit status 1
4346 error Failed at the [email protected] install script 'node-gyp rebuild'.
4346 error Make sure you have the latest version of node.js and npm installed.
4346 error If you do, this is most likely a problem with the bcrypt package,
4346 error not with npm itself.
4346 error Tell the author that this fails on your system:
4346 error node-gyp rebuild
4346 error You can get information on how to open an issue for this project with:
4346 error npm bugs bcrypt
4346 error Or if that isn't available, you can get their info via:
4346 error npm owner ls bcrypt
4346 error There is likely additional logging output above.
4347 verbose exit [ 1, true ]


/var/log/eb-activity.log

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

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.9.1-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
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.9.1-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

[email protected] postinstall /tmp/deployment/application/node_modules/pg-promise
node install.js

[email protected] install /tmp/deployment/application/node_modules/bcrypt
node-gyp rebuild

gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! stack at Error (native)
gyp ERR! System Linux 4.4.23-31.54.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/deployment/application/node_modules/bcrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm ERR! Linux 4.4.23-31.54.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/npm" "--production" "rebuild"
npm ERR! node v6.9.1
npm ERR! npm v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

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.9.1-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
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.9.1-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

[2016-10-31T17:17:14.528Z] INFO [3420] - [Application update app-161031_181506@3/AppDeployStage0/AppDeployPreHook/50npm.sh] : Activity failed.
[2016-10-31T17:17:14.528Z] INFO [3420] - [Application update app-161031_181506@3/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2016-10-31T17:17:14.529Z] INFO [3420] - [Application update app-161031_181506@3/AppDeployStage0] : Activity failed.
[2016-10-31T17:17:14.529Z] INFO [3420] - [Application update app-161031_181506@3] : Completed activity. Result:
Application update - Command CMD-AppDeploy failed
[2016-10-31T17:18:17.209Z] INFO [3676] - [CMD-TailLogs] : Starting activity...
[2016-10-31T17:18:17.209Z] INFO [3676] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2016-10-31T17:18:17.209Z] INFO [3676] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2016-10-31T17:18:17.210Z] INFO [3676] - [CMD-TailLogs/TailLogs] : Starting activity...
[2016-10-31T17:18:17.210Z] INFO [3676] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...


/var/log/eb-commandprocessor.log

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
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.9.1-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

[email protected] postinstall /tmp/deployment/application/node_modules/pg-promise
node install.js

[email protected] install /tmp/deployment/application/node_modules/bcrypt
node-gyp rebuild

gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! stack at Error (native)
gyp ERR! System Linux 4.4.23-31.54.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/deployment/application/node_modules/bcrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm ERR! Linux 4.4.23-31.54.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/npm" "--production" "rebuild"
npm ERR! node v6.9.1
npm ERR! npm v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

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.9.1-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
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.9.1-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

`

@przemyslaw-szurmak
Copy link

Dear all, I have the same problem as @Helmikku - tried with Parse 2.2.25-beta.1. working under "64bit Amazon Linux 2016.09 v3.1.0 running Node.js" on t2.micro. Any ideas how to resolve it ?

@demsey2
Copy link

demsey2 commented Nov 7, 2016

I had to switch to *.small instance with more memory, that worked for me.

@henrikperrochon
Copy link

Hello @przemyslaw-szurmak,

I "accidentally" managed to deploy it, even on t2.micro.
It failed when I installed Parse 2.2.23 locally first. Once I "eb deployed" without updating my local folder and it worked.

Maybe the error comes from the local "npm_modules" folder?

In the end, I have 2 files in my .ebextensions:
1 - commands.config (that update my environment)

commands:
  update:
    command: PATH=$PATH:/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/ && npm update -g npm
    cwd: /opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/

2 - packages.config

packages:
  yum:
    krb5-devel: []

And my package.json:

{
    "name": "xxxxxxx",
    "version": "X.X.X",
    "description": "XXXXXXX",
    "main": "index.js",
    "author": "XXXXXXX",
    "license": "ISC",
    "dependencies": {
        "ejs": "2.5.2",
        "express": "4.14.0",
        "node-mailjet": "3.0.5",
        "parse-server": "2.2.23"
    },
    "engines": {
        "node": ">=4.5"
    },
    "repository": {
        "type": "git",
        "url": "https://[email protected]/XXXXXXX/XXXXXXX/XXXXXXX.git"
    },
    "scripts": {
        "start": "node index.js"
    }
}

@przemyslaw-szurmak
Copy link

przemyslaw-szurmak commented Nov 21, 2016

@Helmikku hey, so finally i was able to do deployment with latest commit of parse-server (commit c8823f2) ! I did what you've suggested - removed npm_modules from my local repository and deployed without it. Now it works fine. Thanks for help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants