pelias / spatial

ALPHA: geographic data service backed by spatialite
https://spatial.demo.geocode.earth
29 stars 6 forks source link

glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] #77

Open missinglink opened 2 years ago

missinglink commented 2 years ago

cc/ @Joxit are you seeing this too?

duplicated here, although I'm not convinced its an issue with the baseimage: https://github.com/pelias/docker-baseimage/issues/25

docker pull pelias/spatial:latest
docker run --rm -it \
  --entrypoint=npm \
  pelias/spatial \
  run env_check
> pelias-spatial@0.0.0-development env_check
> ./bin/env_check

glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /root/.npm/_cacache/tmp
npm ERR! errno EACCES
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 1000:1000 "/root/.npm"
Joxit commented 2 years ago

Yes I have this one too ! But since it's only for logs, I thought there was no need to worry about it.

I didn't understand why this is happening since the user is root at docker build... and the folder /root/.npm seems to exists :shrug:

Joxit commented 2 years ago

Oh, my bad, I thought you were talking about build time !

So yes I have the same issue on a fresh image... Even tests are not working...

Joxit commented 2 years ago

Okay, this is a nonsense, since they said the issue is caused because we are root... I tried with the user pelias. Here is the prompt:

docker run --rm -it   --entrypoint=npm  --user pelias pelias/spatial   run env_check
> pelias-spatial@0.0.0-development env_check
> ./bin/env_check

Need to install the following packages:
  tap
Ok to proceed? (y) 

This means the real error is hidden when we are logged as root (tap is missing). And as pelias user, we cannot install tap because all files are owned by root :sweat: (tap is missing because we used --production
So IMO there is no need to worry about this one :sweat_smile: .