Bug 842281

Summary: Failed to install sqlite3 module for nodejs-0.6 app using package.json and deplist.txt
Product: OKD Reporter: jizhao
Component: ContainersAssignee: Mrunal Patel <mpatel>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: mpatel, szhou
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:42:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Detailed log of npm none

Description jizhao 2012-07-23 10:55:12 UTC
Created attachment 599755 [details]
Detailed log of npm

Description of problem:
Create a nodejs-0.6 app and add "sqlite3" to package.json or deplist.txt. Git push all the changes and the installation will fail. But if you login to the server and run "npm install sqlite3", the installation will succeed. I've attached the npm-debug.log.

Version-Release number of selected component (if applicable):
devenv_1906

How reproducible:
Always

Steps to Reproduce:
1.Create a nodejs-0.6 app
2.add sqlite3 to <git_repo>/package.json
<-----------------code snippets------------------------>
  "dependencies": {
    "sqlite3": "2.1.5"
  },
<------------------------------------------------------>
or add sqlite3 to deplist.txt
3.Git push
  
Actual results:
Output of git push:
<----------------------output--------------------->
remote: Saving away previously installed Node modules
remote: ~/git/app2.git ~/git/app2.git
remote: ~/git/app2.git
remote: Running .openshift/action_hooks/pre_build
remote: npm info it worked if it ends with ok
remote: npm info using npm.24
remote: npm info using node.19
remote: npm info preinstall OpenShift-Sample-App.0
remote: npm http GET https://registry.npmjs.org/sqlite3/2.1.5
remote: npm http 304 https://registry.npmjs.org/sqlite3/2.1.5
remote: npm info into /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo sqlite3.5
remote: npm info installOne sqlite3.5
remote: npm info unbuild /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo/node_modules/sqlite3
remote: npm info preinstall sqlite3.5
remote: npm info build /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo/node_modules/sqlite3
remote: npm info linkStuff sqlite3.5
remote: npm info install sqlite3.5
remote: 
remote: > sqlite3.5 install /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo/node_modules/sqlite3
remote: > node-gyp rebuild
remote: 
remote: info it worked if it ends with ok 
remote: info downloading: http://nodejs.org/dist/v0.6.19/node-v0.6.19.tar.gz 
remote: ERR! Error: EXDEV, link '/usr/lib/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/gyptest.pyc'
remote: ERR! not ok
remote: npm info sqlite3.5 Failed to exec install script
remote: npm info unbuild /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo/node_modules/sqlite3
remote: npm info preuninstall sqlite3.5
remote: npm info uninstall sqlite3.5
remote: npm info postuninstall sqlite3.5
remote: 
remote: npm ERR! sqlite3.5 install: `node-gyp rebuild`
remote: npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
remote: npm ERR! 
remote: npm ERR! Failed at the sqlite3.5 install script.
remote: npm ERR! This is most likely a problem with the sqlite3 package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR!     node-gyp rebuild
remote: npm ERR! You can get their info via:
remote: npm ERR!     npm owner ls sqlite3
remote: npm ERR! There is likely additional logging output above.
remote: npm ERR! 
remote: npm ERR! System Linux 2.6.32-279.2.1.el6.x86_64
remote: npm ERR! command "node" "/usr/bin/npm" "install" "-d"
remote: npm ERR! cwd /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo
remote: npm ERR! node -v v0.6.19
remote: npm ERR! npm -v 1.1.24
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! message sqlite3.5 install: `node-gyp rebuild`
remote: npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
remote: npm ERR! errno {}
remote: npm ERR! 
remote: npm ERR! Additional logging details can be found in:
remote: npm ERR!     /var/lib/stickshift/77031ae6eb324c71901a522d80d596ed/app-root/runtime/repo/npm-debug.log
remote: npm not ok
remote: npm not ok
remote: Running .openshift/action_hooks/build
remote: Running .openshift/action_hooks/deploy
remote: Starting application...
remote: Done
<------------------------------------------->

Expected results:
sqlite3 should be installed successfully.

Additional info:

Comment 1 Mrunal Patel 2012-07-27 00:04:04 UTC
Hi,
Logging into the app and trying npm install sqlite3 fails with the same
error for me and that makes me suspect that it is an issue with the sqlite3 package itself. Could you tell me which directory did you execute it from?

- Mrunal

Comment 2 jizhao 2012-07-30 04:43:01 UTC
(In reply to comment #1)
> Hi,
> Logging into the app and trying npm install sqlite3 fails with the same
> error for me and that makes me suspect that it is an issue with the sqlite3
> package itself. Could you tell me which directory did you execute it from?
> 
> - Mrunal

Hi,
By logging into the server, I mean log in the server as root in devenv environment.
Steps:
1. Log into the server as root.
2. npm install sqlite3
The latest sqlite3 version is 2.1.5. It can't be installed successfully if you add it to package.json, but can be installed by root user on the server.
Besides, sqlite3 2.1.0 can be successfully installed using package.json.

Comment 3 John Poelstra 2012-07-31 17:15:57 UTC
discussing with Ram, expect to fix today

Comment 4 Mrunal Patel 2012-08-01 01:19:39 UTC
Ram and I spent a lot of time looking into this today.

This will be fixed as part of move to nodejs-0.8. 

Till then, there are two options:
1. Use a version that works (2.1.0 for sqlite3)
 
2. Or use this workaround -
   - First add node-gyp to package.json
   - git push
   - Next, ssh into the app and run $OPENSHIFT_REPO_DIR/node_modules/.bin/node-gyp rebuild (You will see some exceptions that can be ignored)
   - Now, you can add sqlite3 to package.json and git push and it should get installed

Thanks,
Mrunal

Comment 5 jizhao 2012-08-01 07:23:01 UTC
According to comment 4, verify this bug.