Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check release sometime fails to find remote ref #593

Open
brichet opened this issue Nov 15, 2024 · 6 comments
Open

Check release sometime fails to find remote ref #593

brichet opened this issue Nov 15, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@brichet
Copy link
Contributor

brichet commented Nov 15, 2024

Description

Sometime the prep-git action fails with an error relative to the remote ref, for example in jupyterlab/jupyter-collaboration#378:

fatal: couldn't find remote ref refs/pull/378/merge.

The workaround is to close the PR and open a new one.

Error log
Initialized empty Git repository in /home/runner/work/jupyter-collaboration/jupyter-collaboration/.jupyter_releaser_checkout/.git/
fatal: couldn't find remote ref refs/pull/378/merge
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.10/x64/bin/jupyter-releaser", line 8, in 
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/cli.py", line 121, in invoke
    super().invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/cli.py", line 367, in prep_git
    lib.prep_git(ref, branch, repo, auth, username, git_url)
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/lib.py", line 537, in prep_git
    util.run(f"{util.GIT_FETCH_CMD} +{ref}:{ref_alias}")
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'git fetch origin --filter=blob:none --quiet +refs/pull/378/merge:refs/pull/378/merge' returned non-zero exit status 128.
Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/actions/prep_release.py", line 11, in 
    run_action("jupyter-releaser prep-git")
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/actions/common.py", line 25, in run_action
    _run(target, *args, **kwargs)
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_actions/jupyter-server/jupyter_releaser/v2/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'jupyter-releaser prep-git' returned non-zero exit status 1.

Reproduce

This seems to be random, so difficult to reproduce.

Context

@brichet brichet added the bug Something isn't working label Nov 15, 2024
@krassowski
Copy link
Collaborator

I was under impression that this happens when closing and reopening some PRs.

@jtpio
Copy link
Member

jtpio commented Nov 15, 2024

I was under impression that this happens when closing and reopening some PRs.

That's what we often do on the JupyterLab repo after a Galata snapshot update, but not sure to have seen on https://github.com/jupyterlab/jupyterlab yet?

@krassowski
Copy link
Collaborator

It did pop up a couple of times, here for example: jupyterlab/jupyterlab#16866. The workaround I was using was to merge with main branch.

@krassowski
Copy link
Collaborator

It started appearing a month ago or so, I think this was a change in GitHub API behaviour.

@jtpio
Copy link
Member

jtpio commented Nov 15, 2024

Good to know. I wonder if there is something we can do in the releaser to handle this new behavior.

@brichet
Copy link
Contributor Author

brichet commented Nov 15, 2024

I was under impression that this happens when closing and reopening some PRs.

I hadn't noticed it.

The workaround I was using was to merge with main branch.

Thanks, this is a better workaround than closing the PR, as long as it is not handled in the releaser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants