質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

Mastodon

Mastodon(マストドン)は、短文投稿型SNS。サービス利用のための仮想サーバー「インスタンス」が多く存在し、サーバが一つのTwitterと比較して分散型SNSと呼ばれています。また閲覧注意ボタンがあり、タイムラインが3つ用意されていることも特徴です。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Q&A

1回答

564閲覧

npm run start Exit1

shizuru0618

総合スコア15

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

Mastodon

Mastodon(マストドン)は、短文投稿型SNS。サービス利用のための仮想サーバー「インスタンス」が多く存在し、サーバが一つのTwitterと比較して分散型SNSと呼ばれています。また閲覧注意ボタンがあり、タイムラインが3つ用意されていることも特徴です。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

0グッド

0クリップ

投稿2017/08/11 04:50

編集2022/01/12 10:55

###前提・実現したいこと
"docker-compose ps"を実行したところ、エラーが出てしまいました。
このエラーの対応方法を教えてください。

###発生している問題・エラーメッセージ

# docker-compose ps Name Command State Ports ------------------------------------------------------------------------------------------------- 70ebcda47e80_70ebcda47 npm run start Exit 1 e80_70ebcda47e80_live_ streaming_1 live_db_1 docker-entrypoint.sh Up 5432/tcp postgres live_redis_1 docker-entrypoint.sh Up 6379/tcp redis ... live_sidekiq_1 bundle exec sidekiq -q Restarting def ... live_streaming_1 npm run start Exit 1 live_web_1 bundle exec rails s -p Up 0.0.0.0:3000->3000/tcp 300 ... , 4000/tcp

###該当のソースコード

ubuntu

1"docker-compose.yml"です。 2 3version: '2' 4services: 5 6 db: 7 restart: always 8 image: postgres:alpine 9### Uncomment to enable DB persistance 10 volumes: 11 - ./postgres:/var/lib/postgresql/data 12 13 redis: 14 restart: always 15 image: redis:alpine 16### Uncomment to enable REDIS persistance 17 volumes: 18 - ./redis:/data 19 20 web: 21 restart: always 22 build: . 23 image: gargron/mastodon 24 env_file: .env.production 25 command: bundle exec rails s -p 3000 -b '0.0.0.0' 26 ports: 27 - "3000:3000" 28 depends_on: 29 - db 30 - redis 31 volumes: 32 - ./public/assets:/mastodon/public/assets 33 - ./public/system:/mastodon/public/system 34 35 streaming: 36 restart: always 37 build: . 38 image: gargron/mastodon 39 env_file: .env.production 40 command: npm run start 41 ports: 42 - "4000:4000" 43 depends_on: 44 - db 45 - redis 46 47 sidekiq: 48 restart: always 49 build: . 50 image: gargron/mastodon 51 env_file: .env.production 52 command: bundle exec sidekiq -q default -q mailers -q pull -q push 53 depends_on: 54 - db 55 - redis 56 volumes: 57 - ./public/system:/mastodon/public/system

追記 "docker logs live_streaming_1"

> mastodon@ start /mastodon > babel-node ./streaming/index.js --presets es2015,stage-2 info Starting streaming API server on port 4000 events.js:160 throw er; // Unhandled 'error' event ^ Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) npm ERR! Linux 4.4.0-89-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "start" npm ERR! node v6.11.1 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! mastodon@ start: `babel-node ./streaming/index.js --presets es2015,stage-2` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mastodon@ start script 'babel-node ./streaming/index.js --presets es2015,stage-2'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the mastodon package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! babel-node ./streaming/index.js --presets es2015,stage-2 npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs mastodon npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls mastodon npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /mastodon/npm-debug.log

追記 "npm bugs mastodon"

npm ERR! Linux 4.4.0-91-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "bugs" "mastodon" npm ERR! node v4.8.4 npm ERR! npm v2.15.11 npm ERR! path xdg-open npm ERR! code ENOENT npm ERR! errno ENOENT npm ERR! syscall spawn xdg-open npm ERR! enoent spawn xdg-open ENOENT npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! /home/mastodon/live/npm-debug.log

追記 "cat npm-debug.log"

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'bugs', 'mastodon' ] 2 info using npm@2.15.11 3 info using node@v4.8.4 4 silly mapToRegistry name mastodon 5 silly mapToRegistry using default registry 6 silly mapToRegistry registry https://registry.npmjs.org/ 7 silly mapToRegistry data Result { 7 silly mapToRegistry raw: 'mastodon', 7 silly mapToRegistry scope: null, 7 silly mapToRegistry name: 'mastodon', 7 silly mapToRegistry rawSpec: '', 7 silly mapToRegistry spec: 'latest', 7 silly mapToRegistry type: 'tag' } 8 silly mapToRegistry uri https://registry.npmjs.org/mastodon 9 verbose request uri https://registry.npmjs.org/mastodon/latest 10 verbose request no auth needed 11 info attempt registry request try #1 at 08:05:04 12 verbose request id 0bc7c855893a2a19 13 http request GET https://registry.npmjs.org/mastodon/latest 14 http 200 https://registry.npmjs.org/mastodon/latest 15 verbose headers { server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)', 15 verbose headers etag: '"5RZ8EU19V8OYT4384IO6GJQ1U"', 15 verbose headers 'content-type': 'application/json', 15 verbose headers 'content-encoding': 'gzip', 15 verbose headers 'cache-control': 'max-age=300', 15 verbose headers 'content-length': '706', 15 verbose headers 'accept-ranges': 'bytes', 15 verbose headers date: 'Fri, 11 Aug 2017 23:05:04 GMT', 15 verbose headers via: '1.1 varnish', 15 verbose headers age: '0', 15 verbose headers connection: 'keep-alive', 15 verbose headers 'x-served-by': 'cache-nrt6134-NRT', 15 verbose headers 'x-cache': 'MISS', 15 verbose headers 'x-cache-hits': '0', 15 verbose headers 'x-timer': 'S1502492704.277999,VS0,VE494', 15 verbose headers vary: 'Accept-Encoding, Accept' } 16 silly get cb [ 200, 16 silly get { server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)', 16 silly get etag: '"5RZ8EU19V8OYT4384IO6GJQ1U"', 16 silly get 'content-type': 'application/json', 16 silly get 'content-encoding': 'gzip', 16 silly get 'cache-control': 'max-age=300', 16 silly get 'content-length': '706', 16 silly get 'accept-ranges': 'bytes', 16 silly get date: 'Fri, 11 Aug 2017 23:05:04 GMT', 16 silly get via: '1.1 varnish', 16 silly get age: '0', 16 silly get connection: 'keep-alive', 16 silly get 'x-served-by': 'cache-nrt6134-NRT', 16 silly get 'x-cache': 'MISS', 16 silly get 'x-cache-hits': '0', 16 silly get 'x-timer': 'S1502492704.277999,VS0,VE494', 16 silly get vary: 'Accept-Encoding, Accept' } ] 17 verbose get saving mastodon to /root/.npm/registry.npmjs.org/mastodon/latest/.cache.json 18 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing 19 silly bugs url https://github.com/jhayley/node-mastodon/issues 20 verbose stack Error: spawn xdg-open ENOENT 20 verbose stack at exports._errnoException (util.js:907:11) 20 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:189:32) 20 verbose stack at onErrorNT (internal/child_process.js:363:16) 20 verbose stack at nextTickCallbackWith2Args (node.js:511:9) 20 verbose stack at process._tickCallback (node.js:425:17) 21 verbose cwd /home/mastodon/live 22 error Linux 4.4.0-91-generic 23 error argv "/usr/bin/nodejs" "/usr/bin/npm" "bugs" "mastodon" 24 error node v4.8.4 25 error npm v2.15.11 26 error path xdg-open 27 error code ENOENT 28 error errno ENOENT 29 error syscall spawn xdg-open 30 error enoent spawn xdg-open ENOENT 30 error enoent This is most likely not a problem with npm itself 30 error enoent and is related to npm not being able to find a file. 31 verbose exit [ 1, true ]

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

一度
docker-compose down
で破棄してもう一度
docker-compose up
し直して見てください

投稿2017/08/11 04:54

momf

総合スコア416

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

momf

2017/08/11 04:57

というよりコンテナ被ってるっぽいんで 70ebcda47e80_70ebcda47e80_70ebcda47e80_live_streaming_1 こいつをストップさせてコンテナ消しましょう
shizuru0618

2017/08/11 05:08 編集

解答ありがとうございます。 もしよろしければコンテナのストップ・削除をするコマンドをお教えいただけないでしょうか。
momf

2017/08/11 05:08

docker rm コンテナ名 です docker stop 70ebcda47e80_70ebcda47e80_70ebcda47e80_live_streaming_1 でコンテナをストップさせて docker rm 70ebcda47e80_70ebcda47e80_70ebcda47e80_live_streaming_1 で削除してください
shizuru0618

2017/08/11 05:35

削除完了いたしました。 現在、エラーは下記の通りになっております。 -----↓エラー内容↓----- Name Command State Ports ------------------------------------------------------------------------------------------------- live_db_1 docker-entrypoint.sh postgres Up 5432/tcp live_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp live_sidekiq_1 bundle exec sidekiq -q def ... Restarting live_streaming_1 npm run start Exit 1 live_web_1 bundle exec rails s -p 300 ... Up 0.0.0.0:3000->3000/tcp, 4000/tcp -----↑エラー内容↑-----
shizuru0618

2017/08/11 05:37

見づらいので質問本文内へ追記いたしました
momf

2017/08/11 05:38

`docker-compose restart` してみてどうでしょう
shizuru0618

2017/08/11 05:45

エラーが出てしまいました。 こちら、本文内に追記しておりますのでご確認をお願いいたします。
momf

2017/08/11 05:48

.envが適切に設定されていますか?
shizuru0618

2017/08/11 05:54

.env.productionの内容を追記いたしました。 よろしくお願いいたします。
momf

2017/08/11 06:06

# Application secrets のところは書かれてないようですが設定されてますか? 記述はしなくていいですから、3つのキーがあったはずです。
shizuru0618

2017/08/11 06:26

PAPERCLIP_SECRET、SECRET_KEY_BASE、OTP_SECRETの3つが記載されていました。
momf

2017/08/11 06:33

それらは生成してちゃんと設定しましたか?
shizuru0618

2017/08/11 06:37

"docker-compose run --rm web rake secret"で生成し、設定いたしました。
momf

2017/08/11 06:39

データベースの初期化等やアセットのプリコンパイルもしましたよね? 公式通りの手順で、こちらではstreamingがエラーを吐くような現象は見れませんでした。
shizuru0618

2017/08/11 06:48

https://www.conoha.jp/guide/mastodonconoha.php” 上記の手順を参考に構築致しました。 上記の手順に加え、先程の手順とストレージの設定、3000なしでの接続等の設定を行いました。 今回のエラーなのですが、完成時にはなかったものですがUbuntuの「システムの再起動が必要です」との表示に従いシステムの再起動を行ったところ、それ以降エラーが発生するようになってしまいました。 本文内の説明が不足してしまい申し訳ありません。
momf

2017/08/11 06:52

`docker logs live_streaming_1` で何かしらログが見れるかもしれないので実行してみてください
shizuru0618

2017/08/11 06:59

何度もご回答いただきありがとうございます。 エラーが確認できましたので追記しております。
momf

2017/08/11 07:03

redisのコンテナに接続出来ないっぽいです。 コンテナのポート6379を解放した方がいいかもしれません。
momf

2017/08/11 07:07

確認したところ私の方では.yamlにポート開放書いてないので記述はいらないかも知れません…
shizuru0618

2017/08/11 12:04

ありがとうございます。 とりあえずポート開放してみようと思い、 色々調べてみたのですが、ポートの解放方法がわかりませんでした。 ポートの解放方法について、もしよろしければお教えいただけないでしょうか。
shizuru0618

2017/08/11 23:21

参考になるかわからないのですが、エラーのログを追記致しました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問