Bug 398288 - digikam no write access to folder
Summary: digikam no write access to folder
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 5.9.0
Platform: Microsoft Windows Microsoft Windows
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-05 10:23 UTC by Steve Franks
Modified: 2020-05-28 16:15 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments
DebugView output (2.35 MB, text/plain)
2018-12-09 12:48 UTC, Steve Franks
Details
Digikam error dialog - No Write Access (8.31 KB, image/png)
2018-12-09 12:51 UTC, Steve Franks
Details
C:\Digikam Folder Properties (24.72 KB, image/png)
2018-12-09 12:52 UTC, Steve Franks
Details
Directory listings (88.41 KB, image/png)
2019-01-04 17:23 UTC, Steve Franks
Details
Digikam Database migrate dialog (35.16 KB, image/png)
2019-01-04 17:25 UTC, Steve Franks
Details
Directory contents after migration (74.74 KB, image/png)
2019-01-08 13:07 UTC, Steve Franks
Details
attachment-4539-0.html (4.92 KB, text/html)
2020-05-26 13:35 UTC, David Griffiths
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Franks 2018-09-05 10:23:54 UTC
I have just bought a windows 10 laptop and am trying to persuade digital to use a MySQL database.
External database passes the connection test, but fails to actually connect to a MariaDB 10.3 database. It does try, repeatedly, but eventually gives up.
The database is localhost, so I thought that I would try the internal MYSQL option, this fails with the error “You do not seem to have write access for the folder selected to be the root album”...
I have just copied my photos into the directory, so how can I not have access to it?
There is an old post from 2009 about this bug, was there a workaround? At present I am unable to use digital at all.
Should I install version 6?
Comment 1 caulier.gilles 2018-09-05 10:38:37 UTC
Install DebugView tool from microsoft, and run it. Start digiKam and look the debug trace capture by DebugView.

Look here for details: 

https://www.digikam.org/contribute/

Gilles Caulier
Comment 2 Maik Qualmann 2018-09-05 10:43:28 UTC
I suspect that you mean with digital digiKam. Question: The MySQL database trying to open already exists and has already been used by digiKam? If no, you first have to create a database user, create the digiKam database (possibly also for thumbnails etc.) and assign the rights. Look at the other tabs in the digiKam database setup, there it will be explained. An alternative would be the internal MySQL server, here digiKam tries to organize everything itself. But SQLite is not a bad choice and can even be faster than MYSQL on an SSD.

Maik
Comment 3 Steve Franks 2018-12-09 12:35:41 UTC
Sorry for the delay in responding. I gave up on Digikam, because of this error and lack of time to solve the problem.
I've just installed Digikam 6.0.0 Beta 2 and have the same issue. I don't want the database data in Pictures, so I copied the database to C:\Digikam. I haven't changed from the default internal MySQL database.(In reply to Maik Qualmann from comment #2)
> I suspect that you mean with digital digiKam. Question: The MySQL database
> trying to open already exists and has already been used by digiKam? If no,
> you first have to create a database user, create the digiKam database
> (possibly also for thumbnails etc.) and assign the rights. Look at the other
> tabs in the digiKam database setup, there it will be explained. An
> alternative would be the internal MySQL server, here digiKam tries to
> organize everything itself. But SQLite is not a bad choice and can even be
> faster than MYSQL on an SSD.
> 
> Maik

I followed the instructions to the letter, but Digikam still wouldn't use the MariaDB Database.
Comment 4 Steve Franks 2018-12-09 12:46:09 UTC
(In reply to caulier.gilles from comment #1)
> Install DebugView tool from microsoft, and run it. Start digiKam and look
> the debug trace capture by DebugView.
> 
> Look here for details: 
> 
> https://www.digikam.org/contribute/
> 
> Gilles Caulier

OK, I did that, but I'm none the wiser. DebugView output doesn't seem to mention my attempt to relocate the database.
I'll attach it if I can.
Steve
Comment 5 Steve Franks 2018-12-09 12:48:36 UTC
Created attachment 116804 [details]
DebugView output

I don't see anything that would help to solve this problem.
Comment 6 Steve Franks 2018-12-09 12:51:27 UTC
Created attachment 116805 [details]
Digikam error dialog - No Write Access

Screen shot of error dialog from my attempt to relocate Digikam's database to C:\Digikam
Comment 7 Steve Franks 2018-12-09 12:52:46 UTC
Created attachment 116806 [details]
C:\Digikam Folder Properties

These are the permissions I've granted to the Digikam folder that I would like to use for my database
Comment 8 Maik Qualmann 2018-12-09 16:05:38 UTC
Folders under C:\ are difficult to create since the launch of the UAC for programs there. Even if the Explorer can do it and other programs, digiKam does not get this permission. I can reproduce the problem here. Either another drive or a directory in the user area.

Maik
Comment 9 caulier.gilles 2018-12-31 11:50:30 UTC
Can you reproduce the dysfunction using the last digiKam 6.0.0-beta3 just
released ?

https://www.digikam.org/news/2018-12-30-6.0.0-beta3_release_announcement/
Comment 10 Steve Franks 2019-01-01 11:34:42 UTC
Happy New Year,
I'll install the latest version and try again.
Comment 11 Steve Franks 2019-01-04 17:23:48 UTC
Created attachment 117284 [details]
Directory listings

The database migration seems to be very slow. Look at the timestamps on the oldest and newest files.
Comment 12 Steve Franks 2019-01-04 17:25:25 UTC
Created attachment 117285 [details]
Digikam Database migrate dialog

I thought that this would be a straightforward copy from one folder to another, but there's obviously more to it.
Comment 13 Steve Franks 2019-01-05 17:26:31 UTC
Sorry I stopped the process after about 9 hours. It was about 45% complete.
Comment 14 Steve Franks 2019-01-08 13:05:29 UTC
A small database successfully copies, but the result is not what I expected. Only digikam4.db moves to the new directory, the other files remain where they were. See 2019-01-08 (4).png
Comment 15 Steve Franks 2019-01-08 13:07:21 UTC
Created attachment 117341 [details]
Directory contents after migration

This shows the files after migrating a small databse from C:\Users\Steve\Pictures\Digikam to C:\Digikam
Comment 16 Maik Qualmann 2020-01-04 16:20:37 UTC
*** Bug 415873 has been marked as a duplicate of this bug. ***
Comment 17 caulier.gilles 2020-01-12 13:36:12 UTC
Steve,

Please test with current 7.0.0-beta2 pre-release available here:

https://files.kde.org/digikam/

It still reproducible ?

Thanks in advance

Gilles Caulier
Comment 18 Maik Qualmann 2020-05-13 18:37:58 UTC
*** Bug 421478 has been marked as a duplicate of this bug. ***
Comment 19 David Griffiths 2020-05-24 07:56:15 UTC
I have a similar problem. On a new install, when I run V7.0.0 B2 it asks me where my photos are located (C:\Players) and it says I do not appear to have write access to this folder (I do). This is on my laptop running Windows 10 Home.
I installed the same version yesterday on my desktop running the same version of Windows. The only difference is the photos folder is on D: drive.
Comment 20 Maik Qualmann 2020-05-24 09:13:00 UTC
Drive C: is a system drive because your Windows installation is on it. This drive is specially protected by the UAC. Drive D: is not a problem if there is no Windows installation. DigiKam does not have a valid signature from Microsoft, we cannot change it at the moment. If drive C: is used for images, then only in the user directory.

Maik
Comment 21 David Griffiths 2020-05-24 21:44:22 UTC
Drive C: in the laptop is the ONLY drive!  I tried disabling UAC and it did not solve the problem.

It seems the write access test is too sensitive ??
Comment 22 Maik Qualmann 2020-05-25 05:30:52 UTC
Access is not sensitive. We don't even trust QFileInfo here. We try to create a temporary file. Again, if it works in the user folder and not just below C: everything is ok at the moment. The extended file protection cannot be deactivated by switching off the UAC. Believe me, we have examined the problem intensively. You have to wait until digiKam is available in the App Store at some point.

Maik
Comment 23 David Griffiths 2020-05-26 06:24:18 UTC
Can you point to me where I can find info about Extended file Protection?  I am trying to understand why DigiKam has this problem when many other programs I use can access files on C: - even programs I write in Delphi.
Comment 24 David Griffiths 2020-05-26 06:29:34 UTC
If I use Windows Explorer I can create a text file in C:\Players ??
Comment 25 Maik Qualmann 2020-05-26 07:41:45 UTC
The keyword is probably UAC virtualization. I quickly found only the German entry at Microsoft, the English is no longer available.

https://support.microsoft.com/de-de/help/927387

Maik
Comment 26 David Griffiths 2020-05-26 11:40:47 UTC
From that KB article I cannot see any cases that should apply to DigiKam. You are not using virtualization are you?

From what I have read, virtualization only applies to files in: 
    %Program Files%
    %WinDir%
    %WinDir%\System32
    HKEY_LOCAL_MACHINE\Software

??
Comment 27 caulier.gilles 2020-05-26 11:44:55 UTC
David,

We don't use Microsoft compiler currently to build whole digiKam Windows installer. All is cross-compiled under Linux with MXE (MinGw based).
This is perhaps the main problem with this issue...

Gilles Caulier
Comment 28 David Griffiths 2020-05-26 11:53:50 UTC
Gilles,

My experience is all DOS and Windows, so I can't comment re the cross compiler, but two things:
- I would think a cross compiled program should be able to do anything a natively compiled program can do.
- this is not an installer issue, it comes up when the DigiKam program is first run.

It is just not right that an application program cannot write to a folder on the C: that is not in the Windows protected area, especially when the machine only has one drive!

[OT I have some questions re face tags - where is the best place to ask them?]

DG
Comment 29 Maik Qualmann 2020-05-26 12:38:59 UTC
We may actually try to create the test file in the parent directory in the first run dialog. I'll check it out tonight.

Maik
Comment 30 Maik Qualmann 2020-05-26 12:48:03 UTC
Yes, digiKam makes a mistake here. As a workaround you can simply add a "\" to the path in the first run dialog. I fix it...

Maik
Comment 31 caulier.gilles 2020-05-26 13:30:19 UTC
David,

Under Windows 10, installing a non signed program will be limited by the OS. The cross compiled installer is not signed, and we already seen few dysfunctions.

We have a MSVC version compiling fine but to deploy it's not yet finalized. This version will be signed and deployed on M$ Store (:=)))...

Gilles Caulier
Comment 32 David Griffiths 2020-05-26 13:35:45 UTC
Created attachment 128804 [details]
attachment-4539-0.html

Gilles,

I think this is a different issue. Maik has found the problem.

Cheer DG


> https://bugs.kde.org/show_bug.cgi?id=398288
> 
> --- Comment #31 from caulier.gilles@gmail.com ---
> David,
> 
> Under Windows 10, installing a non signed program will be limited by the OS.
> The cross compiled installer is not signed, and we already seen few
> dysfunctions.
> 
> We have a MSVC version compiling fine but to deploy it's not yet finalized.
> This version will be signed and deployed on M$ Store (:=)))...
> 
> Gilles Caulier
> 
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.



-----------------------------------------------------------
  David Griffiths           david@digitalgraphics.com.au
  Digital Graphics P/L      http://www.digitalgraphics.com.au
  Sydney, Australia         +61 2 4567 8999
-----------
Australian agents for:
 E-LAB computers - AVR Pascal and In Circuit programmers
 Logical Systems - programming adapters
 Intronix - LogicPort 34 channel Logic Analyser
Comment 33 David Griffiths 2020-05-26 13:38:57 UTC
Excellent - well done Maik.
Comment 34 David Griffiths 2020-05-26 13:40:56 UTC
I shouldn't have relied to the notification email - please delete comment 32.
(I can't see a way to edit or delete)
Comment 35 David Griffiths 2020-05-26 14:13:55 UTC
I shouldn't have relied to the notification email - please delete comment 32.
(I can't see a way to edit or delete)
Comment 36 Maik Qualmann 2020-05-26 14:47:28 UTC
I'm pretty sure the bug tracker doesn't support editing or deleting comments.

Maik
Comment 37 Maik Qualmann 2020-05-26 17:05:44 UTC
Git commit a3ada534db3f5362d4f884b8decf7a54fe601b58 by Maik Qualmann.
Committed on 26/05/2020 at 17:03.
Pushed by mqualmann into branch 'master'.

fix create temporary test file in album root directory
Related: bug 421478

M  +3    -1    NEWS
M  +1    -1    core/utilities/firstrun/collectionpage.cpp

https://invent.kde.org/graphics/digikam/commit/a3ada534db3f5362d4f884b8decf7a54fe601b58
Comment 38 Maik Qualmann 2020-05-28 16:15:21 UTC
Git commit fddb9298b614f5d8526f634c861815130af8dafa by Maik Qualmann.
Committed on 28/05/2020 at 16:13.
Pushed by mqualmann into branch 'master'.

the same fix for the database directory
Related: bug 421478

M  +6    -1    core/libs/database/utils/widgets/dbsettingswidget.cpp

https://invent.kde.org/graphics/digikam/commit/fddb9298b614f5d8526f634c861815130af8dafa