nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
516 stars 59 forks source link

Download Photo Fails #847

Open JasonNaughton opened 2 years ago

JasonNaughton commented 2 years ago

How to use GitHub

Steps to reproduce

  1. Install next cloud 21.0.3 under linux Mint 20.2
  2. Have Photos 1.3.0 App installed and configured
  3. Upload multiple photos
  4. Click on Photos to view photos
  5. Click on any photo top right ...
  6. Click Download (Photo will Fail with "Failed - Network error")
  7. Click on any photo top right ...
  8. Now remove spaces in the filename, photo downloads correctly

Expected behaviour

Seems that if you attempt to use the download option and leave spaces within the file name. In my example the file name was 21-08-05 15-28-29 2148.jpg. Yet if I change the filename and remove the spaces in the process of downloading there's no issue.

Actual behaviour

See above.

Server configuration

Operating system: Linux Mint 20.2

Web server: Apache 2.4.41

Database: Mysql 8.0.26

PHP version: PHP 7.4.3

Nextcloud version: (see Nextcloud admin page) 21.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Regularly updated but this error I don't believe is an update issue.

Where did you install Nextcloud from: From git repository.

Client configuration

Browser: Chrome 92.0.4515.131

Operating system: Linux Mint 20.2

CarlSchwan commented 2 years ago

Hi :)

Thanks for the report. I tried to reproduce with Nextcloud master and Nextcloud 21 but I couldn't. For me downloading a file even with a space in the filename works as expected.

Did you upload the images with the desktop client or with the online interface? Do you get some error messages in the webconsole (right client -> inspect -> console)?

szaimen commented 2 years ago

Maybe an issue within the photos app?

pspitzli commented 1 year ago

I just upgraded my nextcloud instance from 24.x to 25.x (HUB 3.0) and reactivated Photos-2.0.0. I was super excited to test the new editor.

Unfortunately the editor did not work for me and I think it has to do with this bug.

Whenever I try to open the Editor for a foto I end up on a black, empty editor. Further investigation in the browser console (I am using firefox, so F12 or CTRL-SHIFT-I got me there) revealed that the editor failed to download the original image under a URL following the following sceme: https://<HOST>/remote.php/dav//Photos/Ausdrucken/<IMAGE_NAME>.jpg This URL was not valid and the server and thus a 404 Error was returned.

The I tried to download the image -> Same result, same URL Scheme. The I tried to download the image in the Files-App, which worked instantly. It turned out that the Files-App used a different URL-Scheme do download the very same image: https://<HOST>/remote.php/webdav//Photos/Ausdrucken/<IMAGE_NAME>.jpg Notice the webdav instead of just dav in the path.

Now I went to github to search for similar issues and found this one. But Just as I wanted to prepare this very comment and copy the failing URLs from the browser console, the issue was gone! It just worked as expected, which was basically cool but left me puzzled.

I looked at the download path again and noticed a change: It had turned from https://<HOST>/remote.php/dav//Photos/Ausdrucken/<IMAGE_NAME>.jpg to https://<HOST>/remote.php/dav//files/philip/Photos/Ausdrucken/<IMAGE_NAME>.jpg

I still wanted to share this observation. Maybe there is some cronjob running in the background, updating paths in the db or whatever. Maybe the issue also disappeared for @JasonNaughton too after the URLs got updated?

kariburger commented 1 year ago

I have the same problem. I have some photos in a "group folder" . Displaying works fine EVERYWHERE.

Download works in the main view "all media" (German: "Alle Medien"), when I enter the "photos app". But when I navigate to "shared with you", I can only SEE the photos in the group folder. But DOWNLOAD does NOT work. I discovered the same problem with the differing paths (compared the paths with download from the file manager app).

My example:

So something causes the part "files/USERNAME" to get lost inside the photos app. I used an external storage entry for the photos before - with the same error there.

I'm using Nextcloud Hub 3 (25.0.4) on a debian system with php7.4 (I can't switch to php8 due to openmediavault, which sticks to php7.4).

math-GH commented 1 year ago

I am affected too.

grafik

Nextcloud 25.0.3

How to reproduce: grafik

grafik

The download link opens an empty tab.

An error is shown in the browser console: 404 - not found - https://domain.tls/remote.php/dav//filename.jpg (yes, there is a double slash char)

correct would be: https://domain.tld/remote.php/dav/files/USERNAME/FOLDERS/filename.jpg (files/USERNAME/FOLDERS is missed)