アプリ再構築時のGitエラー - リモートリファレンス refs/heads/tests-passed が見つかりません

皆さん、こんにちは。

アプリを再構築すると、このエラーが発生します。

> Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse bash -c '
>   set -o errexit
>   if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
>       git remote set-branches --add origin main
>       git remote set-branches origin tests-passed
>       git fetch --depth 1 origin tests-passed
>   else
>       git fetch --tags --prune-tags --prune --force origin
>   fi
> ' failed with return #<Process::Status: pid 145 exit 128>

これを実行すると:

> git fetch --tags --prune-tags --prune --force origin

次のエラーが発生します。

> fatal: couldn't find remote ref refs/heads/tests-passed

何か間違っていますか?

よろしくお願いします!

追伸:言い忘れました。最初のチェックアウトはうまくいきましたが、再構築アプリタスクだけがこれで失敗します。したがって、私の側でのGitの問題ではないと思います(そう願っています :-))。

ログでさらに問題が見つかりました :frowning:

Updates successful. Rebuilding in 5 seconds.
Building app
x86_64 arch detected.
Ensuring launcher is up to date
fatal: couldn’t find remote ref refs/heads/tests-passed
fatal: upstream branch ‘refs/heads/main’ not stored as a remote-tracking branch
fatal: upstream branch ‘refs/heads/main’ not stored as a remote-tracking branch
./launcher: line 794: [: 69d7558c98a3775f62b720a8393e76f2b42bd916: unary operator expected
./launcher: line 797: [: 69d7558c98a3775f62b720a8393e76f2b42bd916: unary operator expected

コンテナを docker run -it --entrypoint /bin/bash .... で実行し、git を使おうとすると、以下のエラーが発生します。

git clone https://github.com/discourse/discourse.git/
Cloning into 'discourse'...
fatal: unable to access 'https://github.com/discourse/discourse.git/': server certificate verification failed. CAfile: none CRLfile: none

全文のログ出力を、フォーマット済みコードブロックで投稿していただけますか? それで助かります。

これは、アウトバウンドWebトラフィックをMITM(man-in-the-middle)で検査するプロキシを使用している企業ネットワークで行っていますか?

もしそうであれば、サーバー(およびDockerイメージ)がEnterprise CA Rootを信頼するように設定する必要があります。

まさにその通りです。
それを達成するために、Discourse Dockerに標準機能はありますか(サーバーではなく、Dockerイメージのことです)、それとも手動で行う必要がありますか?

前もって感謝します。
WS

更新:いいえ、間違っていました。実際には会社のコンテキストで行っていますが、インスタンスはEC2インスタンス(標準Amazon Linux 2 AMI)上にあり、プロキシ経由で接続できます……。
そして、前述したように、最初のチェックアウトは成功しましたが、再構築で失敗します。

再度確認しましたが、ホストでは動作しますが、コンテナでは動作しません :frowning:

すみません、時間がかかりましたが、ログ(関連部分だと思います)はこちらです

I, [2024-11-20T05:57:07.498456 #1]  INFO -- : \u003e cd /var/www/discourse \u0026\u0026 sudo -H -E -u discourse git reset --hard
Updating files: 100% (34680/34680), done.
I, [2024-11-20T05:57:11.943323 #1]  INFO -- : HEAD is now at 274e18622 FIX: Video uploads sometimes hang indefinitely (#28523)

I, [2024-11-20T05:57:11.943867 #1]  INFO -- : \u003e cd /var/www/discourse \u0026\u0026 sudo -H -E -u discourse git clean -f
I, [2024-11-20T05:57:12.079705 #1]  INFO -- : 
I, [2024-11-20T05:57:12.080107 #1]  INFO -- : \u003e cd /var/www/discourse \u0026\u0026 sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin tests-passed\n      git fetch --depth 1 origin tests-passed\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n'
fatal: unable to access 'https://github.com/discourse/discourse.git/': server certificate verification failed. CAfile: none CRLfile: none
I, [2024-11-20T05:57:12.186392 #1]  INFO -- : 
I, [2024-11-20T05:57:12.187130 #1]  INFO -- : Terminating async processes
I, [2024-11-20T05:57:12.187180 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 39
2024-11-20 05:57:12.187 UTC [39] LOG:  received fast shutdown request
I, [2024-11-20T05:57:12.187839 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 107
107:signal-handler (1732082232) Received SIGTERM scheduling shutdown...
2024-11-20 05:57:12.189 UTC [39] LOG:  aborting any active transactions
107:M 20 Nov 2024 05:57:12.193 # User requested shutdown...
107:M 20 Nov 2024 05:57:12.193 * Saving the final RDB snapshot before exiting.
2024-11-20 05:57:12.194 UTC [39] LOG:  background worker \"logical replication launcher\" (PID 54) exited with exit code 1
2024-11-20 05:57:12.194 UTC [49] LOG:  shutting down
107:M 20 Nov 2024 05:57:12.197 * DB saved on disk
107:M 20 Nov 2024 05:57:12.197 # Redis is now ready to exit, bye bye...
2024-11-20 05:57:12.227 UTC [39] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse \u0026\u0026 sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin tests-passed\n      git fetch --depth 1 origin tests-passed\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n' failed with return #\u003cProcess::Status: pid 144 exit 128\u003e
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\\n  set -o errexit\\n  if [ $(git rev-parse --is-shallow-repository) == \\\"true\\\" ]; then\\n      git remote set-branches --add origin main\\n      git remote set-branches origin $version\\n      git fetch --depth 1 origin $version\\n  else\\n      git fetch --tags --prune-tags --prune --force origin\\n  fi\\n'", "sudo -H -E -u discourse bash -c '\\n  set -o errexit\\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\\n      git pull\\n  else\\n      git -c advice.detachedHead=false checkout $version\\n  fi\\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p           /shared/{uploads,backups}\"", "bash -c \"ln    -s           /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p           /shared/tmp/{backups,restores}\"", "bash -c \"ln    -s           /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete]"}
bootstrap failed with exit code 128
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

すみません、プロキシの問題でした。プロキシを ~/.docker/config.json に設定してコンテナに注入する必要があり、それがうまくいきました……。

神よ、プロキシの問題にどれだけの時間を浪費したことか? :stuck_out_tongue:

「いいね!」 3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.