Bug 2026615

Summary: Missing execute permissions node-gyp
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: nodejsAssignee: NodeJS Packaging SIG <nodejs-sig>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: mrunge, nodejs-sig, sgallagh, thrcka, zsvetlik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nodejs-16.13.0-3.fc35 nodejs-16-3420211129215925.058368ca nodejs-16-3520211129215925.f27b74a8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-07 02:06:10 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 Honza Horak 2021-11-25 10:23:46 UTC
This bug was initially created as a copy of Bug #1647239

I am copying this bug because: 
This issue came back with the latest builds:

#> ls -l /usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp
-rw-r--r--. 1 root root 51 Oct 12 03:52 /usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp

#> rpm -qf /usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp
npm-8.0.0-1.16.11.1.1.fc35.x86_64


Description of problem:
Script files in the bin directories are missing execute permissions, which in turn causes build failures on some packages that require some building (like unix-dgram).  The following need to be made executable for things to work again:

/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp
/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js


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

How reproducible:
100%

Steps to Reproduce:
1. Try and install unix-dgram with factor NPM
2. Notice it fails to compile because these scripts 

Actual results:
% npm install

> unix-dgram.2 install /home/stieg/Devel/airfordable/test/node_modules/unix-dgram
> node-gyp rebuild

sh: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp: Permission denied
npm WARN test.0 No repository field.


Expected results:
DGram builds as expected

Workaround:
$ sudo chmod 755 /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js

Comment 1 Honza Horak 2021-11-25 10:25:03 UTC
It results in some gyp-built extensions to fail to install:

#> npm install -g node-rdkafka
npm notice 
npm notice New minor version of npm available! 8.0.0 -> 8.1.4
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.4
npm notice Run npm install -g npm.4 to update!
npm notice 
npm ERR! code 126
npm ERR! path /usr/local/lib/node_modules/node-rdkafka
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! sh: line 1: /usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp: Permission denied

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-11-25T10_24_14_089Z-debug.log

Comment 2 Honza Horak 2021-11-25 11:47:43 UTC
Modules in Fedora have the same issue it seems, so, please, do not forget to fix them as well.

Comment 3 Honza Horak 2021-11-25 11:50:49 UTC
It seems to be fixed in RHEL9/CentOS Stream 9: https://gitlab.com/redhat/centos-stream/rpms/nodejs/-/blob/c9s/nodejs.spec#L570

Comment 4 Honza Horak 2021-11-25 11:58:00 UTC
PR prepared for rawhide:
https://src.fedoraproject.org/rpms/nodejs/pull-request/11

Please, apply to other branches as well.

Comment 5 Fedora Update System 2021-11-30 15:20:57 UTC
FEDORA-MODULAR-2021-9289924978 has been submitted as an update to Fedora 35 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2021-9289924978

Comment 6 Fedora Update System 2021-11-30 15:21:03 UTC
FEDORA-2021-c5617f9f9c has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-c5617f9f9c

Comment 7 Fedora Update System 2021-11-30 15:21:04 UTC
FEDORA-MODULAR-2021-c0be60569a has been submitted as an update to Fedora 34 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2021-c0be60569a

Comment 8 Fedora Update System 2021-12-01 01:36:59 UTC
FEDORA-2021-c5617f9f9c has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-c5617f9f9c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-c5617f9f9c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2021-12-01 02:06:05 UTC
FEDORA-MODULAR-2021-9289924978 has been pushed to the Fedora 35 Modular testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2021-9289924978

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2021-12-01 02:07:51 UTC
FEDORA-MODULAR-2021-c0be60569a has been pushed to the Fedora 34 Modular testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2021-c0be60569a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2021-12-07 02:06:10 UTC
FEDORA-2021-c5617f9f9c has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2021-12-09 02:05:57 UTC
FEDORA-MODULAR-2021-c0be60569a has been pushed to the Fedora 34 Modular stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2021-12-09 02:07:38 UTC
FEDORA-MODULAR-2021-9289924978 has been pushed to the Fedora 35 Modular stable repository.
If problem still persists, please make note of it in this bug report.