Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 625982 - net-libs/nodejs-8.2.1 : sandbox issue (XDG_xxx_DIR related)
Summary: net-libs/nodejs-8.2.1 : sandbox issue (XDG_xxx_DIR related)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
: 697070 (view as bug list)
Depends on:
Blocks: 567192
  Show dependency tree
 
Reported: 2017-07-23 11:11 UTC by Toralf Förster
Modified: 2020-11-09 13:01 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,16.32 KB, text/plain)
2017-07-23 11:11 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,282.69 KB, text/plain)
2017-07-23 11:11 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,23.69 KB, application/x-bzip)
2017-07-23 11:11 UTC, Toralf Förster
Details
net-libs:nodejs-8.2.1:20170722-192945.log.bz2 (net-libs:nodejs-8.2.1:20170722-192945.log.bz2,32.28 KB, application/x-bzip)
2017-07-23 11:11 UTC, Toralf Förster
Details
sandbox-7145.log (sandbox-7145.log,343 bytes, text/plain)
2017-07-23 11:11 UTC, Toralf Förster
Details
env|grep XDG (XDG_env_vars.txt,527 bytes, text/plain)
2019-03-05 07:46 UTC, ben.simons
Details
emerge --info (emerge--info.txt,5.95 KB, text/plain)
2019-03-05 07:47 UTC, ben.simons
Details
emerge --info nodejs (emerge--info_nodejs.txt,6.41 KB, text/plain)
2019-03-05 07:48 UTC, ben.simons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2017-07-23 11:11:05 UTC
This issue is forced at the tinderbox by making:

export XDG_DESKTOP_DIR="/root/Desktop"
export XDG_DOCUMENTS_DIR="/root/Documents"
export XDG_DOWNLOAD_DIR="/root/Downloads"
export XDG_MUSIC_DIR="/root/Music"
export XDG_PICTURES_DIR="/root/Pictures"
export XDG_PUBLICSHARE_DIR="/root/Public"
export XDG_TEMPLATES_DIR="/root/Templates"
export XDG_VIDEOS_DIR="/root/Videos"
export XDG_RUNTIME_DIR="/root/run"
export XDG_CONFIG_HOME="/root/config"
export XDG_CACHE_HOME="/root/cache"
export XDG_DATA_HOME="/root/share"

pls see bug #567192 too

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: mkdir
S: deny

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 13.0_20170716-131855

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python3.6 (fallback)
  [3]   python3.5 (fallback)
  [4]   python2.7 (fallback)
  [5]   pypy3 (fallback)
  [6]   pypy (fallback)
Available Ruby profiles:
  [1]   ruby21 (with Rubygems) *
  [2]   ruby22 (with Rubygems)
Comment 1 Toralf Förster gentoo-dev 2017-07-23 11:11:08 UTC
Created attachment 486510 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-07-23 11:11:11 UTC
Created attachment 486512 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2017-07-23 11:11:14 UTC
Created attachment 486514 [details]
etc.portage.tbz2
Comment 4 Toralf Förster gentoo-dev 2017-07-23 11:11:17 UTC
Created attachment 486516 [details]
net-libs:nodejs-8.2.1:20170722-192945.log.bz2
Comment 5 Toralf Förster gentoo-dev 2017-07-23 11:11:21 UTC
Created attachment 486518 [details]
sandbox-7145.log
Comment 6 Jack 2017-11-22 18:08:39 UTC
I get a similar error with nodejs-8.9.1-r1 (~amd64) but it's failing trying to "mkdir /home/jack/.config/configstore" which does not exist.  As with the blocker bug, I did "su" not "su -" so that is similar.  However, it seems my problem occurs at the end of the install phase.  Manually doing "ebuild /path/to/ebuild qmerge completes the installation, with no further complaing.  Just before the access summary violation, it says "npm update check failed"

Shouldn't the nodejs ebuild sanitize or check where it is going to touch the file system, to check for this type of problem?  

If appropriate, I'll be glad to file this as a separate bug, or attach to this one the build log (which now includes the output of the qmerge phase.)
Comment 7 Joakim Tjernlund 2018-04-25 16:30:11 UTC
(In reply to Jack from comment #6)
> I get a similar error with nodejs-8.9.1-r1 (~amd64) but it's failing trying
> to "mkdir /home/jack/.config/configstore" which does not exist.  As with the
> blocker bug, I did "su" not "su -" so that is similar.  However, it seems my
> problem occurs at the end of the install phase.  Manually doing "ebuild
> /path/to/ebuild qmerge completes the installation, with no further
> complaing.  Just before the access summary violation, it says "npm update
> check failed"
> 
> Shouldn't the nodejs ebuild sanitize or check where it is going to touch the
> file system, to check for this type of problem?  
> 
> If appropriate, I'll be glad to file this as a separate bug, or attach to
> this one the build log (which now includes the output of the qmerge phase.)

I see this too with net-libs/nodejs-8.11.1 but the file is
"mkdir /root/.config/configstore"
Comment 8 Joakim Tjernlund 2018-09-14 12:50:56 UTC
(In reply to Joakim Tjernlund from comment #7)
> (In reply to Jack from comment #6)
> > I get a similar error with nodejs-8.9.1-r1 (~amd64) but it's failing trying
> > to "mkdir /home/jack/.config/configstore" which does not exist.  As with the
> > blocker bug, I did "su" not "su -" so that is similar.  However, it seems my
> > problem occurs at the end of the install phase.  Manually doing "ebuild
> > /path/to/ebuild qmerge completes the installation, with no further
> > complaing.  Just before the access summary violation, it says "npm update
> > check failed"
> > 
> > Shouldn't the nodejs ebuild sanitize or check where it is going to touch the
> > file system, to check for this type of problem?  
> > 
> > If appropriate, I'll be glad to file this as a separate bug, or attach to
> > this one the build log (which now includes the output of the qmerge phase.)
> 
> I see this too with net-libs/nodejs-8.11.1 but the file is
> "mkdir /root/.config/configstore"

net-libs/nodejs-8.12.0 get me:

* Skipping make test/check due to ebuild restriction.
  touch 234b69204d630a9d7ebaa9699ae08ec89b523cb1.intermediate
  LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/src/inspector/protocol /var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
 * PT_PAX marking -m /var/tmp/portage/net-libs/nodejs-8.12.0/image/usr/bin/node with paxctl
 * PT_PAX marking -m /var/tmp/portage/net-libs/nodejs-8.12.0/image/usr/bin/node with scanelf
 * XATTR_PAX marking -me /var/tmp/portage/net-libs/nodejs-8.12.0/image/usr/bin/node with setfattr
 * ACCESS DENIED:  mkdir:        /root/.config/configstore

┌───────────────────────────────────────────────────┐
│              npm update check failed              │
│        Try running with sudo or get access        │
│       to the local update config store via        │
│ sudo chown -R $USER:$(id -gn $USER) /root/.config │
└───────────────────────────────────────────────────┘
 * Final size of build directory: 303404 KiB (296.2 MiB)
 * Final size of installed tree:   40072 KiB ( 39.1 MiB)
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-4955.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: mkdir
S: deny
P: /root/.config/configstore
A: /root/.config/configstore
R: /root/.config/configstore
C: npm
Comment 9 Joakim Tjernlund 2018-09-14 12:54:04 UTC
and a doing ebuild /usr/portage/net-libs/nodejs/nodejs-8.12.0.ebuild qmerge
will merge the pkg without issues
Comment 10 Joakim Tjernlund 2018-09-14 12:55:29 UTC
Maybe it depends on me doing ssh root@machine-to-emerge first?
Comment 11 Sergey 'L29Ah' Alirzaev 2019-02-05 03:16:31 UTC
Still an issue as for net-libs/nodejs-11.8.0:
 * ACCESS DENIED:  mkdir:        /root/.config/configstore
Comment 12 ben.simons 2019-03-05 07:46:55 UTC
Created attachment 567832 [details]
env|grep XDG

XDG_CONFIG_HOME is different for me
Comment 13 ben.simons 2019-03-05 07:47:35 UTC
Created attachment 567834 [details]
emerge --info

emerge --info > /tmp/emerge--info.txt
Comment 14 ben.simons 2019-03-05 07:48:55 UTC
Created attachment 567836 [details]
emerge --info nodejs

emerge --info net-libs/nodejs >/tmp/emerge--info_nodejs.txt
Comment 15 ben.simons 2019-03-05 08:06:17 UTC
Same Sandbox Access Violation for nodejs-8.12.0
which happens during npm update/install

Only seems to happen when $XDG_CONFIG_HOME is set
first doing: "unset XDG_CONFIG_HOME" then successfully installs

with XDG set this error occurs:

>>> Install nodejs-8.12.0 into /var/tmp/portage/net-libs/nodejs-8.12.0/image/ category net-libs
make -j20 install DESTDIR=/var/tmp/portage/net-libs/nodejs-8.12.0/image/ 
make -C out BUILDTYPE=Release V=1
  touch 234b69204d630a9d7ebaa9699ae08ec89b523cb1.intermediate
  LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/src/inspector/protocol /var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/var/tmp/portage/net-libs/nodejs-8.12.0/work/node-v8.12.0/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
rm 234b69204d630a9d7ebaa9699ae08ec89b523cb1.intermediate
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi
/usr/bin/python2.7 tools/install.py install '/var/tmp/portage/net-libs/nodejs-8.12.0/image/' '/usr'
 * PT_PAX marking -m /var/tmp/portage/net-libs/nodejs-8.12.0/image/usr/bin/node with scanelf
 * XATTR_PAX marking -me /var/tmp/portage/net-libs/nodejs-8.12.0/image/usr/bin/node with setfattr
 * ACCESS DENIED:  open_wr:      /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
 * ACCESS DENIED:  unlink:       /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432

┌───────────────────────────────────────────────────────────────┐
│                    npm update check failed                    │
│              Try running with sudo or get access              │
│             to the local update config store via              │
│ sudo chown -R $USER:$(id -gn $USER) /home/ben/.config.da-dev8 │
└───────────────────────────────────────────────────────────────┘
>>> Completed installing nodejs-8.12.0 into /var/tmp/portage/net-libs/nodejs-8.12.0/image/

 * Final size of build directory: 309828 KiB (302.5 MiB)
 * Final size of installed tree:   42736 KiB ( 41.7 MiB)

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-32697.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
A: /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
R: /mnt/central/home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
C: npm                                                                        

F: unlink
S: deny
P: /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
A: /home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
R: /mnt/central/home/ben/.config.da-dev8/configstore/update-notifier-npm.json.1691689432
C: npm                                                                        
 * --------------------------------------------------------------------------------


Doing these unsets, then allows nodejs to install ok

unset XDG_CONFIG_HOME XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_CONFIG_DIRS XDG_SESSION_COOKIE
emerge -v nodejs

then nodejs installs!
Comment 16 Jeroen Roovers (RETIRED) gentoo-dev 2019-10-11 14:35:28 UTC
*** Bug 697070 has been marked as a duplicate of this bug. ***
Comment 17 Larry the Git Cow gentoo-dev 2019-10-11 14:53:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73ee71f5b874d8ee6ebceccfca87b4fa7b82491c

commit 73ee71f5b874d8ee6ebceccfca87b4fa7b82491c
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2019-10-11 14:50:11 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2019-10-11 14:53:09 +0000

    net-libs/nodejs: Call xdg_environment_reset() from xdg-utils.eclass
    
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Bug: https://bugs.gentoo.org/625982
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 net-libs/nodejs/nodejs-10.16.3.ebuild  | 4 +++-
 net-libs/nodejs/nodejs-12.10.0.ebuild  | 4 +++-
 net-libs/nodejs/nodejs-12.11.1.ebuild  | 4 +++-
 net-libs/nodejs/nodejs-8.12.0.ebuild   | 4 +++-
 net-libs/nodejs/nodejs-8.16.1.ebuild   | 4 +++-
 net-libs/nodejs/nodejs-8.16.2.ebuild   | 4 +++-
 net-libs/nodejs/nodejs-99999999.ebuild | 4 +++-
 7 files changed, 21 insertions(+), 7 deletions(-)
Comment 18 Jeroen Roovers (RETIRED) gentoo-dev 2019-10-11 14:55:01 UTC
@Gidea Liviu-Adrian: Could you please test the change mentioned in comment #17 (like sync your portage tree and give the same ebuild a try)?
Comment 19 Arfrever Frehtes Taifersar Arahesis 2019-10-11 15:22:28 UTC
Calling xdg_environment_reset() is most likely unnecessary in these ebuilds which use EAPI="7" (i.e. 12.10.0, 12.11.1, 99999999).

ENV_UNSET is used for ebuilds which use EAPI="7":
https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/base/make.defaults?id=74a70dfd0bf7272858c9bb0af834691b6f331576#n25
As you can see, XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_RUNTIME_DIR are unset by ENV_UNSET functionality.
Comment 20 Marek Szuba archtester gentoo-dev 2020-11-09 13:01:01 UTC
No report of further problems since commit 73ee71f5b874d8ee6ebceccfca87b4fa7b82491c, closing as FIXED. Please reopen with updated information if this is still an issue.