l3tnun / docker-mirakurun-epgstation

Mirakurun + EPGStation on Docker
MIT License
186 stars 97 forks source link

epgstationがRestartを繰り返す #13

Closed lynlea2501 closed 4 years ago

lynlea2501 commented 4 years ago

環境

Issue

Readme.md に従い docker-mirakurun-epgstation を起動しましたが epgstation が Restart を繰り返し起動されません。 最近追加された mirakurun のwebページは見られます。

起動

$ git clone https://github.com/l3tnun/docker-mirakurun-epgstation.git
$ cd docker-mirakurun-epgstation
$ cp docker-compose-sample.yml docker-compose.yml
$ cp epgstation/config/config.sample.json epgstation/config/config.json

$ sudo docker-compose pull
$ sudo docker-compose build
$ docker-compose up -d
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                         PORTS                                              NAMES
ada154ef7218        docker-mirakurun-epgstation_epgstation   "npm start"              13 seconds ago      Restarting (1) 2 seconds ago                                                      docker-mirakurun-epgstation_epgstation_1
f53f83322986        chinachu/mirakurun                       "docker-entrypoint.s…"   13 seconds ago      Up 12 seconds                  0.0.0.0:9229->9229/tcp, 0.0.0.0:40772->40772/tcp   docker-mirakurun-epgstation_mirakurun_1
180776ddd31a        mariadb:10.4                             "docker-entrypoint.s…"   13 seconds ago      Up 12 seconds                  3306/tcp                                           docker-mirakurun-epgstation_mysql_1

docker logs

$ docker logs ada154
> EPGStation@1.6.9 start /app
> node dist/server/index.js

[2020-06-30T05:33:08.767] [WARN] system - reserves.json is not found.
[2020-06-30T05:33:08.774] [INFO] system - wait mirakurun
[2020-06-30T05:33:09.778] [INFO] system - wait mirakurun
[2020-06-30T05:33:10.829] [WARN] system - dbinfo.json is not found.
[2020-06-30T05:33:10.833] [FATAL] system - DB table is missing.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! EPGStation@1.6.9 start: `node dist/server/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the EPGStation@1.6.9 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!     /root/.npm/_logs/2020-06-29T20_33_10_840Z-debug.log

...

/root/.npm/_logs/2020-06-29T20_33_10_840Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.14.4
3 info using node@v12.18.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle EPGStation@1.6.9~prestart: EPGStation@1.6.9
6 info lifecycle EPGStation@1.6.9~start: EPGStation@1.6.9
7 verbose lifecycle EPGStation@1.6.9~start: unsafe-perm in lifecycle true
8 verbose lifecycle EPGStation@1.6.9~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle EPGStation@1.6.9~start: CWD: /app
10 silly lifecycle EPGStation@1.6.9~start: Args: [ '-c', 'node dist/server/index.js' ]
11 silly lifecycle EPGStation@1.6.9~start: Returned: code: 1  signal: null
12 info lifecycle EPGStation@1.6.9~start: Failed to exec start script
13 verbose stack Error: EPGStation@1.6.9 start: `node dist/server/index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid EPGStation@1.6.9
15 verbose cwd /app
16 verbose Linux 5.4.0-39-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v12.18.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error EPGStation@1.6.9 start: `node dist/server/index.js`
22 error Exit status 1
23 error Failed at the EPGStation@1.6.9 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
l3tnun commented 4 years ago

[2020-06-30T05:33:10.833] [FATAL] system - DB table is missing.

データベースが壊れている or dbinfo.json が無いことによるデータベースの整合性エラーのようです。

問題がなければ data volume の mysql-db を削除して再度起動してみてください。

lynlea2501 commented 4 years ago

以下のように、mysql-dbのコメントアウトで対応できました。 ありがとうございました。

--- docker-compose-sample.yml   2020-06-30 14:55:40.390256372 +0900
+++ docker-compose.yml  2020-06-30 18:50:46.742144768 +0900
@@ -26,7 +26,7 @@ services:
     mysql:
         image: mariadb:10.4
         volumes:
-            - mysql-db:/var/lib/mysql
+            - ./mariadb/data:/var/lib/mysql
         environment:
             MYSQL_USER: epgstation
             MYSQL_PASSWORD: epgstation
@@ -63,7 +63,7 @@ services:
         #user: "1000:1000"
         restart: always

-volumes:
-    mysql-db:
-        driver: local
+#volumes:
+#    mysql-db:
+#        driver: local
5ym commented 4 years ago

dockerのローカルボリューム使うとdocker-compose down -vとかdocker-compose downしたあとにpruneしたりするとボリュームも消えちゃうんでディレクトリにして.gitignoreするのをありかもしれないです

l3tnun commented 4 years ago

そこコメントアウトしちゃ駄目なやつです。 docker の data volume でデータを永続化させていますので。 data volumeの中身をクリアして再起動しましょう。