Bug 422001 - KF5 5.70.0 regression: Dolphin shows same SMB share twice
Summary: KF5 5.70.0 regression: Dolphin shows same SMB share twice
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Samba (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-24 04:38 UTC by S
Modified: 2020-06-08 09:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 20.08
Sentry Crash Report:


Attachments
same device appears twice in Tumbleweed (31.67 KB, image/png)
2020-05-24 04:39 UTC, S
Details
same device appears twice in Tumbleweed (31.67 KB, image/png)
2020-05-24 04:39 UTC, S
Details
Only 1 resource as expected in Leap 15.2 beta (53.50 KB, image/png)
2020-05-24 04:40 UTC, S
Details
KIO logs (4.23 KB, text/plain)
2020-05-25 12:52 UTC, S
Details
libsmbclient logs (11.12 KB, text/plain)
2020-05-25 12:52 UTC, S
Details
KIO log from openSUSE Leap 15.2, which only shows the .local name (2.45 KB, text/x-log)
2020-05-25 13:36 UTC, S
Details
libsmbclient log from openSUSE Leap 15.2, which only shows the .local name (9.79 KB, text/x-log)
2020-05-25 13:36 UTC, S
Details

Note You need to log in before you can comment on or make changes to this bug.
Description S 2020-05-24 04:38:31 UTC
Hi there, this appears to be a slight new bug introduced in KDE Frameworks 5.70.0 on openSUSE Tumbleweed. My NAS is named "OpenMediaVault", and in Dolphin smb:// it normally appears as "OpenMediaVault - SMB/CIFS". But since Tumbleweed upgraded from KDE Frameworks 5.69.0 -> 5.70.0 it started appearing twice as:
OpenMediaVault - SMB/CIFS
OPENMEDIAVAULT
They both lead to the exact same Zeroconf host-- "smb://openmediavault.local/"
I tried renaming my NAS to "OMV", but it still showed twice:
OMV - SMB/CIFS
OMV

This bug appears to be specific to something in KF5, as I tested the latest Tumbleweed live ISO with Gnome, and this bug does not happen in Nautilus with all the other Avahi and samba-client packages being at the same version. Then I tested the latest openSUSE Leap 15.2 beta with KDE Frameworks 5.69.0, and this bug doesn't occur. I also am sure it didn't occur on my installed system when it was running KF5 5.69.0.

Here are the relevant version from the Leap 15.2 beta that does *not* exhibit this bug:
Operating System: openSUSE Leap 15.2
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.12.7
Kernel Version: 5.3.18-lp152.13-default

And *with* the bug:
Operating System: openSUSE Tumbleweed 20200519
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.1
Kernel Version: 5.6.12
Comment 1 S 2020-05-24 04:39:06 UTC
Created attachment 128736 [details]
same device appears twice in Tumbleweed
Comment 2 S 2020-05-24 04:39:43 UTC
Created attachment 128737 [details]
same device appears twice in Tumbleweed
Comment 3 S 2020-05-24 04:40:24 UTC
Created attachment 128738 [details]
Only 1 resource as expected in Leap 15.2 beta
Comment 4 Harald Sitter 2020-05-24 20:25:23 UTC
one is discovered over netbios/smb1. the other is discovered over dnssd.
server-side comments impact the entry name for netbios/smb1 and that's why there's two entries. the 'SMB/CIFS' comment makes the name different and because of that we simply don't know that they are the same remote. (that said, I'm not sure they would be the de-duplicated either way in 20.04 because of how NB and DNSSD interact with each other - bug #421624)
Comment 5 S 2020-05-25 02:50:58 UTC
Thanks for looking into this.

It appears I was wrong about this being a problem limited to Dolphin / KIO. This is what I discovered:

- Tumbleweed KDE, KF5 5.70.0 --> *duplicates*
- openSUSE Leap 15.2 beta, KF5 5.69.0 --> no duplicates
- Fedora 32 KDE, KF5 5.68.0 --> no duplicates
- Fedora 32 Gnome 3.34 w/ Nautilus --> no duplicates
- Ubuntu 20.04 Gnome 3.34 w/ Nautilus --> *duplicates*

So I can't seem to find any rhyme or reason as to why some distros manifest this bug and others don't.
Comment 7 S 2020-05-25 12:51:28 UTC
@Harald Sitter Thanks for the link on how to log this stuff. I am attaching the requested information.

To my untrained eye, it looks like maybe KIO is pulling the new style .local name from Avahi, whereas libsmbclient is finding the old NetBIOS name.

libsmbclient0 version on Tumbleweed: 4.12.2+git.152.c5bf9f6da52
Comment 8 S 2020-05-25 12:52:29 UTC
Created attachment 128766 [details]
KIO logs
Comment 9 S 2020-05-25 12:52:50 UTC
Created attachment 128767 [details]
libsmbclient logs
Comment 10 Harald Sitter 2020-05-25 13:31:13 UTC
"OpenMediaVault - SMB/CIFS" is discovered through DNSSD while "OPENMEDIAVAULT" is discovered through WS-Discovery.
Which brings me back to my point that since they have different names we consider them different entities.

Perhaps you should raise this with the openmediavault devs instead? This would be easily solved if the names on DNSSD and WSD were the same. Having divergent names for the same service entity is peculiar at the best of times.
Comment 11 S 2020-05-25 13:36:28 UTC
Created attachment 128768 [details]
KIO log from openSUSE Leap 15.2, which only shows the .local name
Comment 12 S 2020-05-25 13:36:48 UTC
Created attachment 128769 [details]
libsmbclient log from openSUSE Leap 15.2, which only shows the .local name
Comment 13 S 2020-05-25 13:39:04 UTC
(In reply to Harald Sitter from comment #10)
> "OpenMediaVault - SMB/CIFS" is discovered through DNSSD while
> "OPENMEDIAVAULT" is discovered through WS-Discovery.
> Which brings me back to my point that since they have different names we
> consider them different entities.
> 
> Perhaps you should raise this with the openmediavault devs instead? This
> would be easily solved if the names on DNSSD and WSD were the same. Having
> divergent names for the same service entity is peculiar at the best of times.

Yeah, I don't disagree. But then why doesn't this bug appear in Leap 15.2? There, libsmbclient also knows about "OPENMEDIAVAULT", but it doesn't appear in Dolphin.
Comment 14 Harald Sitter 2020-05-25 14:46:54 UTC
You'll have to ask opensuse. Presumably leap doesn't have a ws-discovery enabled kio-extras. What libsmbclient sees on a netbios boradcast doesn't matter for your specific case. It'd only apply to SMB1 discovery but in your case the discoveries come in through dnssd and wsd and both of those sit on top of libsmbclient/netbios.
Comment 15 S 2020-05-25 15:22:20 UTC
(In reply to Harald Sitter from comment #10)

> Perhaps you should raise this with the openmediavault devs instead? This
> would be easily solved if the names on DNSSD and WSD were the same. Having
> divergent names for the same service entity is peculiar at the best of times.

Here is the OpenMediaVault dev's take on that suggestion:
https://github.com/openmediavault/openmediavault/issues/718#issuecomment-633617849
Comment 16 Harald Sitter 2020-06-08 09:04:35 UTC
Git commit c29d0d12f6f3ce0f903b9858672c61ffe8f8c837 by Harald Sitter.
Committed on 08/06/2020 at 09:04.
Pushed by sitter into branch 'master'.

smb: make duplicate detection case-insensitive

this does cover more dupes and is more in line with how windows would
behave (what with it being case insensitive in general)

M  +6    -1    smb/kio_smb_browse.cpp

https://invent.kde.org/network/kio-extras/commit/c29d0d12f6f3ce0f903b9858672c61ffe8f8c837
Comment 17 Harald Sitter 2020-06-08 09:07:24 UTC
I'm marking this fixed but it isn't exactly.
The problem is that OMV sets this `- SMB/CIFS` suffix on avahi when wsdd doesn't have the suffix set and that simply renders the two services different for our purposes.