RPD on WSL2 (W10) not starting [SOLVED]

I am trying to get RPD running on WSL2 in Windows 10. I am able to install it properly, but I am not able to run it. I get the following error when started from the command line:

erik@DskWoonkamer:~$ rapid-photo-downloader
Traceback (most recent call last):
  File "/usr/bin/rapid-photo-downloader", line 33, in <module>
    sys.exit(load_entry_point('rapid-photo-downloader==0.9.36', 'gui_scripts', 'rapid-photo-downloader')())
  File "/usr/bin/rapid-photo-downloader", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/raphodo/__init__.py", line 97, in <module>
    localedir = locale_directory()
  File "/usr/lib/python3/dist-packages/raphodo/__init__.py", line 69, in locale_directory
    assert Path(data_home).is_dir()
AssertionError

The WSL2 setup is probably not the problem, I am able to run other GUI apps without problems (e.g. Nautilus, GNOME editor, GnuCash, darktable).

WSL-versie: 2.1.5.0
Kernelversie: 5.15.146.1-2
WSLg-versie: 1.0.60
MSRDC-versie: 1.2.5105
Direct3D-versie: 1.611.1-81528511
DXCore-versie: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows-versie: 10.0.19045.4170

My questions:

  • Does anyone know how to solve this?
  • Does anyone have a similar setup (W10, WSL2, RPD) that is working?

That error indicates that Qt is either unable to determine the writable FreeDesktop.org generic data location path, or the path is correctly specified but does not exist (edit: or the permissions are wrong).

There are a few ways you can solve the problem:

  1. Figure out what is wrong with the path. For my user, on my WSL instance, the value is /home/damon/.local/share
  2. Export a locale path in the environment variable RPD_I18N_DIR. Even if the value does not refer to a valid path, Rapid Photo Downloader will detect this and continue. However, this is not a good workaround because the problem will likely manifest in other parts of the program. Not having access to ~/.local/share is a fundamental problem!
1 Like

Granted write access for all to ~/.local/share, but that did not solve it completely. I got an error about missing wayland plugin:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Installed Wayland platform (sudo apt install qtwayland5) and now RPD is running.

Thank you for your help, @damonlynch.

2 Likes

I’m glad to hear it’s fixed. How did that directory lose write access for your user? I’ve always wondered how that issue comes about. Is it a rogue program or script?

I do not know. I created a WSL2 instance for the purpose of running RPD only. I did a clean install of Ubuntu 22.04 and then install RPD according to the instructions on your RPD website.
I experienced the same issue on my W11 laptop.

Relating to a different WSL issue, can you please do me a favour and run this command, and paste the output here:
cat /proc/mounts |grep 9p

Of course, here you are:

erik@DskWoonkamer:~$ cat /proc/mounts |grep 9p
none /usr/lib/wsl/drivers 9p ro,dirsync,nosuid,nodev,noatime,aname=drivers;fmask=222;dmask=222,mmap,access=client,msize=65536,trans=fd,rfd=7,wfd=7 0 0
C:\134 /mnt/c 9p rw,dirsync,noatime,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=5,wfd=5 0 0
D:\134 /mnt/d 9p rw,dirsync,noatime,aname=drvfs;path=D:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=5,wfd=5 0 0
E:\134 /mnt/e 9p rw,dirsync,noatime,aname=drvfs;path=E:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=5,wfd=5 0 0

Thanks. Your WSL instance is using the same mechanism as mine to specify windows drive mount points. That mechanism changed a month or two back. That change has consequences for Rapid Photo Downloader. When you start up Rapid Photo Downloader under WSL, unfortunately it’s going to be popping up a drive mounts window each time, because it doesn’t realise that the Windows drives are already mounted. That drive mount window should be popping up only when it detects a new drive has been inserted (like a memory card reader or external drive), not for already mounted drives like C:.

The change in the code is pretty simple, which I made in this commit.

I did a little write up a couple of years ago about the challenges of drive detection under WSL.

Is this change already present in the current version? Or do I have to wait for the next release?

The next release, unfortunately.

I’ve now made a release for Ubuntu with the fix. Add the testing repository (instructions here) and let me know what you think. The code is stable but it is labelled as an alpha release because there are still things that need to be done for a proper release, like translations.