Bug 1020553

Summary: nodejs-0.10 apps are using global modules linked to system nodejs
Product: OpenShift Online Reporter: Jason DeTiberus <jdetiber>
Component: ContainersAssignee: Mrunal Patel <mpatel>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, jhonce, mpatel, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:25:08 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:

Description Jason DeTiberus 2013-10-17 22:14:47 UTC
Description of problem:
The invocation of npm link in bin/install is being run from the system context and not the SCL context when needed.

How reproducible:
Every time

Steps to Reproduce:
1. rhc app create nodejs nodejs-0.10
2. rhc app ssh nodejs
3. ls -l nodejs/node_modules/

Actual results:
Symlinks are pointing to system nodejs libs (/usr/lib/node_modules)

Expected results:
Symlinks should be pointing to SCL nodejs libs (/opt/rh/nodejs010/root/usr/lib/node_modules)

Additional info:
I created https://github.com/openshift/origin-server/pull/3924 to fix the nodejs cartridge, but a migration will need to be created for existing applications.

Comment 1 Fotios Lindiakos 2013-10-18 15:13:51 UTC
Working with Jason on the PR

Comment 2 Mrunal Patel 2013-10-29 02:47:49 UTC
https://github.com/openshift/origin-server/pull/4021

Note to QE: Please test migration as well for this bug.

Comment 3 Yan Du 2013-10-29 11:30:45 UTC
test on devenv_3960, 

1. For new app, Symlinks points to SCL nodejs libs (/opt/rh/nodejs010/root/usr/lib/node_modules)

2. For the old app after migration(devenv_stage ---> devenv_3959), there is no modules existed in nodejs/node_modules/

[n10-wsunmi2.dev.rhcloud.com 526f96618d8cea7403000059]\>  ls -l nodejs/node_modules/
total 0
[n10-wsunmi2.dev.rhcloud.com 526f96618d8cea7403000059]\>

Comment 4 Mrunal Patel 2013-10-29 22:26:27 UTC
https://github.com/openshift/li/pull/2061

Yan Du,
Please test running the migration again after running it the first time to make sure it is re-entrant.

Also, you need to pass the --ignore-cartride-version flag, since the versions haven't been bumped up for this release yet.

Thanks,
Mrunal

Comment 5 openshift-github-bot 2013-10-30 00:23:32 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/a89d597a6d0b02234cb5d76e19411a4f1db20e59
Bug 1020553: Fix for handling the nodejs dependencies during the upgrade.

Comment 6 Yan Du 2013-10-30 04:59:12 UTC
Upgrade devenv_stage_528 to devenv_3966

After migration, Symlinks points to SCL nodejs libs (/opt/rh/nodejs010/root/usr/lib/node_modules) for old nodejs-0.10 app too.

[n10-dym.dev.rhcloud.com 52707bdfd8e8a76844000023]\> ls -l nodejs/node_modules/
total 0
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 49 Oct 29 23:56 async -> /opt/rh/nodejs010/root/usr/lib/node_modules/async
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 51 Oct 29 23:56 connect -> /opt/rh/nodejs010/root/usr/lib/node_modules/connect
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 51 Oct 29 23:56 express -> /opt/rh/nodejs010/root/usr/lib/node_modules/express
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 54 Oct 29 23:56 formidable -> /opt/rh/nodejs010/root/usr/lib/node_modules/formidable
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 56 Oct 29 23:56 generic-pool -> /opt/rh/nodejs010/root/usr/lib/node_modules/generic-pool
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 48 Oct 29 23:56 mime -> /opt/rh/nodejs010/root/usr/lib/node_modules/mime
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 50 Oct 29 23:56 mkdirp -> /opt/rh/nodejs010/root/usr/lib/node_modules/mkdirp
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 51 Oct 29 23:56 mongodb -> /opt/rh/nodejs010/root/usr/lib/node_modules/mongodb
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 49 Oct 29 23:56 mysql -> /opt/rh/nodejs010/root/usr/lib/node_modules/mysql
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 55 Oct 29 23:56 node-static -> /opt/rh/nodejs010/root/usr/lib/node_modules/node-static
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 46 Oct 29 23:56 pg -> /opt/rh/nodejs010/root/usr/lib/node_modules/pg
lrwxrwxrwx. 1 52707bdfd8e8a76844000023 52707bdfd8e8a76844000023 46 Oct 29 23:56 qs -> /opt/rh/nodejs010/root/usr/lib/node_modules/qs


move bug to verified.

Comment 7 Yan Du 2013-10-30 05:38:09 UTC
Run the upgrade script twice and check the apps again, symlinks still points to SCL nodejs libs(/opt/rh/nodejs010/root/usr/lib/node_modules).