1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gitlab-ci(gitlab-runner)で、「fatal: missing blob object 〜error: remote did not send all necessary objects」とジョブが失敗してしまう。

Last updated at Posted at 2020-12-22

先程まで動いていた、gitlab-runnerが、下記エラーで動かなくなってしまった。。:frowning2:

image.png

gitlab-runner
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /tmp/builds/〜
fatal: missing blob object 'b80eee3b3c630cef3XXXXXXXX'
error: remote did not send all necessary objects
ERROR: Job failed: exit status 1

ようするに、gitlab-runner install時に、指定したディレクトリにキャッシュファイルを作っているようなのですが、
これが何かが原因で壊れてしまい毎回エラーになっていました。

ググっても情報が見つからなかったので念の為メモ。

gitlab-runnerをインストールした時に指定したディレクトリに、
ビルドに必要な作業ディレクトリのようなものを作っていたのを思い出した。

gitlab-runnerをサーバーにインストールした時

$ sudo gitlab-runner install -u execuser -d /tmp/

インストール時に作られた設定ファイルにも記載が。

$ sudo vim /etc/systemd/system/gitlab-runner.service
[Unit]
Description=GitLab Runner
After=syslog.target network.target
ConditionFileIsExecutable=/usr/lib/gitlab-runner/gitlab-runner

[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/lib/gitlab-runner/gitlab-runner "run" "--working-directory" "/tmp/" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--syslog" "--user" "execuser"


それで、その対象のディレクトリを削除してみると。。(※削除コマンドなので扱い注意)

$rm -r /tmp/builds/

ジョブを再度走らせてみると。。!

image.png

成功!!!
対象ディレクトリを削除する事で、無事ジョブが走るようになりました。:coffee:

また、他の方法としてgitlab-runnerを再度gitlab-runner registerなどで作り直しても改善されました。
(working-directory削除の方が楽かな。)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?