Bug 459702 - Digikam git Mariadb issue
Summary: Digikam git Mariadb issue
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (other bugs)
Version First Reported In: 8.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-26 16:05 UTC by maderios
Modified: 2022-09-29 20:00 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maderios 2022-09-26 16:05:01 UTC
Hi
I use Digikam git version on two computers, PC1 and PC2
Digikam images collection and Mariadb are installed on PC1  (Local address is 192.168.2.21) 
Same/mirrored Digikam collection is copied  from PC1 is to PC2, local address 192.168.2.2 that can access to Mariadb on PC1 through local network
Issue: when i want to delete or add tag, Digikam doesn't see user 'dkmn2'@'192.168.2.2' but ''@'192.168.2.2
PC1 Error messages in console
digikam.dbengine: Failure executing query:

 "DELETE FROM Tags WHERE id=?;" 

Error messages: "QMYSQL3: Unable to execute statement" "The user specified as a definer (''@'192.168.2.2') does not exist" "1449" 2 

Bound values:  (QVariant(int, 571))

digikam.dbengine: Error while executing DBAction [ "DeleteTag" ] Statement [ "DELETE FROM Tags WHERE id=:tagID;" ]

digikam.general: Delete Shortcut assigned to tag  571


digikam.general: ("test-tag")

digikam.general: "test-tag"  ::  "/test-tag"

digikam.dbengine: Failure executing query:

 "INSERT INTO Tags (pid, name) VALUES( ?, ?);" 

Error messages: "QMYSQL3: Unable to execute statement" "The user specified as a definer (''@'192.168.2.2') does not exist" "1449" 2 

Bound values:  (QVariant(int, 0), QVariant(QString, "test-tag"))

digikam.dbengine: Error while executing DBAction [ "InsertTag" ] Statement [ "INSERT INTO Tags (pid, name) VALUES( :tagPID, :tagname);" ]

(I get same kind of errors on PC2 when I try to delete or create tags)


PC1:  local adress is 192.168.2.21 where Mariadb is installed. I tried to replace  'localhost' with '192.168.2.21' but i get same issue 
digikam.general: Database Parameters:

   Type:                      "QMYSQL"

   DB Core Name:              "dkmn"

   DB Thumbs Name:            "dkmn"

   DB Face Name:              "dkmn"

   DB Similarity Name:        "dkmn"

   Connect Options:           ""

   Host Name:                 "localhost"

   Host Port:                 3306

   WAL Mode:                  false

   Internal Server:           false

   Internal Server Path:      ""

   Internal Server Admin Cmd: ""

   Internal Server Serv Cmd:  ""

   Internal Server Init Cmd:  ""

   Username:                  "dkmn"

   Password:                  "XXXXXXXXXXXXXXXX"

PC2 : local adress is 192.168.2.2 that can access to Mariadb on PC1 through local network
digikam.general: Database Parameters:

   Type:                      "QMYSQL"

   DB Core Name:              "dkmn"

   DB Thumbs Name:            "dkmn"

   DB Face Name:              "dkmn"

   DB Similarity Name:        "dkmn"

   Connect Options:           ""

   Host Name:                 "192.168.2.21"

   Host Port:                 3306

   WAL Mode:                  false

   Internal Server:           false

   Internal Server Path:      ""

   Internal Server Admin Cmd: ""

   Internal Server Serv Cmd:  ""

   Internal Server Init Cmd:  ""

   Username:                  "dkmn2"

   Password:                  "XXXXXXXXXXXXXXXX"


When I check Mariadb, user 'dkmn2' is present:

MariaDB [(none)]> SHOW GRANTS FOR 'dkmn2'@'192.168.2.2';
+-------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for dkmn2@192.168.2.2                                                                                                              |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `dkmn2`@`192.168.2.2` IDENTIFIED BY PASSWORD '*xxxxxxxxxxx' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `dkmn`.* TO `dkmn2`@`192.168.2.2` WITH GRANT OPTION                                                               |
+-------------------------------------------------------------------------------------------------------------------------------------------+
Comment 1 Maik Qualmann 2022-09-26 17:04:49 UTC
This is not a problem that we can fix. We just pass a username and password to the SQL driver. Whether MariaDB can resolve the user depends on other factors.

Maik
Comment 2 Maik Qualmann 2022-09-26 17:09:20 UTC
I don't know if Arch Linux does it automatically, did you run mysql_upgrade?

Maik
Comment 3 maderios 2022-09-26 17:47:19 UTC
(In reply to Maik Qualmann from comment #2)
> I don't know if Arch Linux does it automatically, did you run mysql_upgrade?
> 
> Maik

Yes, I did it, it changes nothing, issue is still there
Comment 4 maderios 2022-09-27 13:44:33 UTC
This issue seems solved now. I dropped Mariadb database and deleted users, created a new Mariadb db and users. It works normally now for the two users,  from local host and remote host of local network. 
May be issue came from digikam database migration because, if i remember,  I migrated from sqlite db to mariadb external server