Skip to content

Crash when trying to backup a temporary private fork #547

Open

Description

@Jackenmen

What happened?

The process crashed when trying to backup a temporary private fork (created for a repository security vulnerability, see https://github.com/proxy/docs.github.com/en/code-security/tutorials/fix-reported-vulnerabilities/collaborate-in-a-fork) due to a 404. This appears to be due to temporary private forks not having issues.

As far as I can tell, there is no explicit flag for indicating that a repo is a temporary private fork. I imagine fixing this would instead require checking has_* fields on the repository data. For reference, here are those fields on a temporary private fork:

{
  "has_issues": false,
  "has_projects": false,
  "has_downloads": false,
  "has_wiki": false,
  "has_pages": false,
  "has_discussions": false,
  "has_pull_requests": true
}

Here's the log from the crash:

2026-11-14T14:40:16.699: Cloning Red-DiscordBot-ghsa-6rh9-vc43-xpm4 repository from https://*****:x-oauth-basic@github.com/Cog-Creators/Red-DiscordBot-ghsa-6rh9-vc43-xpm4.git to /var/tmp/tmpq94ix5qv/repositories/Red-DiscordBot-ghsa-6rh9-vc43-xpm4/repository
2026-11-14T14:40:16.702: b"Cloning into '/var/tmp/tmpq94ix5qv/repositories/Red-DiscordBot-ghsa-6rh9-vc43-xpm4/repository'..."
2026-11-14T14:40:17.057: b'warning: redirecting to https://github.com/Cog-Creators/Red-DiscordBot-ghsa-6rh9-vc43-xpm4.git/'
2026-11-14T14:40:45.257: Retrieving Cog-Creators/Red-DiscordBot-ghsa-6rh9-vc43-xpm4 issues
2026-11-14T14:40:45.258: Requesting https://github.com/proxy/api.github.com/repos/Cog-Creators/Red-DiscordBot-ghsa-6rh9-vc43-xpm4/issues?per_page=100&filter=all&state=open
2026-11-14T14:40:45.498: API Error: 404 Not Found for https://github.com/proxy/api.github.com/repos/Cog-Creators/Red-DiscordBot-ghsa-6rh9-vc43-xpm4/issues?per_page=100&filter=all&state=open
Traceback (most recent call last):
  File "/home/ubuntu/github-backup-venv/bin/github-backup", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/cli.py", line 83, in main
    backup_repositories(args, output_directory, repositories)
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/github_backup.py", line 2376, in backup_repositories
    backup_issues(args, repo_cwd, repository, repos_template)
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/github_backup.py", line 2901, in backup_issues
    _issues = retrieve_data(args, _issue_template, query_args=query_args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/github_backup.py", line 1016, in retrieve_data
    return list(fetch_all())
           ^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/github_backup.py", line 919, in fetch_all
    http_response = make_request_with_retry(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github-backup-venv/lib/python3.11/site-packages/github_backup/github_backup.py", line 1114, in make_request_with_retry
    return urlopen(request, context=https_ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Backup process exited with code 1

Activity

  1. Jackenmen commented on Nov 14, 2026

    @Jackenmen
    Author

    After checking the code, I guess there are actually a bunch of things that would still run into 404 even if has_* fields were checked - milestones, labels, hooks (and security advisories, if --include-security-advisories is explicitly specified). I don't see any field that would be helpful in determining whether any of these are missing. The project does already check for 404 for pulls, hooks and security-advisories endpoints so maybe it would just make most sense to catch those for all the other things that may be missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions