Giter Club home page Giter Club logo

Comments (13)

home-assistant avatar home-assistant commented on June 29, 2024

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

Code owner commands

Code owners of samsungtv 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 samsungtv 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)


samsungtv documentation
samsungtv source
(message by IssueLinks)

from core.

epenet avatar epenet commented on June 29, 2024

Did you try to restart Home Assistant?

The log you provided does not show the "migration failure"... it only shows the inability to remove a device from the frontend.
Can you please send the full log, showing the migration failures?

from core.

war4peace avatar war4peace commented on June 29, 2024

Yes, I had restarted HA.
I just restarted it again to capture the relevant log entries once more:

Logger: homeassistant.config_entries
Source: config_entries.py:927
First occurred: 16:35:26 (2 occurrences)
Last logged: 16:35:26

Error migrating entry TV Sufragerie Parter for samsungtv
Error migrating entry TV Sufragerie Sus for samsungtv
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 927, in async_migrate
result = await component.async_migrate_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/samsungtv/init.py", line 307, in async_migrate_entry
dev_reg.async_update_device(
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 921, in async_update_device
self.devices[device_id] = new
~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 42, in setitem
self._unindex_entry(key, entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 543, in _unindex_entry
super()._unindex_entry(key, replacement_entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 482, in _unindex_entry
del self._connections[connection]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ('mac', 'none')

There are two more "samsungtv" log entries, pasted below:

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:600
integration: Media player (documentation, issues)
First occurred: 16:35:37 (1 occurrences)
Last logged: 16:35:37

Error adding entity None for domain media_player with platform samsungtv
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 772, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 760, in async_get_or_create
device = self.async_update_device(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 921, in async_update_device
self.devices[device_id] = new
~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 42, in setitem
self._unindex_entry(key, entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 537, in _unindex_entry
self._unindex_entry_value(key, area_id, self._area_id_index)
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 56, in _unindex_entry_value
del entries[key]
~~~~~~~^^^^^
KeyError: '3fd42be33f01943ae6f4a2046efc7a22'

Logger: homeassistant.components.remote
Source: helpers/entity_platform.py:600
integration: Remote (documentation, issues)
First occurred: 16:35:37 (1 occurrences)
Last logged: 16:35:37

Error adding entity None for domain remote with platform samsungtv
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 772, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 760, in async_get_or_create
device = self.async_update_device(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 921, in async_update_device
self.devices[device_id] = new
~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 42, in setitem
self._unindex_entry(key, entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 537, in _unindex_entry
self._unindex_entry_value(key, area_id, self._area_id_index)
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 56, in _unindex_entry_value
del entries[key]
~~~~~~~^^^^^
KeyError: '3fd42be33f01943ae6f4a2046efc7a22'

from core.

epenet avatar epenet commented on June 29, 2024

I'm not sure how I can replicate this - I assume the issue is that you have multiple entries that need migrating, and the migrations clash somehow with each-other.

Are you OK to send across your config/.storage/core.device_registry file ?
Please note that I'm not sure if there is anything that should be redacted in the file - so you can remove non-samsung related entries

from core.

war4peace avatar war4peace commented on June 29, 2024

Of course.

I have removed irrelevant entries.
Please note some of the entries in the "deleted" area are Google Chromecast devices, however it's a bit difficult for me to figure out which is which in the file.
Also, I should point out the structure itself is a bit off, due to entry removals (indentations are not 100% well kept).

core.device_registry_truncated.txt

Let me know if you need further information.

I am fine with removing all devices in the integration and adding them back, one by one, although right now this doesn't seem possible from the UI due to stuck unconfigured entries.

from core.

snigehere avatar snigehere commented on June 29, 2024

I have the same issue showing up

I have two samsung TV's and one is showing this error

image

Logger: homeassistant.config_entries
Source: config_entries.py:927
First occurred: 17:04:50 (1 occurrences)
Last logged: 17:04:50

Error migrating entry kitchen TV for samsungtv
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 927, in async_migrate
result = await component.async_migrate_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/samsungtv/init.py", line 307, in async_migrate_entry
dev_reg.async_update_device(
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 921, in async_update_device
self.devices[device_id] = new
~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/registry.py", line 42, in setitem
self._unindex_entry(key, entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 543, in _unindex_entry
super()._unindex_entry(key, replacement_entry)
File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 482, in _unindex_entry
del self._connections[connection]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ('mac', 'none')

from core.

epenet avatar epenet commented on June 29, 2024

Please post your storage file also
I will try to take a look on Monday

from core.

snigehere avatar snigehere commented on June 29, 2024

Attached the cut down file with other stuff removed ... if you do need the whole file please message me and I can send it direct to you rather than posting on an open forum

Hope this is what you needed.
core.device_registry_cut down.txt

from core.

epenet avatar epenet commented on June 29, 2024

I am unable to replicate the issue with truncated device registries.

Can you please send me the full logs and the full device_registry via discord?
My Discord username is "e.penet"

from core.

snigehere avatar snigehere commented on June 29, 2024

@epenet sent a friend request as discord will not allow me to send a dm - I get Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends.

from core.

epenet avatar epenet commented on June 29, 2024

There is an issue with device registry corruption. This is being looked at in #119249

In the meantime, #119234 was merged which reverts the migration/cleanup process so it no longer blocks.
This will be available as part of 2024.6.2 via #119376

from core.

chemelli74 avatar chemelli74 commented on June 29, 2024

@war4peace can you recheck the situation with 2024.6.4 please ?

from core.

war4peace avatar war4peace commented on June 29, 2024

I have installed 2024.6.4 earlier.
The integration shows no errors, but one of the entries in the list is still mixed up.
Now, I admit not being sure whether that was the case before as well, but I can't remove that entry, nor can I adjust it in any way.
image

That entry has 4 devices in it, which are 4 different TVs, and those TVs are all mine. For some reason, they are all under the same entry.
image

I will list their details from that entry in the order they are shown.

  1. "Samsung 5 Series (32)": UE32T5372AUXXH
    It has 2x MAC addresses:
    MAC: 68:72:C3:E9:44:3D
    MAC: 68:72:C3:49:DB:6C
  2. "Sufragerie parter": UE43NU7402
    MAC: CC:6E:A4:CE:9A:5E
  3. "TV Bucatarie Sus": UE32T5302AKXXH
    It also has 2x MAC addresses:
    MAC: 5C:C1:D7:01:42:DA
    MAC: F4:FE:FB:78:D8:A6
  4. "TV Dormitor Sus": UE40NU7122
    MAC: 64:1C:B0:F4:89:1B

The other entries have 1x TV each:

  • "TV Bucatarie Sus": UE32T5302AKXXH - this is the same TV as the third one in the first entry presented above, with the same 2x MAC addresses:
    MAC: 5C:C1:D7:01:42:DA
    MAC: F4:FE:FB:78:D8:A6
    Its entry appears doubled in the Samsung Smart TFV integration:
    image

  • "Samsung AU7172 65 TV": UE65AU7172UXXH - A standalone entry, not doubled above, but it has 3x MAC addresses:
    MAC: NONE
    MAC: 8C:EA:48:79:E3:20
    MAC: 54:3A:D6:95:05:55

  • "TV Dormitor Sus": UE40NU7122 - this is the same TV as entry 4 in the multiple entry item at the top. One MAC address:
    MAC: 64:1C:B0:F4:89:1B

  • "TV Sufragerie Jos" - UE75AU7172UXXH - Another standalone entry, not duplicated, but it has 2x MAC addresses:
    MAC: A0:D7:F3:9F:1A:62
    MAC: 54:44:A3:25:24:4C

Now, I looked into my router configuration to extract all my TVs' MAC addresses:

  1. UE40NU7122 - MAC address: 64:1c:b0:f4:89:1b
  2. UE43NU7402 - MAC address: cc:6e:a4:ce:9a:5e
  3. UE32T5372AUXXH - MAC Address: 68:72:c3:e9:44:3d
  4. UE32T5302AKXXH - MAC address: f4:fe:fb:78:d8:a6
  5. UE65AU7172UXXH - MAC address: 8c:ea:48:79:e3:20
  6. UE75AU7172UXXH - MAC address: a0:d7:f3:9f:1a:62

Not sure if all this information helps, my question would be whether it is possible to clean up the integration on my installation. I am OK with removing the integration completely and then adding the TVs one by one, manually. Or if you'd like me to perform more testing, etc., please let me know. I offer myself as a lab rat :)

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.