Bug 312054

Summary: Cannot add a collection on the network in Gnome-based environment
Product: [Applications] digikam Reporter: Martin Melcher <kdebugs>
Component: Setup-CollectionsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: axel.krebs, caulier.gilles, james, jrussell_88, peter.szaszvari, piotr, puetz-tobias, xelzifesch
Priority: NOR    
Version: 2.5.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.4.0
Sentry Crash Report:

Description Martin Melcher 2012-12-21 20:46:26 UTC
I'm using Linux Mint which is a gnome-based environment. I have installed a lot of kde libs, so basically digiKam is running.

My photos are on a file server which I can access through smb and sftp. Using Dolphin I can access that folder (both smb and sftp work, so I assume the necessary kio libs are installed).
The database is running on a shared mysql on that same server.

When I try to add the photo directory as a "collection on network share", I can select that directory. The shown path is "sftp://martin@srv0.example:2220/home/shared/Fotos" or "smb://martin@srv0/shared/Fotos".
I can browse the folder's contents with both protocols using the file selector dialog.

When I click OK, the file selector dialog closes but the path is not added to the list of collections.
No output is written to stdout/stderr in that case. The only output is written on startup:

QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work.
digikam(3152)/kdeui (kdelibs): Attempt to use QAction "" with KXMLGUIFactory!

I think this is not related.

I can add that folder through gvfs (not natively but through the legacy mount point):
"/home/martin/.gvfs/shared on srv0/Fotos"
gvfs is the gnome equivalent of kio. This is not an option for me, as this path is different for different users and from different machines.


Reproducible: Always

Steps to Reproduce:
1. Use Linux Mint (or probaby any other Gnome-based desktop), many KDE-libs an Dolphin are installed.
2. Put photos on a network share via smb or sftp
3. Check that the share can be reached/browsed with Dolphin
4. Configure photo database through mysql on server
5. Select folder (sftp or smb) as a collection on network share.
6. Click OK
Actual Results:  
The folder is not added to the list of collections.
The folder is not scanned for photos.


Expected Results:  
The folder is listed as a collection with the path I had chosen (e.g. "sftp://martin@srv0.example:2220/home/shared/Fotos" or "smb://martin@srv0/shared/Fotos")

The photos from that folder are added to digiKam.
The share is accessible for all networked users (using the same database, provided that they can access that shared folder)
Comment 1 John 2012-12-30 16:26:18 UTC
I have the same issue:
Digikam 2.50
Ubuntu 12.04
Database and images on a local folder
I cannot add a collection on an empty shared samba network folder (smb) to which I have read/write access and which I can view via Nautilus.

From Digikam I select the folder and add it, but it doesn't appear in the list of collections or albums.
Comment 2 John 2012-12-30 18:38:08 UTC
I just upgraded to Digikam 2.80 - exactly the same ridiculous problem.
Comment 3 Marcel Wiesweg 2012-12-30 19:12:33 UTC
Collections must be mounted natively, virtual filesystems like kio cannot work. There should be an error message though.
Comment 4 John 2012-12-30 19:50:48 UTC
The 'Collections Settings' dialogue offers 'Collections on Network Shares' as one of three options with an 'Add Collection' button. 

What network file system should I use to mount shares natively?
Comment 5 caulier.gilles 2012-12-30 22:20:59 UTC
>What network file system should I use to mount shares natively?

Network file system, as NFS or Samba...

Gilles Caulier
Comment 6 Martin Melcher 2012-12-31 00:03:24 UTC
(In reply to comment #5)
> >What network file system should I use to mount shares natively?
> Network file system, as NFS or Samba...

So, if I mount my collection natively, why would I need a separate option to select a network share. Does digikam behave any different from a local collection (e.g. detection if this collection is offline, tolerant towards different paths to the same collection for different users)?

Would it be so bothersome to support virtual filesystems? A component named "kioslave" already exists - at least within this bug tracker. This suggests that there might already exist some relevant code. Or am I mistaken?

Martin Melcher
Comment 7 John 2012-12-31 04:07:41 UTC
NFS isn't available on this file server; it's a Samba server - surely SMB is Samba?
Comment 8 caulier.gilles 2012-12-31 09:51:24 UTC
yes, smb = SAMBA

Gilles Caulier
Comment 9 John 2012-12-31 11:54:56 UTC
That's what I thought - I am using Samba to connect to my network share in Digikam's Settings - Configure Digikam - Collections menu. 

This shows Local Collections, Collections in Removable Media, and Collections on Network Shares. The Add Collections button for Network Shares brings up a network connections dialogue box for Samba shares ('Choose the folder containing your collection') - I select my Samba server and enter my username and password. I navigate to a folder on the server; select OK. The network address shows: 'smb://servername/Public/myname/Pictures'. I click OK; the dialogue box closes and.... nothing. There is no connection to the server under 'Network Shares'.

This seems like a problem to me. 

I've also set up an automounted CIFS/Samba mount point for the server on my machine (using cifs-utils and an fstab entry), with which I have repeated the process. Digikam allows me to set up the collection as a Network Share, and lists it in Collection Settings - Root Album Folders. But it doesn't show up under 'My Albums' in the main viewing screen and I can't see a way to access it via Digikam. 

Am I missing something here? 

Any help would be much appreciated!
Comment 10 John 2012-12-31 12:03:29 UTC
I notice that whereas the local collection has a tick next to it in Settings, the network collection has a greyed-out plug and mousing over it raises a tooltip message 'This collection is currently not available.' 

It is mounted and browsable from Nautilus.
Comment 11 Marcel Wiesweg 2012-12-31 12:53:35 UTC
> So, if I mount my collection natively, why would I need a separate option to
> select a network share. Does digikam behave any different from a local
> collection (e.g. detection if this collection is offline, tolerant towards
> different paths to the same collection for different users)?

On Linux, the network mount is just a path somewhere. We must not check the associated hardware. We currently dont have code which detects that a given directory is a mount point, for Linux, nor for any other platform. That's why there's the different way to add a network share. Detection for offline/online is simply done by checking if the path is empty or not.

> Would it be so bothersome to support virtual filesystems? A component named
> "kioslave" already exists - at least within this bug tracker. This suggests
> that there might already exist some relevant code. Or am I mistaken?

The virtual filesystems of the desktop environments are high-level. For any low-level access: reading metadata, producing a thumbnail, showing or editing the picture, the file would need to be downloaded and placed in a temporary destination, not because digikam cannot handle all this, but because the underlying libraries need native file pointers.
There are projects like kiofuse which could help in this process, but for cases where the kernel supports native mounting, without the redirection fuse -> kio, I would recommend to take this way, it is certainly faster.
Comment 12 John 2013-01-01 03:47:29 UTC
(In reply to comment #11)

> On Linux, the network mount is just a path somewhere. We must not check the
> associated hardware. We currently dont have code which detects that a given
> directory is a mount point, for Linux, nor for any other platform. That's
> why there's the different way to add a network share. Detection for
> offline/online is simply done by checking if the path is empty or not.

I intended to use Digikam to import images from a memory card and organise them on the network folder; the logic of your online/offline test mitigates against this. 

However I had placed an image file on the network folder before getting the tooltip message 'This collection is currently not available.' so the online/offline detection doesn't appear to be working as intended.
Comment 13 John 2013-01-02 16:06:22 UTC
After an overnight delay, Digikam recognised the Samba/CIFS local mount point  of the network folder with an image in it. 

I couldn't find a way to force refresh of the Collections, but Digikam does recognise a network folder if there is a file in the folder before the Collection is created. It's just slow to adjust if the image is added later.

I still can't get the Samba network folders New Collection working though.
Comment 14 Edward 2013-09-16 09:04:28 UTC
Have the same problem. After adding new smb: folder as a collection nothing happens and there is no new collection in the main screen of the program. 

Please, someone, it has been a year form the time the bug was submitted and it has a status "UNCONFIRMED".

I run Version 3.1.0
Using KDE Development Platform 4.10.5 and Ubuntu 13.04.
Comment 15 caulier.gilles 2014-01-16 13:56:19 UTC
*** Bug 329921 has been marked as a duplicate of this bug. ***
Comment 16 Felix Zesch 2014-07-23 13:12:08 UTC
I can confirm the same behavior, unable to use a collection on my nas. What needs to be done to change the status of this bug from unconfirmed to confirmed?
Comment 17 james@canyon.uk.com 2014-10-20 14:41:44 UTC
I confirm this bug also.
I'm using Linux Mint 17 Cinnamon with the new version of digKam (version 4.4). Everything else seems to work OK.
My photo collection is on an SMB share on a Synology server.
I have spent a couple of weeks getting to know digiKam using copies of some folders on my local PC. Now I'm trying to 'go live' by importing my main photo library from my network server, and I can't.
Can I add my voice to ask that this bug be status be changed to 'Confirmed'?
Comment 18 Petyo 2016-04-23 11:35:57 UTC
Still the same. For me it is useless this way. Nobody seems to care.
Comment 19 Tobs 2016-07-26 18:53:28 UTC
Hi,
I am having a Gnome environment as well on Fedora 24. 
It seem to be different if you use a samba share in Gnome or KDE.

I have got a work around which let me use a samba share for my Database and my photos.

Install with your favorite software package program a KDE package called " Smb4k"
You can use this to create a network shortcut in "/home/YourUserName/smb4k/YourSambaShare/..." this path you can copy and paste into your digikam database location field.
cheers
Tobs
Comment 20 caulier.gilles 2016-07-28 09:00:24 UTC
Tobs,

Following your tips from comments #19, can we considerate this workaround as a solution to close this file ?

Gilles Caulier
Comment 21 caulier.gilles 2016-11-26 10:03:42 UTC
Tobs, 

Do you see my previous comment ?

Gilles Caulier
Comment 22 Tobs 2016-12-09 11:58:06 UTC
Gilles,
for me it's fine to close the file.
Regards
Tobs