JuliaRegistries / TagBot

Creates tags, releases, and changelogs for your Julia packages when they're registered
https://github.com/marketplace/actions/julia-tagbot
MIT License
94 stars 20 forks source link

TagBot internal failure: Permission denied (publickey) #227

Closed vtjeng closed 2 years ago

vtjeng commented 2 years ago

TagBot is failing with the following error:

Processing version v0.3.2 (485599386651ad[44](https://github.com/vtjeng/MIPVerify.jl/runs/5701800687?check_suite_focus=true#step:3:44)6f32f5598bf7e0318d8ec377)
Generating changelog for version v0.3.2 (485599386651ad4[46](https://github.com/vtjeng/MIPVerify.jl/runs/5701800687?check_suite_focus=true#step:3:46)f32f5598bf7e0318d8ec377)
Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: TagBot experienced an unexpected internal failure
Traceback (most recent call last):
  File "/root/tagbot/action/__main__.py", line 94, in <module>
    repo.create_release(version, sha)
  File "/root/tagbot/action/repo.py", line [53](https://github.com/vtjeng/MIPVerify.jl/runs/5701800687?check_suite_focus=true#step:3:53)3, in create_release
    self._git.create_tag(version, sha, log)
  File "/root/tagbot/action/git.py", line 107, in create_tag
    self.command("push", "origin", version)
  File "/root/tagbot/action/git.py", line 71, in command
    raise Abort(f"Git command '{cmd}' failed")
tagbot.action.Abort: Git command 'git -C /tmp/tagbot_repo_7ra2vqc8 push origin v0.3.2' failed

Response (200): {
  "status": "Submitted error report"
}

The same error occurs when I manually trigger TagBot. A previous run (~1 year ago on Mar 18, 2021) succeeded, and I haven't changed the Github action settings since then.

What is the error likely to be here? This looks similar to https://github.com/JuliaRegistries/TagBot/issues/160, but in this case I am just using the DOCUMENTER_KEY:

name: TagBot

on:
  issue_comment:
    types:
      - created
  workflow_dispatch:

jobs:
  TagBot:
    if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
    runs-on: ubuntu-latest
    steps:
      - uses: JuliaRegistries/TagBot@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ssh: ${{ secrets.DOCUMENTER_KEY }}

I noticed that my docs had not been updated since v0.3.0 (https://vtjeng.com/MIPVerify.jl/stable/); perhaps that's the root of the problem?

For completeness, I verified that I had not removed the DOCUMENTER_KEY secret, which I last updated on Mar 18, 2021. (I navigated to https://github.com/vtjeng/MIPVerify.jl/settings/secrets/actions to verify this)

vtjeng commented 2 years ago

I somehow had removed the deploy key (https://github.com/vtjeng/MIPVerify.jl/settings/keys) in my repository. I restored it with the following instructions. Sorry for the noise!

terasakisatoshi commented 12 months ago

It seems we are supposed to use ssh key generated by RSA algorithm, say, -t rsa.

https://github.com/JuliaRegistries/TagBot/blob/542347e3e34c4ab2fd5097e500ec6132cc4a33a6/bin/publish.py#L33

That's why the following instructions solves the issue reported by @vtjeng

using DocumenterTools
using MyPackage
DocumenterTools.genkeys(MyPackage)