0
0

More than 3 years have passed since last update.

GHEのbackup-utilsで`Pruning 1 failed snapshot(s) ...`

Posted at

Github Enterpriseでお世話になりがちなbackup-utils

現象

Jenkins上で実施していたら、先日以下のようなエラー。

Backing up GitHub Pages ...
Backing up storage data ...
Backing up custom Git hooks ...
Backing up Elasticsearch indices ...
Pruning 1 failed snapshot(s) ...
touch: cannot touch '<path>/workspace/ghebackup/backup/20200101T000000/incomplete': Permission denied
Makefile:3: recipe for target 'backup' failed
make: *** [backup] Error 1
Build step 'Execute shell' marked build as failure

バックアップ自体は成功しているっぽいのに。

解決策

<path>/workspace/ghebackup/backup/20200101T000000/incompleteのファイルを削除して再度実行。

原因

2020/1/1のバックアップが別要因で失敗していた。その要因は既に取り除いた。
その際に、<path>/workspace/ghebackup/backup/20200101T000000/incompleteが吐き出される。このファイルはroot所有になっていた。
以下の実装の通り、どうも他の日付のincompleteが残っていても今回のバックアップをエラーとしてしまう様子。
(コードはhttps://github.com/github/backup-utils/blob/v2.19.2/share/github-backup-utils/ghe-prune-snapshots#L24-L30より。githubコードの埋め込みはできないみたい)

prune_dirs="$(ls -1 "$GHE_DATA_DIR"/[0-9]*/incomplete 2>/dev/null || true)"
prune_num=$(echo "$prune_dirs" | grep -v '^$' | wc -l)

if [ $prune_num -gt 0 ]; then
  echo Pruning $prune_num "failed snapshot(s) ..."
  echo "$prune_dirs" | sed 's@/incomplete$@@' | prune_snapshot
fi
0
0
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
0
0