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

ClientError http 418, message="I'm a teapot" #159

Closed
geertmeersman opened this issue Dec 14, 2023 · 11 comments
Closed

ClientError http 418, message="I'm a teapot" #159

geertmeersman opened this issue Dec 14, 2023 · 11 comments

Comments

@geertmeersman
Copy link

Hi Rene,

I can't seem to log in anymore and am receiving a http 418 error. The mobile app still seems to work fine.

2023-12-14 10:04:04.868 INFO (MainThread) [custom_components.mbapi2020.oauth] Start request PIN xxxxxxxx@xxxxxx.com
2023-12-14 10:04:04.998 ERROR (MainThread) [custom_components.mbapi2020.oauth] ClientError requesting data from https://bff.emea-prod.mobilesdk.mercedes-benz.com/v1/login: 418, message="I'm a teapot", url=URL('https://bff.emea-prod.mobilesdk.mercedes-benz.com/v1/login')
2023-12-14 10:04:04.998 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mbapi2020/config_flow.py", line 70, in async_step_user
    await client.oauth.request_pin(user_input[CONF_USERNAME], nonce)
  File "/config/custom_components/mbapi2020/oauth.py", line 65, in request_pin
    return await self._async_request("post", url, data=data, headers=headers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mbapi2020/oauth.py", line 225, in _async_request
    raise err
  File "/config/custom_components/mbapi2020/oauth.py", line 221, in _async_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 418, message="I'm a teapot", url=URL('https://bff.emea-prod.mobilesdk.mercedes-benz.com/v1/login')
@harlonjo
Copy link

Mine is not working too

@steuerlexi
Copy link

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht
Mine as well

Logger: custom_components.mbapi2020
Source: custom_components/mbapi2020/init.py:311
Integration: MercedesME 2020 (documentation, issues)
First occurred: 10:18:46 (10 occurrences)
Last logged: 10:26:46

Can't connect to MB APIs; Retrying in background

@ReneNulschDE
Copy link
Owner

Hi, I see this too. Looks like MB changed something in their backends. Let me check.

@ReneNulschDE
Copy link
Owner

ReneNulschDE commented Dec 14, 2023

Master branch code should work again for Europe. Make sure you open the mobile app and agree to the new data protection rules.

I'll try to test the other regions and publish a new version soon.

@SuperMasterPhoenix
Copy link

Works again for EU using master branch. Thank you for this quick fix!

@ReneNulschDE
Copy link
Owner

Non EU endpoints are fixed too.

@kilian-f-za
Copy link

Hello, where can I confirm the new data protection rules? I also have no connection and then I deleted the integration and added it again. Now when I enter the email address it says "Unknown Error occured" and in the logs it says "I'm a teapot".

@steuerlexi
Copy link

Hello, where can I confirm the new data protection rules? I also have no connection and then I deleted the integration and added it again. Now when I enter the email address it says "Unknown Error occured" and in the logs it says "I'm a teapot".

i did exactly the same and have now the "Unknown Error occured". I confirmed the new data protection rules in the Mercedes ME APP on my android. But it fixed nothing.

@ReneNulschDE
Copy link
Owner

ReneNulschDE commented Dec 14, 2023

Please read my comments. You have to update the code based on the latest master branch or wait for the release. I'm just typing the release notes...

@kilian-f-za
Copy link

Thank you. New version is there and works. Thanks for the quick support.

@ReneNulschDE
Copy link
Owner

Solved with v0.9.8

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

No branches or pull requests

6 participants