Bug 1020553 - nodejs-0.10 apps are using global modules linked to system nodejs
nodejs-0.10 apps are using global modules linked to system nodejs
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-17 18:14 EDT by Jason DeTiberus
Modified: 2015-05-14 19:30 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 22:25:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jason DeTiberus 2013-10-17 18:14:47 EDT
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 11:13:51 EDT
Working with Jason on the PR
Comment 2 Mrunal Patel 2013-10-28 22:47:49 EDT
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 07:30:45 EDT
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 18:26:27 EDT
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-29 20:23:32 EDT
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 00:59:12 EDT
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 01:38:09 EDT
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).

Note You need to log in before you can comment on or make changes to this bug.