Hide Forgot
A user reported problems doing a git push to an old nodejs-0.6 app. I looked at his gear and found that the the rsync from app-deployments/<timestamp>/dependencies/ to app-root/runtime/dependencies/ because there were root-owned symlinks in nodejs/node_modules/ and rsync was trying to make the ownership match the deployment directory's links. I compared his gear to various other nodejs gears on the same node, and I found that old gears have these links owned by root, while in newer gears, they are owned by the user. I suspect that many other users with old nodejs apps (created before June 6th or so) have this same problem, and we just haven't heard from many of them yet. The workaround is to simply delete the root-owned symlinks and do another git push. It seems like it would be fairly straightforward to add this to a gear migration script, but it's worth mentioning that doing a chown as root did not work (maybe due to selinux policy of some sort?); I had to remove the links and repopulate them.
https://github.com/openshift/li/pull/2222
Commit pushed to master at https://github.com/openshift/li https://github.com/openshift/li/commit/3b70512681c28bdd451bf308beaceb032df11890 Bug 1039726: Fix ownership of files in deployments dirs during upgrade
Commit pushed to master at https://github.com/openshift/li https://github.com/openshift/li/commit/fb1563dfb101080a9c449d5464aaafbf99c57aeb Bug 1039726: Fix ownership of files in deployments dirs during upgrade
Manually change the owner and the selinux label for the nodejs app to simulate the issue. [root@ip-10-45-150-206 runtime]# ls -Zd build-dependencies dependencies drwxr-x---. root root system_u:object_r:openshift_var_lib_t:s0 build-dependencies drwxr-x---. root root system_u:object_r:openshift_var_lib_t:s0 dependencies After upgrade to devenv_4120 (where the fix merged), and migrate the gears. The ownership issue has been fixed. [root@ip-10-45-150-206 runtime]# ls -Zd build-dependencies dependencies drwxr-x---. 52a8074851549dbc38000052 52a8074851549dbc38000052 system_u:object_r:openshift_var_lib_t:s0:c0,c1002 build-dependencies drwxr-x---. 52a8074851549dbc38000052 52a8074851549dbc38000052 system_u:object_r:openshift_var_lib_t:s0:c0,c1002 dependencies Will move the bug to verified once the fix is merged into stage branch.
For the symlink part, Before upgrade: [root@ip-10-45-150-206 nodejs]# ls -Z node_modules lrwxrwxrwx. root root unconfined_u:object_r:openshift_var_lib_t:s0 node_modules -> /var/lib/openshift/52a8074851549dbc38000052/app-root/runtime/dependencies/nodejs/node_modules After upgrade: [root@ip-10-45-150-206 nodejs]# ls -Z node_modules lrwxrwxrwx. 52a8074851549dbc38000052 52a8074851549dbc38000052 system_u:object_r:openshift_var_lib_t:s0:c0,c1002 node_modules -> /var/lib/openshift/52a8074851549dbc38000052/app-root/runtime/dependencies/nodejs/node_modules
@dan Will this fix pulled to STAGE for sprint37? I found there are two PRs for this fix on STG, but did not get the ami which contains the PRs.
Meng, It didn't make the stage cut, so we'll be applying the patch manually later on.
The fix has been merged into devenv-stage_613 Checked on devnev-stage_613, issue has been fixed. After migrate, the owner_ship has been updated lrwxrwxrwx. 52aa9f60931fa01f34000007 52aa9f60931fa01f34000007 system_u:object_r:openshift_var_lib_t:s0:c0,c1000 node_modules -> /var/lib/openshift/52aa9f60931fa01f34000007/app-root/runtime/dependencies/nodejs/node_modules