Bug 310106 - MYSQL : try to access to database from two computers and collections get lost
Summary: MYSQL : try to access to database from two computers and collections get lost
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Multiusers (show other bugs)
Version: 2.8.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-14 16:49 UTC by Messie
Modified: 2022-07-17 07:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Messie 2012-11-14 16:49:16 UTC
(I'm new here, please apologize possible mistakes)
I want to use digikam from two different computers, connected in a local network with nfs, with access to one database. So I migrated from SQLite to MySQL, worked fine. 
On Computer 1 I'm using Ubuntu 12.04.1 64-bit with two harddisks:
/dev/sda1: UUID="29c8ca8a-a1ba-4c10-adc0-2538636f1c8a" TYPE="ext4" 
/dev/sda2: UUID="7e36c031-dd05-42d3-9eb2-c10afbdb26c6" TYPE="swap" 
/dev/sdb1: LABEL="Server2TB" UUID="5caa86b6-395e-42f8-bc50-41b1bf9b62eb" TYPE="ext4"
Digikam and Mysql is installed on sda1, Fotos are on sdb1.

On computer 2 I'm using Kubuntu 12.04.1 32-bit with one harddisk:
/dev/sda1: UUID="423c3763-c693-4850-ba9f-8a6cad2aa45f" TYPE="ext4" 
/dev/sda5: UUID="6566d87f-7e8a-4dbd-9754-cc5f029e8636" TYPE="swap" 
/dev/sda6: UUID="e46888da-6ac1-4870-8365-dbc13a82942f" TYPE="ext4"
On sda1 there is an old Ubuntu-installation, digikam is installed on sda6. 

sdb1 from computer 1 ist mounted to computer 2 in fstab with:
xxx.xxx.xxx.xxx:/mnt/Server2TB/Daten /mnt/Server2TB	nfs	rw,hard,intr	0	0

Now I open digikam in computer 1 and add a local collection, path /mnt/Server2TB/Daten/Fotos, computer works for a while, everything is fine. I close digikam in computer 1, go to computer 2 and open digikam, add a local collection, path is the same /mnt/Server.... Computer works for a while, everything is fine, I close digikam. 

When I'm gonig back to computer 1, I receive an error-message:
Die Sammlung Fotos (Ordner "mnt/Server2TB/Fotos" auf dem Laufwerk mit der ID "e4688da-...") kann zurzeit nicht auf Ihrem System gefunden werden.

I try a translation:
The collection Fotos (file "mnt/Server2TB/Fotos" on drive with the ID "e4688da-...") temporarily cannot be found on your system.

I have to reenter the collection-settings, the computer ist reading the collection and then I can use it. Closing digikam on computer 1 and opening it on computer 2 again gives me an error-message:
The collection Fotos (file "mnt/Server2TB/Fotos" on drive with the ID "5caa86b6-...") temporarily cannot be found on your system.

These errormessages occur every time I used digikam on the other computer before. Additional to that I get another errormessage every time on both computers:
Fehlermeldung: Die Datenbank ist ungültig: Die Einstellung "DBThumbnailsVersion" ist nicht vorhanden. Die aktuelle Version des Datenbankschemas kann daher nicht überprüft werden. Versuchen Sie bitte mit einer leeren Datenbank neu zu starten.
In english:
Errormessage: The databse is not valid: The setting "DBThumbnailVersion" is not existing. The current version of the database scheme cannot be checked. Try to start new with an empty database.

Reproducible: Always

Steps to Reproduce:
1. Open digikam on one computer
2. Open digikam on the other computer
3.


Expected Results:  
Open the given collection with the shared MySQL-database
Comment 1 e.longuemare 2012-11-14 17:21:04 UTC
Hello,

should you look at mysql what is in your AlbumRoots table:

SELECT * FROM digikam.AlbumRoots;

when you start from the first computer and after from the second.

Greatings,

Eric
Comment 2 Messie 2012-11-14 17:52:10 UTC
Thank you for the quick response. Here ist is:

first on computer 1:

mysql> SELECT * FROM digikam.AlbumRoots;
+----+-------+--------+------+-----------------------------------------------------+--------------+
| id | label | status | type | identifier                                          | specificPath |
+----+-------+--------+------+-----------------------------------------------------+--------------+
| 15 | Fotos |      0 |    1 | volumeid:?uuid=5caa86b6-395e-42f8-bc50-41b1bf9b62eb | /Daten/Fotos |
+----+-------+--------+------+-----------------------------------------------------+--------------+

after starting digikam on computer 2:

mysql> SELECT * FROM digikam.AlbumRoots;
+----+-------+--------+------+-----------------------------------------------------+--------------+
| id | label | status | type | identifier                                          | specificPath |
+----+-------+--------+------+-----------------------------------------------------+--------------+
| 15 | Fotos |      0 |    1 | volumeid:?uuid=5caa86b6-395e-42f8-bc50-41b1bf9b62eb | /Daten/Fotos |
+----+-------+--------+------+-----------------------------------------------------+--------------+

after settings / add new collection on computer 2:

mysql> SELECT * FROM digikam.AlbumRoots;
+----+-------+--------+------+-----------------------------------------------------+----------------------+
| id | label | status | type | identifier                                          | specificPath         |
+----+-------+--------+------+-----------------------------------------------------+----------------------+
| 16 | Fotos |      0 |    1 | volumeid:?uuid=e46888da-6ac1-4870-8365-dbc13a82942f | /mnt/Server2TB/Fotos |
+----+-------+--------+------+-----------------------------------------------------+----------------------+

again on computer 1 and after settings / add new collection:

mysql> SELECT * FROM digikam.AlbumRoots;
+----+-------+--------+------+-----------------------------------------------------+--------------+
| id | label | status | type | identifier                                          | specificPath |
+----+-------+--------+------+-----------------------------------------------------+--------------+
| 17 | Fotos |      0 |    1 | volumeid:?uuid=5caa86b6-395e-42f8-bc50-41b1bf9b62eb | /Daten/Fotos |
+----+-------+--------+------+-----------------------------------------------------+--------------+

But the definition of the path is "/mnt/Server2TB/Daten/Fotos" and not like in specificPath. On computer 2 both are same.
Comment 3 e.longuemare 2012-11-14 18:22:04 UTC
Hello,

I think this not a bug.

I use digikam 2.8.0 on a network share (Nas) without problem (except this : https://bugs.kde.org/show_bug.cgi?id=283323).

I don't have the problem because my share is mounted the same way (I use Xubuntu 12.04 for my desktops).

In your case the Id change, so digikam think that they are two different collections.

Should you give /etc/fstab files from both computers ?

Greatings,

Eric
Comment 4 e.longuemare 2012-11-14 18:26:32 UTC
I forget,

Normally when you connect the 2 nd computer, you don't have to had a new collection.

I think you should try to "bypass", cancel adding the collection in digikam, then configure your mysql in digikam option and restart.

Greatings,

Eric
Comment 5 e.longuemare 2012-11-14 18:31:50 UTC
Here :
The databse is not valid: The setting "DBThumbnailVersion" is not existing. The current version of the database scheme cannot be checked. Try to start new with an empty database

It's another problem.
Comment 6 e.longuemare 2012-11-14 18:35:56 UTC
Here is my config for the shared collection :

> SELECT * FROM digikam.AlbumRoots

+ ------- + ---------- + ----------- + --------- + --------------- + ----------------- +
| id      | label      | status      | type      | identifier      | specificPath      |
+ ------- + ---------- + ----------- + --------- + --------------- + ----------------- +
| 1       | Diskphotos | 0           | 3         | networkshareid:?mountpath=%2Fmedia%2FDiskphotos | /                 |
| NULL    | NULL       | NULL        | NULL      | NULL            | NULL              |
+ ------- + ---------- + ----------- + --------- + --------------- + ----------------- +
2 rows
Comment 7 e.longuemare 2012-11-14 18:47:52 UTC
Here :
after settings / add new collection on computer 2: mysql> SELECT * FROM digikam.AlbumRoots; +----+-------+--------+------+-----------------------------------------------------+----------------------+ | id | label | status | type | identifier | specificPath | +----+-------+--------+------+-----------------------------------------------------+----------------------+ | 16 | Fotos | 0 | 1 | volumeid:?uuid=e46888da-6ac1-4870-8365-dbc13a82942f | /mnt/Server2TB/Fotos | +----+-------+--------+------+-----------------------------------------------------+----------------------+

the uuis is the one of your sda6 on computer 2. 

Should you use /media/... for mounting your shared disk.
Comment 8 Messie 2012-11-14 19:18:07 UTC
I montioned the errormessage "The databse is not valid: The setting "DBThumbnailVersion..." only for the possibility, that it could be related to the other problem. 

I'll give your proposals a try, but I can't do that tonight (there is a nice redwine from South Africa and some guests...)
Comment 9 Messie 2012-11-15 08:27:41 UTC
Hi Eric,

type and identifier are different at your computer. 

How is your nas mounted? Through fstab? Could you give me the line from fstab, so that I can find out differences?

Thanks
Matthias
Comment 10 Messie 2012-11-15 08:54:18 UTC
Computer 1 is writing to AlbumRoots / identifier the UUID of sdb1, the second Harddisk on that machine. Computer 2 is writing the UUID from sda6, where the program digikam is installed. Maybe computer 2 cannot access or see or find out UUID from computer 1? How can I tell digikam to write the mountpath /mnt/Server2TB... to the identifier instead of the UUID?

Greetings
Matthias
Comment 11 Messie 2012-11-15 20:41:43 UTC
I found a workaround: In "AlbumRoots" fill in the field "identifier" the path: "volumeid:?path=/mnt..." If the mounted path on all computers is the same (this is a matter of fstab) digikam works fine on all computers (see comment 32 in bug-report 175923).

It's definitely a bug, that digikam takes a UUID, which is working on one coumputer and not on others.
Comment 12 e.longuemare 2012-11-16 08:54:35 UTC
Hello,

sorry, your mail was put in my spam folder.

The link to the bug on uuid problem is here : https://bugs.kde.org/show_bug.cgi?id=175923

I think that when you use networkshare in add collection from digikam, the problem doesn't occure.

I'm mounting the NAS in fstab with CIFS :

this is my fstab line :

//192.168.1.16/photos  /media/Diskphotos    cifs    username=*********,password=*********,iocharset=utf8    0   0

Greatings,

Eric
Comment 13 Justin Zobel 2021-03-09 05:51:24 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 14 Maik Qualmann 2022-07-17 07:44:08 UTC
Git commit 6a630aeab30849225015826aa185cc8a8516cc74 by Maik Qualmann.
Committed on 16/07/2022 at 15:14.
Pushed by mqualmann into branch 'master'.

add support for alternate network paths in the collection view
Related: bug 384820
FIXED-IN: 8.0.0

M  +3    -1    NEWS
M  +4    -0    core/libs/database/collection/collectionlocation.h
M  +6    -3    core/libs/database/collection/collectionmanager.h
M  +5    -3    core/libs/database/collection/collectionmanager_location.cpp
M  +7    -2    core/libs/database/collection/collectionmanager_p.cpp
M  +2    -3    core/libs/database/collection/collectionmanager_p.h
M  +206  -17   core/utilities/setup/collections/setupcollectionview.cpp
M  +21   -8    core/utilities/setup/collections/setupcollectionview.h

https://invent.kde.org/graphics/digikam/commit/6a630aeab30849225015826aa185cc8a8516cc74