AWS - Elastic Beanstalk npm install issue

736 views
Skip to first unread message

Ken Johnson

unread,
May 19, 2016, 4:16:57 PM5/19/16
to node-ibm_db
I'm attempting to use the ibm_db module in an application deployed to AWS Elastic Beanstalk.  EB attempts an npm install during deploy of the application but fails with a permissions issue in driverInstall.js (I believe attempting to open the sqlda.h file for write).  it appears EB uses a combination of root and ec2-user in the install, triggering the issue.  Can someone help me determine a fix or workaround?


From the logs:

 > dtrace-...@0.5.0 install /tmp/deployment/application/node_modules/bunyan/node_modules/dtrace-provider
  > node scripts/install.js
  
  
  > ibm...@0.0.19 install /tmp/deployment/application/node_modules/ibm_db
  > node installer/driverInstall.js
  
  events.js:141
        throw er; // Unhandled 'error' event
        ^
  
  Error: EACCES: permission denied, open '/tmp/deployment/application/node_modules/ibm_db/installer/clidriver/include/sqlda.h'
      at Error (native)
  
  npm ERR! Linux 4.4.8-20.46.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/bin/npm" "--production" "rebuild"
  npm ERR! node v4.4.3
  npm ERR! npm  v2.15.1
  npm ERR! code ELIFECYCLE
  npm ERR! ibm...@0.0.19 install: `node installer/driverInstall.js`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the ibm...@0.0.19 install script 'node installer/driverInstall.js'.
  npm ERR! This is most likely a problem with the ibm_db package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     node installer/driverInstall.js
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs ibm_db
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR! 
  npm ERR!     npm owner ls ibm_db
  npm ERR! There is likely additional logging output above.

Here's the permissions on the include directory after the failure:

/tmp/deployment/application/node_modules/ibm_db/installer/clidriver/include

[root@ip-10-0-1-177 include]# ls -la
total 840
drwxr-xr-x  2 ec2-user root   4096 Jan 23  2015 .
drwxr-xr-x 13 ec2-user root   4096 Jan 23  2015 ..
-r--r--r--  1 ec2-user root   3662 Aug 16  2005 sqlca.h
-r--r--r--  1 ec2-user root  75284 Sep 30  2014 sqlcli1.h
-r--r--r--  1 ec2-user root  33072 Jan 24  2013 sqlcli.h
-r--r--r--  1 ec2-user root  14899 Nov 14  2006 sqlda.h
-r--r--r--  1 ec2-user root 364001 Jan 22  2015 sqlenv.h
-r--r--r--  1 ec2-user root  89147 Feb 28  2014 sqlext.h
-r--r--r--  1 ec2-user root 182540 Jan 22  2015 sql.h
-r--r--r--  1 ec2-user root  70185 Jan 22  2015 sqlstate.h
-r--r--r--  1 ec2-user root   3751 Aug 15  2005 sqlsystm.h

bimaljha

unread,
May 20, 2016, 4:08:00 AM5/20/16
to node-ibm_db
Error seems while extracting files from linuxx64_odbc_cli.tar.gz file. sqlda.h get create once we untag the tar.gz file. Can you please try to download http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz and unzip?Alternatively, you can try running "node ibm_db/installer/driverInstall.js" command. This command, untar the tar.gz file and compiles the code to generate binary node add-on. Thanks.

Ken Johnson

unread,
Aug 4, 2016, 4:51:50 AM8/4/16
to node-ibm_db
I am able to install the npm module manually on an ec2 instance.  The issue is with the normal npm install Elastic Beanstalk performs when you install or update your application via EB.

For anyone struggling with this same issue I was able to work around by using the technique here: http://stackoverflow.com/a/23242623/2707524
Reply all
Reply to author
Forward
0 new messages