What to do? HACS Could not authenticate with GitHub, try again later

I am a newbie, i need all the help i can get

BTW, the error doesn’t show up on my integrations page, I have to manually add it and then it shows the error after all the tick marks

1 Like

What led to this?

Have you followed the instructions on hacs.xyz?

I have the same issue and I think I followed the instructions to the letter.

1 Like

Checked the logs and the URL that fails is https://github.com/login/device/code. If I put that in a browser GitHub says that is not the page I’m looking for.

so im running HAOS and i downloaded it using the generic x86 document on the HA website, idk why this isnt working but i cant even oing guthub without adding it as a nameserver

Wtf?

What is “it”? (Github is not a nameserver afaik)

sorry i meant ping github and adding google as a name server

Post the text that occurs after you follow the hacs.xyz instructions.

Hi, I came across this issue too.

I got it resolved, however not exactly sure which part(s) did the trick, but I wanted to share how I got to the solution, somebody might be able to pin it down more precisely.

As I am new I am only allowed to post 2 links, so I changed all https:// in the links to h-t-t-p-:-/-/

Home Assistant 2023.10.4
Frontend 20231005.0 – latest
Installed as docker container

HACS 1.33.0
hacs.xyz

After installing HACS, you need to add HACS as an integration.
The process is described here: h-t-t-p-s-:-/-/hacs.xyz/docs/configuration/basic/

Error: device registration ends with following error:
Could not authenticate with Github, try again later.

First: Disable all ad blocking and dns filtering services in your network: adguard, pi hole, …
Make sure you do not have a proxy or restrictive firewall

I enabled extended logging:
add following to configuration.yaml

logger:

default: info
logs:
custom_components.hacs: debug
aiogithubapi: debug

result:
2023-10-22 12:30:31.149 ERROR (MainThread) [custom_components.hacs] Request exception for ‘h-t-t-p-s-:-/-/github.com/login/device/code’ with - Cannot connect to host github.com:443 ssl:default [Connection reset by peer]

Open a bash shell in the docker image to start investigating.

docker exec -it <container id> bash

And did a wget to see what was happening:

wget h-t-t-p-s-:-/-/github.com/login/device/code
ha3-home_assistant:/tmp# wget h-t-t-p-s-:-/-/github.com/login/device/code
--2023-10-22 13:30:14-- h-t-t-p-s-:-/-/github.com/login/device/code
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
Unable to establish SSL connection.
ha3-home_assistant:/tmp# wget h-t-t-p-s-:-/-/github.com/login
--2023-10-22 13:30:14-- h-t-t-p-s-:-/-/github.com/login
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
Unable to establish SSL connection.

I first tried:

apk update && apk add ca-certificates wget && update-ca-certificates
ha3-home_assistant:/tmp# wget h-t-t-p-s-:-/-/github.com/login/device
--2023-10-22 13:30:14-- h-t-t-p-s-:-/-/github.com/login/device
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
Unable to establish SSL connection.
ha3-home_assistant:/tmp# wget h-t-t-p-s-:-/-/github.com/login
--2023-10-22 13:30:18-- h-t-t-p-s-:-/-/github.com/login
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'login'
login [ <=> ] 33.69K --.-KB/s in 0.02s
2023-10-22 13:30:19 (2.04 MB/s) - 'login' saved [34499]

Now second test works. Still an ssl error for the first one.

wget --no-check-certificate -d h-t-t-p-s-:-/-/github.com/login/device
DEBUG output created by Wget 1.21.4 on linux-musl.
Reading HSTS entries from /root/.wget-hsts
URI encoding = 'ASCII'
converted 'h-t-t-p-s-:-/-/github.com/login/device' (ASCII) -> 'h-t-t-p-s-:-/-/github.com/login/device' (UTF-8)
Converted file name 'device' (UTF-8) -> 'device' (ASCII)
--2023-10-22 13:34:00-- h-t-t-p-s-:-/-/github.com/login/device
Resolving github.com (github.com)... 140.82.121.4
Caching github.com => 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
Created socket 3.
Releasing 0x00007f9c17f91310 (new refcount 1).
Initiating SSL handshake.
SSL handshake failed.
Closed fd 3
Unable to establish SSL connection.
Troed following:
apk update && apk upgrade --no-cache

No luck

Then tried to fix the git possible ssl issues: (h-t-t-p-s-:-/-/stackoverflow.com/questions/49345357/fatal-unable-to-access-https-github-com-xxx-openssl-ssl-connect-ssl-error?rq=1))
I tried the following:

git config --global --unset-all remote.origin.proxy
git config --global http.sslVerify false
git config --global http.sslBackend "openssl"

After that:

wget h-t-t-p-s-:-/-/github.com/login/device/code
--2023-10-22 13:41:43-- h-t-t-p-s-:-/-/github.com/login/device/code
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-10-22 13:41:44 ERROR 404: Not Found.

This is the correct answer it should give.
After that the device OAuth flow for authentication against the GitHub API worked.
And I was able to proceed with the setup of the integration.

1 Like