gobengo / distbin

distributed social pastebin using Activitypub
https://distbin.com
Apache License 2.0
78 stars 8 forks source link

docker won't start #22

Closed JOduMonT closed 5 years ago

JOduMonT commented 5 years ago

I'm might be too enthusiasm but when I try to run distbin from docker pull gobengo/distbin

I have this error

Starting with UID : 9001 useradd: user 'distbin' already exists

distbin@1.0.0 start /home/distbin/app node ./dist/bin/server

Uncaught Error in runServer { Error: EACCES: permission denied, mkdir '/distbin-db/activities' errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/distbin-db/activities' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! distbin@1.0.0 start: node ./dist/bin/server npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the distbin@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/distbin/.npm/_logs/2019-03-13T16_10_05_657Z-debug.log

where log/2019-03-13T16_14_45_776Z-debug.log is

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle distbin@1.0.0~prestart: distbin@1.0.0
6 info lifecycle distbin@1.0.0~start: distbin@1.0.0
7 verbose lifecycle distbin@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle distbin@1.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/distbin/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle distbin@1.0.0~start: CWD: /home/distbin/app
10 silly lifecycle distbin@1.0.0~start: Args: [ '-c', 'node ./dist/bin/server' ]
11 silly lifecycle distbin@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle distbin@1.0.0~start: Failed to exec start script
13 verbose stack Error: distbin@1.0.0 start: `node ./dist/bin/server`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid distbin@1.0.0
15 verbose cwd /home/distbin/app
16 verbose Linux 4.19.0-0.bpo.2-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v8.11.2
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error distbin@1.0.0 start: `node ./dist/bin/server`
22 error Exit status 1
23 error Failed at the distbin@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
gobengo commented 5 years ago

when I try to run distbin from docker pull gobengo/distbin

I don't believe docker pull runs containers. You must have executed docker run at some point?

You might find this useful. https://github.com/gobengo/distbin/issues/14#issuecomment-422154232

Unless stated otherwise, docker images on my personal account (e.g. gobengo/distbin) aren't intended to be easy to use for others.

Distbin reads/writes activities from the filesystem. Inside the Dockerfile it defaults to /distbin-db. Distbin relies on a certain file structure inside of there, including ./activities/. It's trying to create /distbin-db/activities and getting EACCESS. This could be:

gobengo commented 5 years ago

You can now do

docker run -p 8000:80 gobengo/distbin