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

cannot change settings in 4.7.5 #359

Closed
r100gs opened this issue Nov 7, 2022 · 71 comments
Closed

cannot change settings in 4.7.5 #359

r100gs opened this issue Nov 7, 2022 · 71 comments

Comments

@r100gs
Copy link

r100gs commented Nov 7, 2022

Problem/Motivation

change settings on webpage

(Why the issue was filed)
get error

Expected behavior

set or remove hook

(What you expected to happen)
cann klick and set hook or remove

Actual behavior

get error

(What actually happened)
get a red error
2022/11/07 16:53:19.228542 [error] POST 192.168.xx.xx:8123 /control/safebrowsing/enable: empty body with content-type "application/octet-stream" not allowed

Steps to reproduce

go to allgemeine einstellungen try to change settings

(How can someone else make/see it happen)
see above

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

I tried with HA 2022.10.5 and 2022.11.1, was working in 4.7.4

image

@stevnhoved
Copy link

I get the same error when clearing query log or statistics

  • Error: control/querylog_clear | empty body with content-type "application/octet-stream" not allowed | 415
  • Error: control/stats_reset | empty body with content-type "application/octet-stream" not allowed | 415

@itsboo07
Copy link

itsboo07 commented Nov 7, 2022

same here after updating

@bakito
Copy link

bakito commented Nov 8, 2022

I'm also facing some content-type issues with 4.7.5 in the adguardhome-sync tool. bakito/adguardhome-sync#121
Here the issue is, that the content-type of apu json requests is now text/plain; charset=utf-8 instead of application/json.
As it also has to do with content-type, it might be related.
4.7.4 was working fine.

@bakito
Copy link

bakito commented Nov 8, 2022

There seems to be an issue in adguardhome itself.
AdguardTeam/AdGuardHome#5116

@junado
Copy link

junado commented Nov 9, 2022

Updated to 2022.11.2 and the issue is still there. I'm running a new install of AdGuard on the latest HA.

System Information

version core-2022.11.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.15.61-v8
arch aarch64
timezone America/Toronto
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.28.3
Stage running
Available Repositories 1140
Downloaded Repositories 21
Home Assistant Cloud
logged_in true
subscription_expiration 1 décembre 2022 à 19:00
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
remote_server us-east-1-3.ui.nabu.casa
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 9.3
update_channel stable
supervisor_version supervisor-2022.10.2
agent_version 1.4.1
docker_version 20.10.18
disk_total 219.4 GB
disk_used 83.0 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Studio Code Server (5.4.0), ESPHome (2022.10.2), SSH & Web Terminal (12.1.2), SQLite Web (3.6.1), Terminal & SSH (9.6.1), InfluxDB (4.5.0), Grafana (8.0.2), AirCast (3.5.0), Home Assistant Google Drive Backup (0.109.1), AdGuard Home (4.7.5), Samba share (10.0.0)
Dashboards
dashboards 1
resources 14
views 4
mode storage
Recorder
oldest_recorder_run 31 octobre 2022 à 18:24
current_recorder_run 9 novembre 2022 à 08:56
estimated_db_size 666.28 MiB
database_engine sqlite
database_version 3.38.5
Spotify
api_endpoint_reachable ok

@snapsl
Copy link

snapsl commented Nov 9, 2022

v0.107.15 introduced a new content type policy. I think this causes the problem.
(https://github.com/AdguardTeam/AdGuardHome/releases/tag/v0.107.15)

Here

default_type application/octet-stream;

@sysadmin-info
Copy link

sysadmin-info commented Nov 10, 2022

I have exactly the same issue. I cannot clear the cache in Adguard Home Addon in Home Assistant Supervised version:
Home Assistant 2022.11.2
Supervisor 2022.10.2
Frontend 20221108.0 - latest
Error:
Error: control/stats_reset | empty body with content-type "application/octet-stream" not allowed | 415
Adguard Home Addon for Home Assistant Supervised: Version: v0.107.17

@stevnhoved
Copy link

stevnhoved commented Nov 10, 2022

The problem also has an affect1 on the integration
The following switches just flips back again.

image

@hall757
Copy link

hall757 commented Nov 10, 2022

This seems to be a UI issue. I can enable/disable the features with curl after I extract my auth cookie and the exact URL from my browser session.

curl -H content-type:application/json \
     -H cookie:ingress_session=extracted_from_authenticated_browser_session  \
     -X POST http://myhost:8123/api/hassio_ingress/session_id/control/safebrowsing/enable \
     -d "{}"

The parts missing from the UI are a content-type of application/json and an empty json payload (which is different than an empty payload).

@21Development
Copy link

I'm having the same issue. Is there anything you need to help reproduce / fix?

@whwar9739
Copy link

I did find that if I update the Web interface port to be available:
image

and I navigated to https://homeassistant.local:3000/ and logged in with my HA credentials that I can then change the settings without issue.

image

@itsboo07
Copy link

itsboo07 commented Nov 11, 2022

@whwar9739 nice catch.. this works for now... looks like default tcp is broken with update or ha using the default tcp port

@21Development
Copy link

This issue doesnt seem to be assigned to anyone and the Adguard team closed it as invalid AdguardTeam/AdGuardHome#5116 - @frenck as your listed on the HA addon page, can you help? Where should this issue be posted to get resolved?

@KruseLuds
Copy link

#5116 still applies it is just marked as a dupe of this one; I did a search for nginx.conf on my machine and found several which had this line:

default_type        application/octet-stream;

I changed them al to:

default_type        plain/text;

restarted HA, got the same error messages about not being able to turn on the three check as listed in my issue, then rebooted the rpi and still had the same issue, then looked again in the nginx.conf files and they had all changed back to "application/octet-stream;"

@hall757
Copy link

hall757 commented Nov 14, 2022

As I posted a few days ago, this can be fixed in the UI. Instead of relying on default content types, the javascript that makes the api call needs to explicitly set the content type to "application/json" AND send an empty json payload of "{}". I was able to reproduce the failure using defaults and a success using the above changes. If the adguard team doesn't care about supporting the product behind a proxy, I can understand why the would close the case. For me, I know how to correctly make the api call and can deal with the minor inconvenience.

@sysadmin-info
Copy link

sysadmin-info commented Nov 15, 2022 via email

@itsboo07
Copy link

@hall757 can you elaborate how to fix the issue you mentioned above?

@hall757
Copy link

hall757 commented Nov 15, 2022 via email

@daverupe
Copy link

So is anyone looking into fixing this issue? I have the same problem.

@hall757
Copy link

hall757 commented Nov 16, 2022 via email

@zeerox72
Copy link

I have the same problem.
Dear @hall757 or anyone else, can you provide a step by step solution, please?

Best regards
Marko M.

@kcb064

This comment was marked as off-topic.

@PCServices2

This comment was marked as off-topic.

@fokcuk

This comment was marked as off-topic.

@KruseLuds

This comment was marked as off-topic.

@dav-par
Copy link

dav-par commented Nov 20, 2022

I did find that if I update the Web interface port to be available: image

and I navigated to https://homeassistant.local:3000/ and logged in with my HA credentials that I can then change the settings without issue.

image

where are you updating the port? I don't seem to have this menu/setting

@rschuetzler
Copy link

where are you updating the port? I don't seem to have this menu/setting

It's on the Add-on configuration page (https://homeassistant.local:XXXX/hassio/dashboard, click AdGuard Home, then go to the Configuration tab). I had a switch to how disabled ports that showed the Web interface box.

pvizeli pushed a commit to home-assistant/supervisor that referenced this issue Dec 13, 2022
* Do not let aiohttp add a Content-Type header

aiohttp adds a Content-Type header by default, as well as other headers.

This may usually be convenient, but it breaks APIs that explicitly ask for no content type header, for instance on post requests with an empty body.

Since ingress is proxying the requests from the browser to the add-on, it should avoid modifying them.

I only skip this header auto generation because it actually breaks the Adguard add-on.

- hassio-addons/addon-adguard-home#359

I haven't tested this yet.

* Use headers constant
@zeehio
Copy link

zeehio commented Dec 13, 2022

With both pull requests merged, this issue should be fixed by updating to the next (not yet released) home assistant and supervisor releases. Both home assistant core and the supervisor will have to be upgraded.

@frenck
Copy link
Member

frenck commented Dec 13, 2022

Yeah, we discussed it yesterday with some core members. We've merged it now, and are going to put it to the practical test with the upcoming nightly builds. If those do not raise new issues, we will consider marking it for a Core patch release and a next push of the Supervisor.

@frenck
Copy link
Member

frenck commented Dec 14, 2022

The changes upstream have been tested extensively today, it solved this issue and doesn't seem to have any negative effect on other add-ons.

Roll out will start happening soon in both Core & Supervisor releases.

@sysadmin-info
Copy link

sysadmin-info commented Dec 15, 2022 via email

@frenck
Copy link
Member

frenck commented Dec 15, 2022

Home Assistant Core 2022.12.6 contains the fix needed, The Supervisor part of this change/fix is on the beta channel at this moment (as there are more changes in that release).

Once that has been declared stable, the issue should be gone. Expected is maybe this or next week for rollout (depends a bit on how the beta goes).

../Frenck

@stamandr

This comment was marked as off-topic.

@derwotograf

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Dec 19, 2022

@stamandr @derwotograf Correct. As expected. This issue is still open and the path and progress has been explained above (pleas read the issue before responding). Marking your comment as off-topic for that reason.

@stamandr

This comment was marked as outdated.

@KruseLuds

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Dec 28, 2022

@zeehio
Copy link

zeehio commented Dec 28, 2022

Hi @frenck ,

To my understanding the two patches have already been released in the stable channels.

For core, you mentioned Home Assistant Core 2022.12.6 having the patch.

For supervisor, it is listed in the 2022.12.0 release notes:
https://github.com/home-assistant/supervisor/releases/tag/2022.12.0

I verified today and it works on my home assistant os verified instance on my raspberry pi 4.

Is there anything I am missing?

@tjorim
Copy link
Contributor

tjorim commented Dec 28, 2022

@zeehio supervisor version 2022.12.x was only pushed to stable 9 hours ago. home-assistant/version#268. It takes some time to deploy automatically.

@KruseLuds
Copy link

@stamandr @KruseLuds #359 (comment)

I've tested it again and all working normally - so thank you!

@stamandr
Copy link

@stamandr @KruseLuds #359 (comment)

I've tested it again and all working normally - so thank you!

Did you test the Integration controls ?
image

When you turn them off they flip back on

@zeehio
Copy link

zeehio commented Dec 29, 2022

@zeehio supervisor version 2022.12.x was only pushed to stable 9 hours ago. home-assistant/version#268. It takes some time to deploy automatically.

Yes, and both @KruseLuds and @stamandr reported the issue occuring on the patched supervisor and core versions. So something had to be missing.

The home assistant Adguard plugin works now, but the Adguard integration in home assistant core is still broken. Untested PR open at frenck/python-adguardhome#677. I will have limited availability in the following weeks so I won't be able to test that patch.

It will need to be fixed there and the integration dependency will have to be bumped in home assistant core.

@frenck
Copy link
Member

frenck commented Dec 29, 2022

This isn't the repository for the HA integration, anything related to that is off topic here.

@sysadmin-info
Copy link

sysadmin-info commented Dec 29, 2022 via email

@stevnhoved

This comment was marked as off-topic.

@sysadmin-info

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Jan 2, 2023

Alright, both the Home Assistant Core and Supervisor have been adjusted to support the upstream changes of Adguard Home and now handle it well in Ingress.

The Supervisor has been rolled out completely, and should not be automatically available and installed on every system out there. For the Home Assistant part, make sure you run at least 2022.12.6 or newer.

Thanks, @zeehio for finding and addressing the issues upstream 🎖️

Happy New Year 🥂

../Frenck

@frenck frenck closed this as completed Jan 2, 2023
@sysadmin-info

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Jan 7, 2023

@sysadmin-info as stated now many many times before, this is the add-on issue tracker and has nothing to do with the integration. Your comment is fully off-topic and thus hidden.

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

No branches or pull requests