OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Can't add github personal access token in the UI

Open adamcole123 opened this issue 6 months ago • 13 comments

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

Im running it in docker using this command:

docker run -it --rm --pull=always -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik -e LOG_ALL_EVENTS=true -v /var/run/docker.soc k:/var/run/docker.sock -v ~/.openhands-state:/.openhands-state -p 1234:3000 --add-host host.docker.internal: host-gateway --name openhands-app docker.all-hands.dev/all-hands-ai/openhands:0.38

When entering a fine-grained github token after setting up my claude api key, I get this error in the terminal running docker:

INFO: 172.17.0.1:52164 - "POST /api/add-git-providers HTTP/1.1" 401 Unauthorized

This is on Windows.

To be clear, the token im using starts with 'github_pat_', incase that could hint at me using the wrong token.

I have confirmed with curl that my tokens can access my account.

OpenHands Installation

Docker command in README

OpenHands Version

0.38.0

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

INFO: 172.17.0.1:52164 - "POST /api/add-git-providers HTTP/1.1" 401 Unauthorized

adamcole123 avatar May 16 '25 12:05 adamcole123

I wonder if this is Windows specific. I just tried with 0.38.0 on Mac and it works fine. I'd be surprised though. I can check it.

mamoodi avatar May 16 '25 17:05 mamoodi

Wait I take that back. Something happened and now I'm getting that error.

I had revoked it that's why :D

mamoodi avatar May 16 '25 17:05 mamoodi

Looking at the docs: https://docs.all-hands.dev/modules/usage/how-to/gui-mode I'm not 100% sure all of that is necessary. I did get it to clone with none of those selected.

Out of curiosity is your user under and organization? Or is this your personal account?

Image

mamoodi avatar May 16 '25 17:05 mamoodi

Out of curiosity is your user under and organization? Or is this your personal account?

My account is a personal account, there's an organisation linked to it but i created the organisation and the repo I want to use is a personal repo. Ill try a token with just those permissions and see what happens.

adamcole123 avatar May 16 '25 18:05 adamcole123

Yep, still no luck with a new token. Hm.

adamcole123 avatar May 16 '25 18:05 adamcole123

@malhotra5 any idea what could be going wrong here?

mamoodi avatar May 16 '25 19:05 mamoodi

Hi wondering if there's an update for this?

adamcole123 avatar May 20 '25 13:05 adamcole123

Hmm this is a bit weird, will take a look into this soon

malhotra5 avatar May 22 '25 20:05 malhotra5

I was unable to store the token as well. That is, until I tried setting it and also setting the "optional" github host. Adding github.com there allowed me to store the token. It seems it is not so optional in at least Firefox.

ajeckmans avatar May 26 '25 08:05 ajeckmans

Huh. @adamcole123 were you using firefox as well?

mamoodi avatar May 26 '25 13:05 mamoodi

I have the same issue! How can I fix it? I'm not able to set gitlab project address. It's already setted [email protected]:openhands-dev/openhands-project.git

letzdev81 avatar May 28 '25 10:05 letzdev81

Are you getting the same error @letzdev81? Or something different?

mamoodi avatar May 28 '25 12:05 mamoodi

Are you getting the same error @letzdev81? Or something different?

It's same. In local condition, local llm.

letzdev81 avatar May 28 '25 13:05 letzdev81

There's been a few changes to this area. Are you all still having issues with this?

mamoodi avatar Jul 01 '25 14:07 mamoodi

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 02 '25 02:08 github-actions[bot]

This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.

github-actions[bot] avatar Aug 13 '25 02:08 github-actions[bot]