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

**URL:** <https://forum.codefloe.com/t/repository-switcher-returns-html-and-ssh-fails-for-caniko-ai-skills/232>\
**Category:** General\
**Created:** [November 5, 2026, 6:05pm UTC](https://forum.codefloe.com/t/repository-switcher-returns-html-and-ssh-fails-for-caniko-ai-skills/232 "2026-11-05T18:05:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caniko](https://forum.codefloe.com/user_avatar/forum.codefloe.com/caniko/32/360_2.png) [@caniko](https://forum.codefloe.com/u/caniko)\
**Post date:** [November 5, 2026, 6:05pm UTC](https://forum.codefloe.com/t/repository-switcher-returns-html-and-ssh-fails-for-caniko-ai-skills/232/1 "2026-11-05T18:05:12Z")

</div>

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

## 1. Repository Switcher Failure

The repository switcher displays the following error:

```auto
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:

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

```

produces:

```auto
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.

---

<div class="post-metadata">

**Author:** ![codefloe](https://forum.codefloe.com/user_avatar/forum.codefloe.com/codefloe/32/347_2.png) [@codefloe](https://forum.codefloe.com/u/codefloe)\
**Post date:** [November 6, 2026, 10:15am UTC](https://forum.codefloe.com/t/repository-switcher-returns-html-and-ssh-fails-for-caniko-ai-skills/232/2 "2026-11-06T10:15:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![caniko](https://forum.codefloe.com/user_avatar/forum.codefloe.com/caniko/32/360_2.png) [@caniko](https://forum.codefloe.com/u/caniko)\
**Post date:** [November 6, 2026, 12:31pm UTC](https://forum.codefloe.com/t/repository-switcher-returns-html-and-ssh-fails-for-caniko-ai-skills/232/3 "2026-11-06T12:31:02Z")

</div>

thank you! It works now!
