sapling icon indicating copy to clipboard operation
sapling copied to clipboard

`ghstack land` failed

Open lw opened this issue 2 years ago • 0 comments

I wanted to land a PR on a GitHub repo that I had opened with ghstack.

$ sl ghstack land https://github.com/myorg/myrepo/pull/299
** Sapling SCM (version 0.1.20221201-095354-r360873f1) has crashed:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/edenscm/__init__.py", line 106, in run
    dispatch.run(args, fin, fout, ferr, config)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 161, in run
    status = (dispatch(req) or 0) & 255
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 503, in dispatch
    ret = _runcatch(req)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 712, in _runcatch
    return _callcatch(ui, req, _runcatchfunc)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 721, in _callcatch
    return scmutil.callcatch(ui, req, func)
  File "/usr/lib/python3.8/site-packages/edenscm/scmutil.py", line 147, in callcatch
    return func()
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 683, in _runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 1218, in _dispatch
    ret = runcommand(
  File "/usr/lib/python3.8/site-packages/edenscm/ext/undo.py", line 146, in _runcommandwrapper
    result = orig(lui, repo, cmd, fullargs, *args)
  File "/usr/lib/python3.8/site-packages/edenscm/ext/journal.py", line 80, in runcommand
    return orig(lui, repo, cmd, fullargs, *args)
  File "/usr/lib/python3.8/site-packages/edenscm/ext/sparse.py", line 504, in _tracktelemetry
    res = runcommand(lui, repo, *args)
  File "/usr/lib/python3.8/site-packages/edenscm/ext/copytrace.py", line 173, in _runcommand
    return orig(lui, repo, cmd, fullargs, ui, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 913, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 1259, in _runcommand
    return cmdfunc()
  File "/usr/lib/python3.8/site-packages/edenscm/dispatch.py", line 1217, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python3.8/site-packages/edenscm/util.py", line 1282, in check
    return func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/edenscm/ext/ghstack/__init__.py", line 149, in land_cmd
    ghstack.land.main(
  File "/usr/lib/python3.8/site-packages/ghstack/land.py", line 19, in main
    return ghstack.sapling_land.main(pull_request, remote_name, github, sh, github_url)
  File "/usr/lib/python3.8/site-packages/ghstack/sapling_land.py", line 108, in main
    sh.run_sapling_command("push", "--rev", rebase_base, "--to", default_branch)
  File "/usr/lib/python3.8/site-packages/ghstack/sapling_shell.py", line 83, in run_sapling_command
    return self._run_sapling_command(list(args))
  File "/usr/lib/python3.8/site-packages/ghstack/sapling_shell.py", line 89, in _run_sapling_command
    stdout = self.sh(*full_args, env=env)
  File "/usr/lib/python3.8/site-packages/ghstack/shell.py", line 218, in sh
    raise RuntimeError(
RuntimeError: /usr/bin/sl push --rev a30d05a49f1c009ffb82c54ab6a98884dc837bd4 --to main failed with exit code 1

This closed the PR on GitHub, but didn't actually land the commit on the main branch. From memory, in the ISL, I saw the commit still present, but duplicated: at its original location, and also on the main branch.

I tried running the failing command by hand to see what happened:

$ /usr/bin/sl push --rev a30d05a49f1c009ffb82c54ab6a98884dc837bd4 --to main
To https://github.com/myorg/myrepo
 ! [rejected]        a30d05a49f1c009ffb82c54ab6a98884dc837bd4 -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/myorg/myrepo'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.

So, as an attempt, I ran this

$ sl pull
pulling from https://github.com/myorg/myrepo
marked 2 commits as landed

This did not fix my problem (the previous command still fails), but now the commit has entirely disappeared from the ISL.

lw avatar Dec 15 '22 13:12 lw