[Solved] Failing to download photos from CIFS

Hello there,

I am trying to find an optimal workflow for processing my photos on Linux (migrating from OS X / Aperture - I know that there is no single application that can do everything I did in Aperture). One of the repeatedly mentioned applications for downloading photos is Rapid Photo Downloader.

I downloaded and installed the 0.9.0b2 from sources (install script + source tar ball) - as there is currently no ebuild for Gentoo Linux. The application seems to run fine and even has less common features (p.e. the Back Up feature).

I don’t download images from camera / card reader directly. I have a Synology Server set up - I download photos from cards to the Synology NAS the moment I get home. The images are shared using AFP/SAMBA/CIFS and I process them from the shared folder. The folders are mounted like this:

//IP_ADDRESS/USBCopy on /mnt/photos_in type cifs (rw,nosuid,nodev,noexec,relatime,vers=1.0,cache=strict,username=me,domain=,uid=1000,forceuid,gid=1000,forcegid,addr=IP_ADDRESS,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1,user=me)

When I try to download them from the share, RPD sees them, creates previews, but almost all images fail to copy with (ignoring the message about backup destination not writable as it in fact is writable and RPD still writes images to the location):

Unable to copy file DSC_7741.NEF
Error: 5 Input/output error

I don’t quite understand the error, as the files are readable - I never had the problem using other tools, like Digikam, Darktable, even cp.

I suspect that it may be caused by the cifs mount as RPD has no problem copying the files directly from the card reader.

Any suggestions where I should look?

Thanks a lot!

Please file a bug report. You can do so using the link provided from the program’s menu. Be sure to include the log files as instructed, as they’re important.

I already addressed the problem with a backup destination not appearing writable, although it’s not yet released.

Thank you for reply, I created a bug report 1682998 and attached the log. I was not sure if I should report it before as it may be my cifs mount configuration.

Just a follow up - after enabling “Enable SMB 2 and Large MTU” on the Synology NAS and adding vers=2.0 to mount options in /etc/fstab, the transfer works OK. As suspected, the problem was in my cifs/smb configuration.

@robertvalik @damonlynch

I really wonder, how to install RPD on gentoo. I tried as mentioned on the homepage with
python3 install.py

but I just get repeatedly the line printed on my console:
“Skript wird mittels System-Python neu gestartet”

means skript will be restarted. I get hundreds of lines and cannot see progress…

Sorry , Gentoo is not supported. I do not use Gentoo. My expectation is that the Gentoo community will support Rapid Photo Downloader.

@damonlynch
thanks for your fast reply. I saw somewhere an overlay but it was suspicious to me and an ebuild I found also does not work…

I thought @robertvalik made it work, I just wonder why?

Pitty… actually the community does not support it for long time and it seems, there is almost no way for me. I dislike to stick with digikam. toooooo heavy and tooooo slow.

The best way would be to get the ebuild working — most of what the install.py script does is

  1. install system dependencies
  2. install python dependencies
  3. install the program itself

All these tasks are something the ebuild should be able to handle with ease. The only real problem would be if gentoo lacks support for a required dependency. Then you’d need an ebuild for each of those program libraries too.

1 Like

I am afraid, easier said than done :slight_smile: I am not that handycaped when it comes to PC things, just I assume, this is beyond my abilities and capabilities :-/

Sorry, I have installed the RPD some time ago and I do not recall the procedure clearly. It is still working (and updating - as it is quite capable of updating itself, installing using an ebuild would provide no benefits). Searching in bash history:

wget https://launchpad.net/rapid/pyqt/0.9.0b2/+download/install.py
wget https://launchpad.net/rapid/pyqt/0.9.0b2/+download/rapid-photo-downloader-0.9.0b2.tar.gz
python3 install.py rapid-photo-downloader-0.9.0b2.tar.gz

If I recall correctly I had to hack the install.py script a bit because it was stack in a loop saying “Restarting script using /usr/bin/python3 Restarting script using system python…”. I think it helped to delete the custom_python test section at about the line 2497 in the current install.py script (install succeeded after that). But I cannot guarantee the result.

1 Like

That’s a LOT of bash history :smiley:

If it’s as simple as that then I can modify the install script to give it the command line option to not check for that.

Until I modify the script and make a new release, what I suggest is installing the program into a python virtual environment. That should work. It’s actually pretty simple, as long as you install some dependencies first. See the READE.rst for instructions (here for 0.9.16).

Do keep in mind the backward quotes in the instructions are not to be included in the command line steps (they’re for formatting the rst file)!!

Note, pretty much the only limitations of the python virtual env install are not automatic upgrades, and you’d need to create a system menu entry yourself.

1 Like

@robertvalik
WOW! I am also impressed about your history :slight_smile:
That “restarting script” is exactly also my issue…

Would you have a bit more indication, which part you have deleted, as the line 2497 seems to be something different.

@damonlynch
I could either wait or hack the script as Robert did . Thanks a lot :slight_smile:
BTW: would be nice, if we can have an install-option, that it goes to /opt rather than /usr/bin, to keep the repository clean.

Unlimited bash history saved me few times :slight_smile:

It should be the block starting with:

if custom_python()

and ending with:

restart_script(restart_with=executable)

Hope it has been all that I did…

Sorry for OT, but how? I googled and I see, I have to define or even eliminate HISTSIZE and HISTFILESIZE, but find and grep do not give me those definitions in /etc and even in /usr I cannot find something reasonable…

I tried and was as successful as I got even a warning message, that I still need to install dev-python/pip dev-python/wheel. Afterwards the script starts downloading but finally still delivers lots of Restarting script using /usr/bin/python3

Then I tried your way above with 0.9.0b2. In that one ther is no custom_pyhton() even. Hence I tried as is, but it also ends up with failures, that it cannot build gphoto2 (which I installed with emerge anyhow) and pyzmq (dito installed)…

So currently I am stuck, at least with my limited compentency (but I want RPD as I do not see real alternatives)

[update]
I have downloaded and unpacked rapid-photo-downloader-0.9.16.tar.gz manually and applied the above mentioned changes for custom_python() of the install.py which is inside that package.

The success goes as far, as I get the following errormessages:

Building wheels for collected packages: gphoto2
  Building wheel for gphoto2 (setup.py): started
  Building wheel for gphoto2 (setup.py): finished with status 'error'
  Running setup.py clean for gphoto2
Failed to build gphoto2
Installing collected packages: gphoto2, pyxdg, python-dateutil, arrow, rawkit, PyPrind, colorlog, easygui, colour, pymediainfo, sortedcontainers, tornado, tenacity
  Running setup.py install for gphoto2: started
    Running setup.py install for gphoto2: finished with status 'error'
Received error code 1
Failed to install application requirements: exiting

If I use python3 -v I get as much “# destroy…” lines as I cannot see the interesting part anymore…

gphoto2 is intalled including the libs via emerge.

The program is not installed into /usr/bin. It’s installed in various subdirectories under ~/local/

Or you could do as I suggest and install it into a python virtual environment. You need to read the README and manually install the required dependencies first, like the header/development files for libgphoto2 and python3. If you don’t do that, I guarantee you the program will not run.

Dear @damonlynch

I tried with virtual env and it also failed.

libgphoto2 is installed. Headerfiles for python3, … I donno what this could be, as python3 is my system-default and gentoo is pretty a dev-distro, I assume, everything is in place and I still get, what you see above…

Quite a lot of times the interesting things are not in the config files but in the old commands (I fail miserably to document everything I do at my home computer)… And there are times that I discover that I need some sofisticated one-liner that I have used a long time ago. It saves a lot of time to just grep it from history.

Yup, and that is probably the un-clarity of bash history. That command may come from my old installation. At some point I have deleted the ~/.local directory and I had to reinstall RPD. And then I have modified the probably newer install.py.

Anyway - I have tried the modified script on my Gentoo box now under a new user account and it still works as expected (but you know - every Gentoo box is different; I discovered that I have to update the system PyQT5 after successful installation to run the “new” RPD even the “old” was working correctly).

Actually, there are things that the Gentoo approach breaks. P.e. Rust - the portage package is usable to compile other packages from portage but is unusable by IDEs as some expected tools are missing. And probably this “custom python” is another example :slight_smile:

@robertvalik
Little misunderstanding:
I wanted to know, how you made it, to get unlimited history. I wanted to do so, as I am convinced by your comments, just cannot find, where is HISTSIZE defined

I tried literelaly hundred times tonight with the modified install.py and also with different of the few options. I think the problem is, somewhere it always try to use its own gphoto2 but i have it installed already by emerge. So I keep ending up with the errror:

   Building wheel for gphoto2 (setup.py): finished with status 'error'
  Running setup.py clean for gphoto2
Failed to build gphoto2

Oh, I see :slight_smile:

I have it in my ~/.bash_profile file. It is probably not set by default.

What about installing gphoto2 using pip? Does that work?

pip install --user gphoto2