Repository switcher returns HTML and SSH fails for caniko/ai-skills

My private repository, caniko/ai-skills (repository ID 4917), is experiencing two failures.

1. Repository Switcher Failure

The repository switcher displays the following error:

Could not load repositories: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

While authenticated, accessing:

https://codefloe.com/caniko/ai-skills/repo-switcher/list

redirects to:

https://codefloe.com/caniko/ai-skills

This suggests that the endpoint is returning an HTML redirect response instead of the expected JSON.

2. SSH Git Access Failure

Running:

git ls-remote --heads ssh://git@codefloe.com/caniko/ai-skills.git trunk

produces:

Forgejo: Internal Server Error (no message for end users)
fatal: Could not read from remote repository.

SSH authentication succeeds, and the same SSH key works correctly with caniko/canix.

3. Repository Integrity Checks

The underlying Git data appears healthy:

  • Authenticated API requests for repository metadata, branches, trees, and file contents return HTTP 200.

  • A fresh HTTPS mirror clone completes successfully.

  • git fsck --full passes on the mirror clone.

These results suggest that the issue may involve Forgejo’s repository state or access-handling logic rather than Git object corruption.

4. Suspected Root Cause

A stale broken or migrating repository status flag is suspected but not confirmed.

Forgejo’s middleware can redirect repository subpaths when a repository is in one of these states. This could explain the repository switcher’s JSON parsing failure.

The SSH failure may share the same underlying cause, but this remains unverified.

5. Requested Investigation

Could you please:

  1. Inspect the repository’s current status flags in Forgejo.

  2. Check migration records and background task history for incomplete or failed operations.

  3. Examine Forgejo’s SSH server logs for the internal server error.

  4. Determine whether the HTTP redirect and SSH failure share a common cause.

  5. Restore normal repository functionality using the least invasive corrective action.

Important: Please preserve the existing repository, including its complete Git history, branches, issues, and associated metadata. Do not delete or recreate the repository.

Confirmed, your suspicion was right: ai-skills was stuck in the migrating state after the Codeberg import failed on 26 July. The code had already been imported, but the import aborted afterwards, most likely on a token missing the read:issue scope.

A Forgejo cleanup bug then left the flag set. It caused both the redirect and the SSH error. Your Git data was never affected. We’ve reset the flag on ai-skills and also on course-of-life, which had the same problem. Nothing was deleted or recreated. Issues or PRs from Codeberg that didn’t come across in that import aren’t restored by this. We’re fixing the underlying bug separately in our fork.

Could you confirm that SSH and the repository switcher both work for you now?

thank you! It works now!