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

Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble #393

Open
nglocanovic94 opened this issue Sep 6, 2024 · 12 comments

Comments

@nglocanovic94
Copy link

nglocanovic94 commented Sep 6, 2024

Hi,

I'm having trouble adding the integration. When adding, the following message appears:
"Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble".

I once had the integration successfully added and configured. Then I wanted to remove some entities of this integration and this was the first time the error message appeared.
I tried to remove the integration and now I cannot add it anymore.

This is what the LOG shows:

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:433
First occurred: 10:39:36 AM (1 occurrences)
Last logged: 10:39:36 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, 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/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post
    return await self._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl
    return await super()._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1296, in async_init
    flow, result = await self._async_init(flow_id, handler, context, data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1331, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 516, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 500, in async_step_user
    schema = build_schema(
             ^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 360, in build_schema
    humidity_sensors = get_sensors_by_device_class(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 309, in get_sensors_by_device_class
    additional_sensors = list(filter(f, additional_sensors))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 114, in filter_useless_domain
    Platform.MAILBOX,
    ^^^^^^^^^^^^^^^^
AttributeError: type object 'Platform' has no attribute 'MAILBOX'`

What else can I do?

Thanks in advance!

@gyik666
Copy link

gyik666 commented Sep 6, 2024

Same here, after upgrading to 2024.09 this happens to me when adding new items.

@ClemensAdrian
Copy link

If you delete the line containing Platform.MAILBOX in ../custom_components/thermal_comfort/config_flow.py it works. Just a temporary hack, my first day using Home Assistant :-)

@nglocanovic94
Copy link
Author

OMG it works! Thanks a lot!
As you said. A temporary fix but at least it works for now!

@suurt8ll
Copy link

suurt8ll commented Sep 7, 2024

I'm having the same issue after upgrading to 2024.09. @ClemensAdrian 's workaround works for now. Thanks!

@jhandschick
Copy link

Same here.

@jhandschick
Copy link

If you delete the line containing Platform.MAILBOX in ../custom_components/thermal_comfort/config_flow.py it works. Just a temporary hack, my first day using Home Assistant :-)

Unfortunately didn't work for me.

@maxx-maurer
Copy link

Same here after upgrading to 2024.09. @ClemensAdrian 's workaround works for now. Thanks!

@conlutio
Copy link

conlutio commented Sep 7, 2024

Thanks, works for me as well.

@jhandschick

Unfortunately didn't work for me.

You did a restart after changing the file?

@jhandschick
Copy link

Thanks, works for me as well.

@jhandschick

Unfortunately didn't work for me.

You did a restart after changing the file?

Thanks that worked. I only restarted the yaml configuration.

@garagara93
Copy link

@ClemensAdrian thank you so much! works for me

@klaushipp
Copy link

Workaround works for me as well.
Thank you

@networxnet
Copy link

networxnet commented Sep 12, 2024

If you delete the line containing Platform.MAILBOX in ../custom_components/thermal_comfort/config_flow.py it works. Just a temporary hack, my first day using Home Assistant :-)

Can't edit configflow.py from HA.

@dolezsa can you fix the code?

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

10 participants