Shared folders link received by email is not valid. #25200

Closed
aventrax opened this Issue Jun 21, 2016 · 8 comments

Projects

None yet

2 participants

@aventrax
aventrax commented Jun 21, 2016 edited

Steps to reproduce

1.Drop some file on a folder
2.Share this folder to another owncloud user notifying him by email
3.Click on the download link received by mail and select all the shared files on that folder, then click on the download button.

Expected behaviour

I should be able to download the zip file containing all my files on that folder.

Actual behaviour

I got the following error:

File not found

The specified document has not been found on the server.

The link I got by email is:
https://cloud.mydomain.com/index.php/apps/files/?dir=test+dir

if I change is to:
https://cloud.mydomain.com/index.php/apps/files/?dir=/test+dir

everithing works as aspected.

Server configuration

Operating system: Debian Jessie 8.0

Web server: NGINX

Database: MySQL

PHP version: 5.6.22-0+deb8u1

ownCloud version: (see ownCloud admin page) 9.0.2

Updated from an older ownCloud or fresh install: Updated from 8.0 ahead..

Where did you install ownCloud from: ufficial opensuse repo

Signing status (ownCloud 9.0 and above):

No errors have been found.

List of activated apps:

Enabled:
  - calendar: 1.2.2
  - comments: 0.2
  - contacts: 1.3.1.0
  - dav: 0.1.6
  - federatedfilesharing: 0.1.0
  - files: 1.4.4
  - files_external: 0.5.2
  - files_pdfviewer: 0.8.1
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_videoplayer: 0.9.8
  - gallery: 14.5.0
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - updatenotification: 0.1.0
  - user_ldap: 0.8.0
Disabled:
  - activity
  - encryption
  - external
  - federation
  - files_trashbin
  - files_versions
  - firstrunwizard
  - notifications
  - templateeditor
  - user_external


The content of config/config.php:

{
    "system": {
        "instanceid": "ocryv1eidw3w",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "9.0.2.2",
        "default_language": "en",
        "theme": "mytheme",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Rome",
        "installed": true,
        "filesystem_check_changes": 1,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "0": "\/tmp\/redis.sock",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "ldapIgnoreNamingRules": false,
        "loglevel": 2,
        "debug": false,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "PLAIN",
        "maintenance": false,
        "mail_from_address": "cloud",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updatechecker": false
    }
}

Are you using external storage, if yes which one: NO

Are you using encryption: NO

Are you using an external user-backend, if yes which one: LDAP/Active Directory

LDAP configuration (delete this part if not used)

| hasMemberOfFilterSupport      | 1                                                                                                                            |
| hasPagedResultSupport         |                                                                                                                              |
| homeFolderNamingRule          |                                                                                                                              |
| lastJpegPhotoLookup           | 0                                                                                                                            |
| ldapAgentName                 | ***REMOVED SENSITIVE VALUE***                                                                                                   |
| ldapAgentPassword             | ***                                                                                                                          |
| ldapAttributesForGroupSearch  |                                                                                                                              |
| ldapAttributesForUserSearch   | cn;givenname;sn;sAMAccountName;displayname;mail                                                                              |
| ldapBackupHost                |                                                                                                                              |
| ldapBackupPort                |                                                                                                                              |
| ldapBase                      | DC=removed,DC=local                                                                                                           |
| ldapBaseGroups                | DC=removed,DC=local                                                                                                           |
| ldapBaseUsers                 | DC=removed,DC=local                                                                                                           |
| ldapCacheTTL                  | 15                                                                                                                           |
| ldapConfigurationActive       | 1                                                                                                                            |
| ldapDynamicGroupMemberURL     |                                                                                                                              |
| ldapEmailAttribute            | mail                                                                                                                         |
| ldapExperiencedAdmin          | 0                                                                                                                            |
| ldapExpertUUIDGroupAttr       |                                                                                                                              |
| ldapExpertUUIDUserAttr        |                                                                                                                              |
| ldapExpertUsernameAttr        | sAMAccountName                                                                                                               |
| ldapGroupDisplayName          | cn                                                                                                                           |
| ldapGroupFilter               |                                                                                                                              |
| ldapGroupFilterGroups         |                                                                                                                              |
| ldapGroupFilterMode           | 0                                                                                                                            |
| ldapGroupFilterObjectclass    |                                                                                                                              |
| ldapGroupMemberAssocAttr      | member                                                                                                                       |
| ldapHost                      | 10.1.1.3                                                                                                                     |
| ldapIgnoreNamingRules         |                                                                                                                              |
| ldapLoginFilter               | (&(&(objectclass=person)(memberOf:1.2.840.113556.1.4.1941:=CN=GOwnCloud,OU=Users,DC=removed,DC=local))(samaccountname=%uid)) |
| ldapLoginFilterAttributes     |                                                                                                                              |
| ldapLoginFilterEmail          | 0                                                                                                                            |
| ldapLoginFilterMode           | 1                                                                                                                            |
| ldapLoginFilterUsername       | 1                                                                                                                            |
| ldapNestedGroups              | 0                                                                                                                            |
| ldapOverrideMainServer        |                                                                                                                              |
| ldapPagingSize                | 500                                                                                                                          |
| ldapPort                      | 389                                                                                                                          |
| ldapQuotaAttribute            |                                                                                                                              |
| ldapQuotaDefault              |                                                                                                                              |
| ldapTLS                       | 0                                                                                                                            |
| ldapUserDisplayName           | displayname                                                                                                                  |
| ldapUserDisplayName2          |                                                                                                                              |
| ldapUserFilter                | (&(memberOf:1.2.840.113556.1.4.1941:=CN=GOwnCloud,OU=Users,DC=removed,DC=local))                                             |
| ldapUserFilterGroups          |                                                                                                                              |
| ldapUserFilterMode            | 1                                                                                                                            |
| ldapUserFilterObjectclass     | person                                                                                                                       |
| ldapUuidGroupAttribute        | auto                                                                                                                         |
| ldapUuidUserAttribute         | auto                                                                                                                         |
| turnOffCertCheck              | 0                                                                                                                            |
| useMemberOfToDetectMembership | 1  

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here: no errors

ownCloud log (data/owncloud.log)

No errors

Browser log

File not found

The specified document has not been found on the server.

You can click here to return to MY Cloud.
@PVince81
Collaborator

A leading slash in the "dir" value should not make a difference.

On v9.0.3RC1 if I remove the slash the link still works, so could be something specific to your setup. Not sure what or why.

@PVince81 PVince81 added the app:files label Jun 21, 2016
@PVince81
Collaborator

I also just tested with a space which I replaced with "+" with and without leading slash, all work.

Which web browser had this issue, in case it's a JS problem ? I tested with Chromium 51

@aventrax
aventrax commented Jun 21, 2016 edited

Tested with Firefox/Edge/Chrome, same result.
My server is NGINX, no reverse proxy in the middlle.
nginx -v
nginx version: nginx/1.6.2

What kind of webserver setting could result is this issue?

The test has been done with a space on the folder, but it doesn't matte. "test dir" or "testdir", the behavoir is the same. The only thing worth is the leasing slash.

---edit, I don't know where (probably just in my mind) I have read "web server" instead of "web browser", so I posted my nginx details :) Sorry..

@aventrax

More infos: The issue is happening ONLY selecting ALL the files on the folder, because if I select 2 files only (with the folder containing al least 3 files), the download starts properly.

Moreover, I've got the same result on my other owncloud installation on my personal VPS. The link the user receive by email is not different (both without the leading slash), and it is not working.

What's in common between my 2 installations?

  1. Debian Jessie
  2. owncloud version/repositories
  3. nginx version and configuration

Help me please,

nginx.conf

user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 256; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; client_max_body_size 256M; index index.php; include /etc/nginx/mime.types; default_type application/octet-stream; server_tokens off; ssl_session_cache shared:SSL:50m; ssl_session_timeout 10m; ssl_dhparam /etc/ssl/private/dhparams.pem; ssl_protocols TLSv1.2; ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK'; ssl_prefer_server_ciphers on; ssl_stapling on; ssl_stapling_verify on; gzip off; gzip_disable "msie6"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }

my site conf is exactly that one specified here: https://doc.owncloud.org/server/9.0/admin_manual/installation/nginx_owncloud_9x.html

So, what's wrong?

@aventrax
aventrax commented Jul 1, 2016 edited

Hello again,

I updated both installation to 9.0.3 and the issue persists.

One more detail:

If I click on the link received by email I'll see my folder with 3 files inside, that's ok.

a) If I select 1 or 2 files the download begin properly
b) If I select all files on that folder (3 files) it throws the error.
c) If I browse another folder in owncloud and then I came back to the share folder, the download starts properly even selecting all (3) files.

  1. Link by email:
    https://cloud.mydomain.com/index.php/apps/files/?dir=test

  2. Link to the same folder after browsing owncloud and going back to the shared folder:
    https://cloud.mydomain.com/index.php/apps/files/?dir=%2Ftest

Selecting the entire folder content from the first link is NOT WORKING.
Selecting the entire folder content from the second link WORKS.

I can't believe to be the only one experiencing this issue on 2 different owncloud installation..

Thanks

@PVince81 PVince81 added this to the 9.0.4-current-maintenance milestone Jul 1, 2016
@PVince81
Collaborator
PVince81 commented Jul 1, 2016

Okay, seems I missed the part about "select all + download" when reading your report, sorry.

I tested locally with v9.0.3 and if the URL is "?dir=test" without leading slash, the select all + download feature doesn't properly compute the download link.

@PVince81 PVince81 removed the needs info label Jul 1, 2016
@PVince81
Collaborator
PVince81 commented Jul 1, 2016

Fix is here: #25325

You can download it as patch for testing: https://github.com/owncloud/core/pull/25325.patch

@aventrax
aventrax commented Jul 1, 2016 edited

Applied to 9.0.3 debian packages.

cat fix |patch -p1
patching file apps/files/js/filelist.js
Hunk #1 succeeded at 481 (offset -32 lines).
Hunk #2 succeeded at 1344 (offset -71 lines).

The download is working, thanks!

@PVince81 PVince81 closed this in #25325 Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment