core icon indicating copy to clipboard operation
core copied to clipboard

OC 5.0.0 sharing files via web link not working

Open PisikeSipelgas opened this issue 13 years ago • 58 comments

OC 5.0.0 sharing files via web link sends to user an e-mail with URL, but after clicking "download" button it says that "cloud not found".

PisikeSipelgas avatar Mar 14 '13 09:03 PisikeSipelgas

I can confirm that. Sharing via weblink not working at all in OC 5.0.

Error: "cloud not found"

laegi avatar Mar 14 '13 11:03 laegi

I can confirm that too. Sharing via weblink gives me "cloud not found" error too when trying to download the shared file. I noticed that it also shows the first letter of the filename bellow that error. Log actually shows:

{"app":"PHP","message":"fopen(/var/www/html/owncloud/data/XXXXXX/files/ff/s): failed to open stream: No such file or directory at /var/www/html/owncloud/lib/files/storage/local.php#143","level":2,"time":1363259010}

The actual filename for the file I tried to download was screenshot-1362394056765.png. The same happens with all folders and filenames and log always shows path to users data, file and first letter of the filename.

peltzi avatar Mar 14 '13 11:03 peltzi

@PisikeSipelgas Please update the issue using this template: https://raw.github.com/owncloud/core/master/issue_template.md

@MTGap @schiesbn

tanghus avatar Mar 14 '13 12:03 tanghus

Expected behaviour

Should be able to download file.

Actual behaviour

Generates an error "cloud not found"

Steps to reproduce

  1. Share a file with web link (file name for example: test.png).
  2. Open URL from recieved e-mail (https://something/public.php?service=files&t=441c49d0d73b3261cae0be38203ae7ec)
  3. Web page says: Pisike Sipelgas shared the file test.png with you
  4. Click "Download"
  5. https://something/public.php?service=files&t=441c49d0d73b3261cae0be38203ae7ec&download Page displays "Cloud not found" error with single "I" letter.

Server configuration

Operating system: FreeBSD 8.3-RELEASE-p3

Web server: Apache 2.2.22

Database: Mysql 5.5.25

PHP version: PHP 5.4.4

ownCloud version: 5.0.0 OC is installed to /usr/local/www/owncloud/ Datastore is: /data/owncloud/

Client configuration

Browser: FF19/IE10/Chrome

Operating system: FreeBSD/Windows

Logs

Web server error log

Insert your webserver log here

client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /public.php?service=files&t=441c49d0d73b3261cae0be38203ae7ec HTTP/1.1" 200 2562 client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /remote.php/core.css HTTP/1.1" 304 - client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /index.php/apps/files_sharing/css/public.css HTTP/1.1" 304 - client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /index.php/core/js/config.js HTTP/1.1" 200 748 client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /remote.php/core.js HTTP/1.1" 304 - client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /index.php/core/routes.json HTTP/1.1" 304 - client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /index.php/core/ajax/share.php?fetch=getItemsSharedStatuses&itemType=file HTTP/1.1" 200 76 client.example.com - - [14/Mar/2013:14:31:46 +0200] "GET /cron.php HTTP/1.1" 200 20 client.example.com - - [14/Mar/2013:14:33:46 +0200] "GET /public.php?service=files&t=441c49d0d73b3261cae0be38203ae7ec&download HTTP/1.1" 404 1394

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"fopen(/data/owncloud/Pisike_Sipelgas/files/I): failed to open stream: No such file or directory at /usr/local/www/owncloud/lib/files/storage/local.php#143","level":2,"time":1363264104}

PisikeSipelgas avatar Mar 14 '13 12:03 PisikeSipelgas

I have found the following:

In the official owncloud repo file lib/files.php (Line 53 - 55)

if (is_array($files) && count($files) == 1) {
$files = $files[0];
}

In the tar-File i have downloaded there are these lines:

if (count($files) == 1) {
         $files = $files[0];
}

Some failure in packaging?

virusbrain avatar Mar 14 '13 12:03 virusbrain

Changed the lines in /lib/files.php to the code in previous post and now sharing works as it should

pdelange avatar Mar 14 '13 13:03 pdelange

Sadly we discovered this bug only after the release was prepared. In the next bug fix release the issue will be solved. In the meantime you can just update the file like described by @virusbrain

There is another bug if you share a folder with a public link. You can't select multiple files and download them. If you want to fix it before the next bug fix release you can apply this patch: https://github.com/owncloud/core/pull/2272/files

schiessle avatar Mar 14 '13 13:03 schiessle

I can confirm: this is bug in 5.0 version.

This advice fixes problem:

https://github.com/owncloud/core/issues/2291#issuecomment-14900368

dkorzhevin avatar Mar 19 '13 18:03 dkorzhevin

Hi guys,

i have a problem with this solution...

I use

-OC 5.0.3 -PHP Version 5.3.2-1ubuntu4.19 -Apache/2.2.14 (Ubuntu)

/lib/files.php In my cfg this snippet destroy the files array

if (is_array($files) && count($files) == 1) { $files = $files[0]; }

$files[0] deliveres a string like that ["filename1","filename2","filename3"].

Everytime function count is calling the result is 1. But I have select 3 files for download.

PHP tells something about the count function (http://www.php.net/manual/en/function.count.php): Returns the number of elements in var. If var is not an array or an object with implemented Countable interface, 1 will be returned. There is one exception, if var is NULL, 0 will be returned.

I'm confused...

mastermin

Any ideas?

mastermin avatar Apr 03 '13 15:04 mastermin

Hi folks,

I'm frustrated :(... the patches above are included in OC 5.0.3.... I have checked this after downloading this one

http://download.owncloud.org/community/owncloud-5.0.3.tar.bz2

What shall I say? It doesn't work.

I get alway the same error: cloud not found...

Is it possible to re-open this issue? More details about that you will find above (2 days ago)...

mastermin

mastermin avatar Apr 05 '13 09:04 mastermin

OC 5.0.3: sharing with e-mail and download IS working.

PisikeSipelgas avatar Apr 05 '13 09:04 PisikeSipelgas

I tried it again with 5.0.3. I shared a directory with three files in it via link. I open the link from inside my mail. I see all three files, I mark them with the checkboxes. I download the zip file with all three files in it. So I don't see any problem. Scientifix Linux 6.4, php 5.3.3, apache 2.2.15

dirkuos avatar Apr 05 '13 09:04 dirkuos

Ok dirkous,

i will give you a shared link... do you have a mail address?

mastermin avatar Apr 05 '13 09:04 mastermin

Yes, but I won't put it on a public forum. BTW, I'm not an OC developer, just a user. So I can't help you with that.

dirkuos avatar Apr 05 '13 09:04 dirkuos

ok, how can i get your mail address?

mastermin avatar Apr 05 '13 10:04 mastermin

this error occurs in my owncloud.log

{"app":"PHP","message":"fopen(/var/www/owncloud/data/admin/files/Testing/[/"text1.rtf/",/"text2.rtf/",/"text3.rtf/"]) [function.fopen</a>]: failed to open stream: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#143","level":2,"time":1365157213}

I can confirm that creating a share link, copy&pasting it into a browser leads to the message "Cloud not found".

Server: Ubuntu 12.04.2 Database: MySQL 5.5 Browser: Firefox 20.0

I also checked /lib/files.php and line 53 looks like the upper one mentioned above by virusbrain

If you need further information, e.g. logfiles etc. just tell me what to post.

KaiThoma avatar Apr 05 '13 21:04 KaiThoma

Kai, thanks a lot for your confirmation!

Am 05.04.2013 um 23:15 schrieb KaiThoma [email protected]:

I can confirm that creating a share link, copy&pasting it into a browser leads to the message "Cloud not found".

Server: Ubuntu 12.04.2 Database: MySQL 5.5 Browser: Firefox 20.0

I also checked /lib/files.php and line 53 looks like to upper one mentioned above by virusbrain

If you need further information, e.g. logfiles etc. just tell me what to post.

— Reply to this email directly or view it on GitHub.

mastermin avatar Apr 05 '13 21:04 mastermin

I can't reproduce. Someone has to provide additional details, I tried all possible cases I could think of.

MTGap avatar Apr 06 '13 21:04 MTGap

Hi mtgap, many thanks for your testing!

In my case the $files var contains this one:

["text1.rtf","text2.rtf","text3.rtf"]

and the result of count is 1, not 3 like expected.

In my opinion that is a error.

mastermin avatar Apr 07 '13 20:04 mastermin