race in docs build causes build failure unrelated to changes

Open
#3,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
git

Research direction

Start with the docs build process and the Buildkite log around the git push origin beats_bk_39588 step. Reproduce or trace concurrent builds targeting the same branch, then verify that unrelated documentation builds no longer fail because a remote branch was updated by another process.

Written by the indexing model from the issue text.

Description

Not infrequently I see docs build failure due to what looks to be a race condition in the build architecture. This is demonstrated by this buildkite log tail

<snip>
INFO:build_docs:  Branch: 8.9, Version: 8.9
INFO:build_docs:  Branch: main, Version: master
INFO:build_docs:All cross-document links OK
INFO:build_docs:Saving branch tracker
INFO:build_docs:Building sitemap
INFO:build_docs:Commiting changes
INFO:build_docs:Pushing changes
INFO:build_docs:Error executing: git push origin beats_bk_39588 in GIT_DIR /docs_build/.repos/target_repo.git
INFO:build_docs:---out---
INFO:build_docs:
INFO:build_docs:---err---
INFO:build_docs:Failed to add the ECDSA host key for IP address '140.82.112.3' to the list of known hosts (/tmp/.ssh/known_hosts).
INFO:build_docs:To github.com:elastic/built-docs
INFO:build_docs: ! [rejected]                    beats_bk_39588 -> beats_bk_39588 (fetch first)
INFO:build_docs:error: failed to push some refs to 'git@github.com:elastic/built-docs'
INFO:build_docs:hint: Updates were rejected because the remote contains work that you do
INFO:build_docs:hint: not have locally. This is usually caused by another repository pushing
INFO:build_docs:hint: to the same ref. You may want to first integrate the remote changes
INFO:build_docs:hint: (e.g., 'git pull ...') before pushing again.
INFO:build_docs:hint: See the 'Note about fast-forwards' in 'git push --help' for details.
INFO:build_docs:
INFO:build_docs:---------
:rotating_light: Error: The command exited with status 1
user command error: exit status 1

AFAIUI this is due to the build architecture assuming that it is a sequential process, when it is not, and so assuming that it can push to a branch that is not owned solely by the pushing process.

Dominant language
Ruby
Stars
265
Forks
347
Avg merge
3d 15h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/docs

All issues in elastic/docs

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.