Codeberg/Community
54
325
Fork
You've already forked Community
12

Can't sync from CB to GH with SSH #2156

Closed
opened 2025年10月04日 16:29:50 +02:00 by 8to16 · 17 comments

Comment

My repo is ampmod/ampmod.
I am creating a mirror repo on GitHub so people there can contribute. However, this error occurs when trying to mirror.
image

The SSH key used here was also added on GitHub.

### Comment My repo is ampmod/ampmod. I am creating a mirror repo on GitHub so people there can contribute. However, this error occurs when trying to mirror. ![image](/attachments/b00e6596-9541-4664-b96e-5730c73e31e8) The SSH key used here was also added on GitHub.
8.4 KiB
Author
Copy link

Trying to authenticate with the PAT also results in Bad credentials

Trying to authenticate with the PAT also results in `Bad credentials`
Did you follow the steps outlined in https://forgejo.org/docs/latest/user/repo-mirror/#mirror-via-ssh?
Author
Copy link

@Gusted wrote in #2156 (comment):

Did you follow the steps outlined in https://forgejo.org/docs/latest/user/repo-mirror/#mirror-via-ssh?

Oopsies.
There wasn't a link to that docs page so kinda confusing... :/
Will try again soon.

@Gusted wrote in https://codeberg.org/Codeberg/Community/issues/2156#issuecomment-7715033: > Did you follow the steps outlined in https://forgejo.org/docs/latest/user/repo-mirror/#mirror-via-ssh? Oopsies. There wasn't a link to that docs page so kinda confusing... :/ Will try again soon.
Author
Copy link

Hello, I followed the steps and still receive the same error.

Hello, I followed the steps and still receive the same error.

Hi, does that mean you've added the SSH public key as a deploy key for https://github.com/amp-mod/ampmod?

Hi, does that mean you've added the SSH public key as a deploy key for https://github.com/amp-mod/ampmod?
Author
Copy link

@Gusted wrote in #2156 (comment):

Hi, does that mean you've added the SSH public key as a deploy key for https://github.com/amp-mod/ampmod?

Yes

@Gusted wrote in https://codeberg.org/Codeberg/Community/issues/2156#issuecomment-8826342: > Hi, does that mean you've added the SSH public key as a deploy key for https://github.com/amp-mod/ampmod? Yes

Hmm that's strange, could you check if you've given the deploy key "Write access"?

image

Otherwise I will have to try and get the SSH from the database and do some manual checks.

Hmm that's strange, could you check if you've given the deploy key "Write access"? ![image](/attachments/ab6b8a76-ffe9-4375-9c1f-4a3a25272193) Otherwise I will have to try and get the SSH from the database and do some manual checks.
Author
Copy link
![image](/attachments/12d7a141-c4c4-4c5e-89f0-9a5442972f34)
Pushing to ssh://github.com/amp-mod/ampmod.git
To ssh://github.com/amp-mod/ampmod.git
 = [up to date] develop -> develop
 = [up to date] 0.3.0 -> 0.3.0
 = [up to date] 0.3.1 -> 0.3.1
 = [up to date] 0.3.2 -> 0.3.2
 = [up to date] 0.3.3 -> 0.3.3
 = [up to date] 0.3.4 -> 0.3.4
 ! [remote rejected] add-tests (refusing to delete the current branch: refs/heads/add-tests)
updating local tracking ref 'refs/heads/develop'
updating local tracking ref 'refs/tags/0.3.0'
updating local tracking ref 'refs/tags/0.3.1'
updating local tracking ref 'refs/tags/0.3.2'
updating local tracking ref 'refs/tags/0.3.3'
updating local tracking ref 'refs/tags/0.3.4'
error: failed to push some refs to 'ssh://github.com/amp-mod/ampmod.git'

Is it possible that you have branch protection setup for add-tests? Not sure why the error in Codeberg's UI is saying something else but local tests shows this to be the issue likely.

``` Pushing to ssh://github.com/amp-mod/ampmod.git To ssh://github.com/amp-mod/ampmod.git = [up to date] develop -> develop = [up to date] 0.3.0 -> 0.3.0 = [up to date] 0.3.1 -> 0.3.1 = [up to date] 0.3.2 -> 0.3.2 = [up to date] 0.3.3 -> 0.3.3 = [up to date] 0.3.4 -> 0.3.4 ! [remote rejected] add-tests (refusing to delete the current branch: refs/heads/add-tests) updating local tracking ref 'refs/heads/develop' updating local tracking ref 'refs/tags/0.3.0' updating local tracking ref 'refs/tags/0.3.1' updating local tracking ref 'refs/tags/0.3.2' updating local tracking ref 'refs/tags/0.3.3' updating local tracking ref 'refs/tags/0.3.4' error: failed to push some refs to 'ssh://github.com/amp-mod/ampmod.git' ``` Is it possible that you have branch protection setup for `add-tests`? Not sure why the error in Codeberg's UI is saying something else but local tests shows this to be the issue likely.
Author
Copy link

I've tried again (add-tests is an old branch that no longer exists; I have re-created the repository and same error)

I've tried again (`add-tests` is an old branch that no longer exists; I have re-created the repository and same error)
Author
Copy link

there are no protected branches

there are no protected branches
To ssh://github.com/amp-mod/ampmod.git
 * [new branch] develop -> develop
 * [new tag] 0.3.0 -> 0.3.0
 * [new tag] 0.3.1 -> 0.3.1
 * [new tag] 0.3.2 -> 0.3.2
 * [new tag] 0.3.3 -> 0.3.3
 * [new tag] 0.3.4 -> 0.3.4
 ! [remote rejected] main (refusing to delete the current branch: refs/heads/main)
updating local tracking ref 'refs/heads/develop'
updating local tracking ref 'refs/tags/0.3.0'
updating local tracking ref 'refs/tags/0.3.1'
updating local tracking ref 'refs/tags/0.3.2'
updating local tracking ref 'refs/tags/0.3.3'
updating local tracking ref 'refs/tags/0.3.4'
error: failed to push some refs to 'ssh://github.com/amp-mod/ampmod.git'

I suppose main is the default branch now in the github repository?

``` To ssh://github.com/amp-mod/ampmod.git * [new branch] develop -> develop * [new tag] 0.3.0 -> 0.3.0 * [new tag] 0.3.1 -> 0.3.1 * [new tag] 0.3.2 -> 0.3.2 * [new tag] 0.3.3 -> 0.3.3 * [new tag] 0.3.4 -> 0.3.4 ! [remote rejected] main (refusing to delete the current branch: refs/heads/main) updating local tracking ref 'refs/heads/develop' updating local tracking ref 'refs/tags/0.3.0' updating local tracking ref 'refs/tags/0.3.1' updating local tracking ref 'refs/tags/0.3.2' updating local tracking ref 'refs/tags/0.3.3' updating local tracking ref 'refs/tags/0.3.4' error: failed to push some refs to 'ssh://github.com/amp-mod/ampmod.git' ``` I suppose `main` is the default branch now in the github repository?
Author
Copy link

I've deleted all branches other than develop and it still breaks, though the code somehow just got pushed.

I've deleted all branches other than `develop` and it still breaks, though the code somehow just got pushed.

Ah it might be LFS that's returning the error, not sure why the code still got pushed in this case but nice side-effect now. Yeah Forgejo does not have LFS over SSH, so it shouldn't try that... I'll get on a fix for that.

Ah it might be LFS that's returning the error, not sure why the code still got pushed in this case but nice side-effect now. Yeah Forgejo does not have LFS over SSH, so it shouldn't try that... I'll get on a fix for that.
Author
Copy link

Attempts to mirror are hanging now

Attempts to mirror are hanging now

It will be okay once the fix is deployed which is not yet the case.

It will be okay once the fix is deployed which is not yet the case.

The patch has been deployed and it looks to me the error is gone and will now synchronize properly, enjoy!

The patch has been deployed and it looks to me the error is gone and will now synchronize properly, enjoy!
jasewolf referenced this issue from a commit 2026年01月13日 18:11:02 +01:00
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2156
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?