Open Bug 2057368 Opened 4 months ago Updated 12 days ago

Secure PR landings can fail if the sec-fork landing branch is behind the main repo's landing branch

Categories

(Conduit :: Lando, defect, P3)

Tracking

(Not tracked)

People

(Reporter: aryx, Unassigned)

References

(Depends on 2 open bugs)

Details

No patches have landed for the last four hours:

https://lando.moz.tools/D313830/landings/71055/

Deferred

Landing requested on Thu, July 23, 2026 at 8:28 PM GMT+2 (3 hours ago), by dlawrence@mozilla.com.

Landing Job: 71017

Last update: Thu, July 23, 2026 at 11:47 PM GMT+2 (8 seconds ago)

Raw error output:
`Temporary error (<class 'lando.main.scm.exceptions.SCMInternalServerError'>) encountered while pushing to tree: bmo-private-master, push path: https://github.com/mozilla-bteam/bmo.git: Error running git command; sanitised_command=['git', 'push', 'https://[REDACTED]@github.com/mozilla-bteam/bmo.git', 'HEAD:master'], path='/files/repos/bmo-private-master', To https://github.com/mozilla-bteam/bmo.git
! [rejected] HEAD -> master (fetch first)
error: failed to push some refs to 'https://github.com/mozilla-bteam/bmo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Flags: needinfo?(omehani)

The issue here was that bmo-private/master wasn't up to date with bmo/master. I manually pushed bmo/master to bmo-private/master and the job continued on (ironically, to failure).

We should fix this issue such that it doesn't matter if the sec-fork repos are up to date with the latest changes on the public repo.

This is another example where bug 2021999 would have come in handy, as the job had almost 1200 attempts before the delay was noticed and resolved with human intervention.

Flags: needinfo?(omehani)
Priority: -- → P3
See Also: → 2021999
Summary: Lando does not land patches: Temporary error (<class 'lando.main.scm.exceptions.SCMInternalServerError'>) encountered while pushing to tree: bmo-private-master → Secure PR landings can fail if the sec-fork landing branch is behind the main repo's landing branch
See Also: → 2057401
See Also: → 2057497

We should make all these instances detectable as a permanent failure vs. a temporary failure (i.e., this would be the root cause). Seems like there are a few cases of this popping up. Filed bug 2057497.

For this particular instance, it may make sense to make lando push to private repos to keep them in sync (e.g., repos with the same push_url but different url).

Depends on: 2060418

I think for private repos, since they currently only exist if there is an equivalent public repo, it should be pretty simple to have Lando push to both remotes when it detects that type of repo. It might be necessary to add an explicit flag to detect these repos and perform this action, since private repos are not the only type of repo with different push/pull paths (e.g., try).

I think putting this in Lando would be better than relying on a GitHub action since it would handle failures more gracefully (or wouldn't require a fail-safe). In fact, it might be most fail-safe to update the private remote just before applying and pushing, rather than after.

Depends on: 2094751
You need to log in before you can comment on or make changes to this bug.