codeapp icon indicating copy to clipboard operation
codeapp copied to clipboard

Code.LocalGitCredentialsHelper.HelperError error 0 - selfhosted forgejo

Open ShyViolets opened this issue 1 month ago • 5 comments

Hello, I've been troubleshooting for the past couple days and failing. I keep getting the error in the title when attempting to push to my private instance of forgejo.

I'm able to clone a repo via link. I've tried my password credentials and personal tokens.

I am able to push to github. And I'm able to push using a different git app once it prompts to remove SSL.

I do have local network active. I've tried making fresh repos to test, I've tried a complete fresh install of the docker running the instance, I've tried deleting config files.

( EDIT: I am able to run lg2 push and then entering my username and token and successfully push from the terminal. But via the gui I cannot)

I'm not really sure what else to do and so am hoping someone can point me in the right direction to fix the issue.

I was able to successfully push to my repo at first when using the app - but I broke it somehow and no amount of troubleshooting seems to be able to fix it sadly :(

Image

ShyViolets avatar Dec 13 '25 04:12 ShyViolets

Hi. LocalGitCredentialsHelper.HelperError refers to UnsupportedRemoteURL. That means the git remote url is malformed. Please check the content of .git/config for any malformed urls. Alternatively, try re-cloning the repository and start fresh.

bummoblizard avatar Dec 14 '25 06:12 bummoblizard

I'll take a closer look at the .git/config tomorrow. I did try clearing my local copy and then re-cloning then pushing and also tried pulling freshly made repos and pushing thinking there was an issue with the .git folder as a possibility but got the same error.

Could it being a LAN url as the domain cause an issue (like 192.1.1.1:1000) ? I host it internally unexposed to the outside internet.

ShyViolets avatar Dec 14 '25 08:12 ShyViolets

Yep, that seems to be the reason. Swift's URL(init: String) couldn't seem to parse "192.1.1.1:1000". Could you share your .git/config for me to verify?

bummoblizard avatar Dec 14 '25 15:12 bummoblizard

Adding a git:// prefix to the local ip address in .git/config should work Image

bummoblizard avatar Dec 14 '25 15:12 bummoblizard

Hello, I attempted to make the update in my config file - but the error remains unfortunately. I also tried lg2 remote set-url but got an error in terminal when trying to set it to git://.

I also tried cloning again but altered the url to have git replace http, but this caused the cloning process to hang indefinitely.

Here is what my config file looks like before I swapped in git.

bare = false repositoryformatversion = 0 filemode = true precomposeunicode = true logallrefupdates = true [remote "origin"] url = http://192.168.1.1:1000/Username/reponame.git fetch = +refs/heads/:refs/remotes/origin/ [branch "main"] remote = origin merge = refs/heads/main

Since it's a local url issue, i will try assigning it an actual domain name later and can report back.

ShyViolets avatar Dec 14 '25 22:12 ShyViolets

Just letting you know that after giving it a real domain it works fine. altering the config with my git://IP:Port didn't seem to work but I planned on setting up a domain eventually anyway.

Thanks for looking into this. I guess if someone did want to keep using their local ip, it will work with lg2 push and credentials just not from the GUI's push.

ShyViolets avatar Dec 17 '25 02:12 ShyViolets

Thanks for letting me know. I will take a look again and fix the problem soon

bummoblizard avatar Dec 17 '25 15:12 bummoblizard

np. Thanks for your work on this app - it's really allowed me to learn coding without being glued to my desk :)

ShyViolets avatar Dec 18 '25 09:12 ShyViolets