You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to develop an addon that needs to access mqtt service information, however I always get a forbidden error whenever I try to access the /services/mqtt endpoint. I attempted to access it using the homeassistant SUPERVISOR_TOKEN instead and received the following error message:
curl -v -sSL -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/services/mqtt
* Host supervisor:80 was resolved.
* IPv6: (none)
* IPv4: 172.30.32.2
* Trying 172.30.32.2:80...
* Connected to supervisor (172.30.32.2) port 80
> GET /services/mqtt HTTP/1.1
> Host: supervisor
> User-Agent: curl/8.5.0
> Accept: */*
> Authorization: Bearer
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< Content-Length: 1755
< Date: Wed, 15 May 2024 21:03:49 GMT
< Server: Python/3.12 aiohttp/3.9.5
< Connection: close
<
500 Internal Server Error
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 189, in block_bad_requests
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 205, in system_validation
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 272, in token_validation
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/middleware/security.py", line 283, in core_proxy
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/utils.py", line 63, in wrap_api
answer = await method(api, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/supervisor/supervisor/api/services.py", line 58, in get_service
_check_access(request, service.slug)
File "/usr/src/supervisor/supervisor/api/services.py", line 78, in _check_access
if not addon.services_role.get(service):
^^^^^^^^^^^^^^^^^^^
AttributeError: 'HomeAssistant' object has no attribute 'services_role'
* Closing connection
Feedback
I am trying to develop an addon that needs to access mqtt service information, however I always get a forbidden error whenever I try to access the /services/mqtt endpoint. I attempted to access it using the homeassistant SUPERVISOR_TOKEN instead and received the following error message:
I am not sure how to proceed at this point.
URL
https://www.home-assistant.io/help/reporting_issues/
Version
2024.5.3
Additional information
No response
The text was updated successfully, but these errors were encountered: