Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Pull: "Unexpected server response. Status code: 401" #3714

Open
LucasHokerberg opened this issue Aug 2, 2024 · 13 comments
Open

Git Pull: "Unexpected server response. Status code: 401" #3714

LucasHokerberg opened this issue Aug 2, 2024 · 13 comments

Comments

@LucasHokerberg
Copy link

Describe the issue you are experiencing

Same as #3587.

When running Git Pull (the plug-in), it pulls the latest code, but fails on configuration check:

[Info] Checking if something has changed...
[Info] Something has changed, checking Home-Assistant config...
Unexpected server response. Status code: 401
time="2024-08-02T17:10:58Z" level=error msg="Unexpected server response. Status code: 401"
[Error] Configuration updated but it does not pass the config check. Do not restart until this is fixed!

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Git pull

What is the version of the add-on?

7.14.1

Steps to reproduce the issue

Push some new code to the GIT repo and have the add-on to pull the changes.

System Health information

System Information

version core-2024.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.33-haos
arch x86_64
timezone Europe/Stockholm
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1385
Downloaded Repositories 14
Home Assistant Cloud
logged_in true
subscription_expiration August 14, 2024 at 02:00
relayer_connected true
relayer_region eu-central-1
remote_enabled false
remote_connected false
alexa_enabled false
google_enabled true
remote_server eu-central-1-8.ui.nabu.casa
certificate_status ready
instance_id 10dbf997ff5343c0a8d95920b74ec575
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.4
update_channel stable
supervisor_version supervisor-2024.06.2
agent_version 1.6.0
docker_version 26.1.4
disk_total 53.4 GB
disk_used 20.9 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
board ova
supervisor_api ok
version_api ok
installed_addons Grafana (10.0.0), InfluxDB (5.0.0), MariaDB (2.7.1), Git pull (7.14.1), Samba share (12.3.2), Traccar (0.25.0), Mosquitto broker (6.4.1), Terminal & SSH (9.14.0), File editor (5.8.0)
Dashboards
dashboards 3
resources 5
views 26
mode storage
Recorder
oldest_recorder_run July 23, 2024 at 18:19
current_recorder_run August 1, 2024 at 14:36
estimated_db_size 2728.89 MiB
database_engine mysql
database_version 10.11.6
Spotify
api_endpoint_reachable ok

Anything in the Supervisor logs that might be useful for us?

Logger: homeassistant.components.hassio
Source: components/hassio/websocket_api.py:135
integration: Home Assistant Supervisor (documentation, issues)
First occurred: 19:11:06 (3 occurrences)
Last logged: 19:14:32

Failed to to call /addons/core_git_pull/stats - Container addon_core_git_pull is not running

Anything in the add-on logs that might be useful for us?

See descrpition.

Additional information

No response

@andarotajo
Copy link

Getting the same error for quite a while now. My current workaround is calling homassistant.reload_all ~5 seconds after starting the add-on (i start it via automation only after a successful CI run). Kinda annoying and obviously no automatic restarts

@mpepping
Copy link

Same here. Not sure since which version. The git pull itself is OK .. the request to do the config check gets a 401:

[Info] Staying on currently checked out branch: main...
[Info] Start git pull...
Updating ec68d18..506aa2a
Fast-forward
 entities/humidifiers/woonkamer.yaml | 23 -----------------------
 1 file changed, 23 deletions(-)
[Info] Checking if something has changed...
[Info] Something has changed, checking Home-Assistant config...
Unexpected server response. Status code: 401
time="2024-08-17T13:00:29Z" level=error msg="Unexpected server response. Status code: 401"
[Error] Configuration updated but it does not pass the config check. Do not restart until this is fixed!
s6-rc: info: service legacy-services: stopping

@sam-cogan
Copy link

I'm also seeing this, any solutions?

@michaelkuty
Copy link

same for me

HEAD is now at c2307d3 Update components
[Info] Checking if something has changed...
[Info] Something has changed, checking Home-Assistant config...
time="2024-09-09T08:52:11Z" level=error msg="Unexpected server response. Status code: 401"
Unexpected server response. Status code: 401

@sriramsv
Copy link

Same for me: ha core check fails with 401.

[Info] Something has changed, checking Home-Assistant config...
time="2024-09-12T05:32:05Z" level=error msg="Unexpected server response. Status code: 401"
Unexpected server response. Status code: 401
[Error] Configuration updated but it does not pass the config check. Do not restart until this is fixed!```

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 12, 2024
@mpepping
Copy link

Still an issue

[Info] Checking if something has changed...
[Info] Something has changed, checking Home-Assistant config...
Unexpected server response. Status code: 401
time="2024-10-12T06:20:37Z" level=error msg="Unexpected server response. Status code: 401"

@github-actions github-actions bot removed the stale label Oct 12, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 11, 2024
@maartenhendrix
Copy link

this is still an issue

@github-actions github-actions bot removed the stale label Nov 11, 2024
@fransixles
Copy link

This is also an issue for me.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 14, 2024
@mpepping
Copy link

mpepping commented Dec 14, 2024

Still an issue

[Info] Checking if something has changed...
[Info] Something has changed, checking Home-Assistant config...
time="2024-12-14T08:09:10Z" level=error msg="Unexpected server response. Status code: 401"
Unexpected server response. Status code: 401

@github-actions github-actions bot removed the stale label Dec 14, 2024
@mpepping
Copy link

mpepping commented Dec 23, 2024

The logging shows that the issue is in running the ha --no-progress core check command. That fails and breaks out of this if: https://github.com/home-assistant/addons/blob/master/git_pull/data/run.sh#L182

The ha command fails because of a missing SUPERVISOR_TOKEN env variable in the running Git add-on container, or at least for the shell running run.sh.

[core-ssh config]$ unset SUPERVISOR_TOKEN
[core-ssh config]$ ha --no-progress core check
ERRO[0000] Unexpected server response. Status code: 401
Unexpected server response. Status code: 401

Not sure on the direction on how to fix this. The Git add-on is the only container that I could find that runs the ha command from a shell script. The SSH add-on sets up a shell env. that contains a valid SUPERVISOR_TOKEN environment variable. Something similar must be added here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants