yukimochi / Activity-Relay

Yet another powerful customizable ActivityPub relay server written in Go.
https://relay.toot.yukimochi.jp/
GNU Affero General Public License v3.0
279 stars 39 forks source link

Dockerによる起動に失敗する #42

Closed MitarashiDango closed 3 years ago

MitarashiDango commented 3 years ago

事象

Dockerによる初回起動時に以下エラーを出力し、起動に失敗します。

go: github.com/RichardKnop/machinery@v1.7.8: missing go.sum entry; to add it:
    go mod download github.com/RichardKnop/machinery
ERROR: Service 'worker' failed to build: The command '/bin/sh -c mkdir -p /rootfs/usr/bin &&      apk add -U --no-cache git &&      go build -o /rootfs/usr/bin/server -ldflags "-X main.version=$(git describe --tags HEAD)" . &&      go build -o /rootfs/usr/bin/worker -ldflags "-X main.version=$(git describe --tags HEAD)"  ./worker &&      go build -o /rootfs/usr/bin/ar-cli -ldflags "-X main.version=$(git describe --tags HEAD)"  ./cli' returned a non-zero code: 1

推測される原因

Go 1.16以降ではgo.modまたはgo.sumの自動修正が行われないため、依存モジュールの解決に失敗しているものと推測されます。

参考: https://blog.golang.org/go116-module-changes ※「No automatic changes to go.mod and go.sum」を参照ください。

yukimochi commented 3 years ago

docker pull じゃなくて、 build された感じですよね。 ライブラリバージョン上げて、バージョン切ろうかな…。

rsesot commented 3 years ago

私もこのミスに遭いました。どう解決すればいいですか?

yukimochi commented 3 years ago

さしあたり、 Go 1.13 を指定するように Dockerfile 一行目を FROM golang:1.13-alpine AS build と置換していただけるとビルドが可能です。 Go 1.13 が最終確認バージョンとなります。 Go 1.16 の動作確認等については、時間をいただいています。

rsesot commented 3 years ago

えっと、すみません、RSAで問題が発生しました。解決しました。

rsesot commented 3 years ago

ログ出力は正常ですが、今はヒント502のエラーを開けられません。 https://relay.neko.ci/

rsesot commented 3 years ago

LOG: Config file is not exists. Use environment variables. Welcome to YUKIMOCHI Activity-Relay [Server] v0.2.8

Welcome to YUKIMOCHI Activity-Relay [Worker] v0.2.8

1:C 29 Mar 2021 16:19:56.113 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 1:C 29 Mar 2021 16:19:56.113 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started 1:C 29 Mar 2021 16:19:56.113 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf 1:M 29 Mar 2021 16:19:56.114 monotonic clock: POSIX clock_gettime 1:M 29 Mar 2021 16:19:56.115 Running mode=standalone, port=6379. 1:M 29 Mar 2021 16:19:56.115 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 1:M 29 Mar 2021 16:19:56.115 # Server initialized 1:M 29 Mar 2021 16:19:56.116 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 1:M 29 Mar 2021 16:19:56.116 Loading RDB produced by version 6.2.1 1:M 29 Mar 2021 16:19:56.116 RDB age 8 seconds 1:M 29 Mar 2021 16:19:56.116 RDB memory usage when created 0.77 Mb 1:M 29 Mar 2021 16:19:56.116 DB loaded from disk: 0.000 seconds 1:M 29 Mar 2021 16:19:56.116 * Ready to accept connections

yukimochi commented 3 years ago

この issue とは関係ない問題と思いますので、別途問題があれば報告ください。

502 エラーについては、あなたのリバースプロキシの仕様に大きく影響しますので、原因の特定は困難です。 なお、 Docker において Bind アドレスに 127.0.0.1 は Docker のネットワーク構造について詳しく理解していないなら推奨しません。 0.0.0.0 で Bind されることを推奨します。

yukimochi commented 3 years ago

v0.2.9 において、 Go 1.16 をサポートしました。