home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.26k stars 28.47k forks source link

Change my Plex server IP in integration #117348

Open Mamouti opened 2 weeks ago

Mamouti commented 2 weeks ago

The problem

I migrated my Plex to another server with another IP address. In HA my Plex integration is (obviously) no longer working. I would like to reconfigure it with the new IP but each time I click on "Configure" I get "500 Internal Server Error Server got itself in trouble": image

Trying to disable/re-enable doesn't help. I'd like to avoid deleting and recreating the integration, which would break my devices names and thus my automations.

What version of Home Assistant Core has the issue?

core-2024.4.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

plex

Link to integration documentation on our website

https://www.home-assistant.io/integrations/plex/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-05-13 08:57:53.377 DEBUG (SyncWorker_41) [plexapi] GET http://192.168.2.100:32400/ 2024-05-13 08:57:56.042 DEBUG (SyncWorker_4) [plexapi] GET http://192.168.2.100:32400/ File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 368, in async_step_init return await self.async_step_plex_mp_settings() File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 372, in async_step_plex_mp_settings plex_server = get_plex_server(self.hass, self.server_id) File "/usr/src/homeassistant/homeassistant/components/plex/helpers.py", line 36, in get_plex_server return get_plex_data(hass)[SERVERS][server_id]

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @jjlawren, mind taking a look at this issue as it has been labeled with an integration (plex) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `plex` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign plex` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


plex documentation plex source (message by IssueLinks)

joostlek commented 2 weeks ago

What's in the logs?

Mamouti commented 2 weeks ago

What's in the logs?

I updated my post with some logs I found, but I'm not sure it is interesting enough.

joostlek commented 2 weeks ago

They're not complete, but they are helpful

Mamouti commented 2 weeks ago

I also found this occurring when trying to Configure the integration:

Enregistreur: aiohttp.server Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421 S'est produit pour la première fois: 09:57:10 (5 occurrences) Dernier enregistrement: 09:57:39 Error handling request

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/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 88, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, 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 71, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 262, in post return await super().post(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 77, in post return await self._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/data_entry_flow.py", line 343, in async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 506, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 368, in async_step_init return await self.async_step_plex_mp_settings() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/plex/config_flow.py", line 372, in async_step_plex_mp_settings plex_server = get_plex_server(self.hass, self.server_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/plex/helpers.py", line 36, in get_plex_server return get_plex_data(hass)[SERVERS][server_id]


KeyError: '80ebef5f16a14f08bf834d2ab31e82eeb547fc44'
Mamouti commented 2 weeks ago

I found a workaround by directly editing the file _core.configentries in the .storage folder: image

I leave the issue open as you might want to implement a fix for that error 500.