This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
copy-node-modules.sh fails on Linux during LMS provisioning due to permission error #1138
Closed
4 tasks done
Developers with a previous devstack installation cannot re-provision due to file permission issues.
This has only been observed on Linux; it may or may not occur on Mac, since we've observed inconsistent behavior in whether files end up as root-owned there.
Acceptance criteria
Symptoms
When the provisioning script runs
npm ci
, npm ends up running the postinstall scriptscripts/copy-node-modules.sh
(as of PR openedx/edx-platform#32767). On Linux, this fails with the following:Cause
The files in
common/static/common/css/vendor
are owned by the userroot
, whereas the script is running as the userapp
(as determined by adding a call towhoami
.) This still happens if I just runnpm install
from insidemake lms-shell
-- even though I'm running that command as root, by default.npm performs this change-of-user for all of its scripts, with no apparent workaround:
As far as I can tell, there's no workaround (see npm/rfcs#546) so maybe we can just switch to calling the script explicitly after the
npm ci
call completes.Workaround
In edx-platform:
(More thorough version that will also clear out root-owned pycache files that keep cropping up:
sudo find -user 0 -group 0 -prune -exec rm -rf '{}' \;
)Once this is done,
npm install
inside lms-shell will succeed, and the re-created files in those directories will have the UID and GID of the desktop user.The text was updated successfully, but these errors were encountered: