jdx/npm-register

Permission denied when trying to create /data/tarballs

holms opened this issue · 0 comments

holms commented

I'm trying to publish a package and getting this

tools_npm.1.whkypkqjgih1@swarm-slave-0    | Writing /data/tarballs/mycompany-shared-lib/mycompany-shared-lib-1.0.7/a5cac9957cf7a0a50d8ca12585d512c73d46cd60.tgz
tools_npm.1.whkypkqjgih1@swarm-slave-0    | logging error with Opbeat: { uuid: '160df887-0d44-414f-b936-531db0a48216' }
tools_npm.1.whkypkqjgih1@swarm-slave-0    | Error: EACCES: permission denied, mkdir '/data/tarballs'
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at Object.fs.mkdirSync (fs.js:885:18)
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at mkdirsSync (/srv/npm-register/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at mkdirsSync (/srv/npm-register/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:37:16)
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at Object.mkdirsSync (/srv/npm-register/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:37:16)
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at FS.put (/srv/npm-register/lib/storage/fs.js:39:8)
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at /srv/npm-register/lib/routes/publish.js:44:28
tools_npm.1.whkypkqjgih1@swarm-slave-0    |     at <anonymous>
tools_npm.1.whkypkqjgih1@swarm-slave-0    | measure#request=807ms method=PUT user-agent="npm/6.1.0 node/v9.8.0 linux x64" status=500 path=/mycompany-shared-lib request_id=0.8045424039751896

My docker-compose.yml:

version: '3.6'
services:

    npm:
        image: holms/npm-register:latest
        volumes:
          - npm:/data
        environment:
          NPM_REGISTER_AUTH_WRITE: 1
          NPM_REGISTER_AUTH_READ: 1
        secrets:
          - source: npm-register
            target: /data/htpasswd

secrets:
  npm-register:
    file: ./secrets/npm-register.txt

volumes:
    npm: