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

Unable to use services integration with supervisor API #32798

Open
KenethRE opened this issue May 15, 2024 · 0 comments
Open

Unable to use services integration with supervisor API #32798

KenethRE opened this issue May 15, 2024 · 0 comments

Comments

@KenethRE
Copy link

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:

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

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

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

1 participant