https://bugs.kde.org/show_bug.cgi?id=526935

--- Comment #8 from [email protected] ---
(In reply to caulier.gilles from comment #7)
> No. This is not a sign of database corruption. In comment 6, the command
> returns:
> 
> >$ sqlite3 digikam4.db "PRAGMA integrity_check"
> >Error: in prepare, unable to open database file (14)
> 
> This is SQLite error code 14 (SQLITE_CANTOPEN): sqlite3 cannot even open the
> file, which means the integrity check never actually ran. A genuinely
> corrupted database would open and instead return errors such as database
> disk image is malformed, or *** in database main *** lines from PRAGMA
> integrity_check. This is also consistent with the log in the initial report:
> QSqlError("14", "Unable to execute statement", "unable to open database
> file").
> 
> So the problem is upstream, at the file/filesystem level:
> 
> * Wrong path: the user may not be in the correct directory, or the database
> may have a different name (please check with ls -l, and possibly use the
> full path /run/media/avalanche/Seagate/DigiKam25/digikam4.db).
> 
> * Insufficient permissions: the external USB disk may be mounted without
> write access (typically an NTFS/exFAT partition mounted with the wrong uid,
> or mounted read-only).
> 
> *Missing/broken mount: please check mount | grep Seagate and the mount
> options.
> 
> Note that digiKam's message ("privileges are not assigned to you: CREATE
> TABLE") is misleading: it's the generic error shown when schema
> initialization fails. Here most likely because the database file sits on an
> external drive that is not properly mounted or not writeable, not because
> the database is corrupt or because SQL privileges are actually missing.
> 
> Next steps: please attach the output of ls -l on the database file and of
> mount for the external drive, then re-run sqlite3 with the full path once
> the drive is mounted read-write.
> 
> Best regards
> 
> Gilles Caulier

Thank you very much. This finally showed what the problem is: the disk is
mounted as read only, probably related to the filesystem, as this HDD is
formatted in HFS+ (I used to have a Mac as my main computer). The strange thing
is that it used to mount as read-write, but for some reason this seems to have
changed a couple of days ago.

This is the output from the commands you suggested:

$ ls -al /run/media/avalanche/Seagate/DigiKam25/
total 208040
drwxr-xr-x 1 avalanche avalanche         6 Sep 30 23:07 .
drwxr-xr-x 1 avalanche avalanche        22 Dec  7  2025 ..
-rw-r--r-- 1 avalanche avalanche   3665920 Sep 30 23:07 digikam4.db
-rw-r--r-- 1 avalanche avalanche   1384448 Sep 30 23:07 recognition.db
-rw-r--r-- 1 avalanche avalanche     24576 Sep 30 23:07 similarity.db
-rw-r--r-- 1 avalanche avalanche 207958016 Sep 30 23:07 thumbnails-digikam.db

$ mount | grep Seagate
/dev/sda1 on /run/media/avalanche/Seagate type hfsplus
(ro,nosuid,nodev,relatime,umask=22,uid=1984,gid=1984,nls=utf8,uhelper=udisks2)

I will look for another HDD to transfer all the contents and then format this
one in a friendlier format (maybe FAT32 is the most compatible across different
OSs).

Thank you again for your help and for guiding me through the steps necessary to
find the root of the issue, even if it had nothing to do with digiKam in the
end.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to