Skip to content

Share files/folder causes  #10588

Closed
Closed

Description

@check-ict

Steps to reproduce

  1. We created folders and shared them
  2. We uploaded about 400 GB of data and indexed all (it shows sizes, all is calculated)
  3. We try to share a new folder, the share option hangs/freezes the website
  4. Also existing folders and deeper folders/files are not showing anything when "shared" is clicked

Expected behaviour

Normal share options shown

Actual behaviour

Share does not expand and browser hangs, nothing is clickable anymore untill refresh or long wait time.

Server configuration

Operating system:
Debian 7 64 bit
Web server:
Apache2
Database:
MySQL
PHP version:
5.4.4
ownCloud version: (see ownCloud admin page)
7.0.1
Updated from an older ownCloud or fresh install:
Fresh install
List of activated apps:
Only file share, disabled all others
The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'abcd',
  'passwordsalt' => '*** Removed for security reasons',
  'trusted_domains' =>
  array (
    0 => 'cloud.domain.nl',
    1 => 'cloud.domain.nl:5000', // (https 443 was allready used)
  ),
  'datadirectory' => '/data/owncloud',
  'dbtype' => 'mysql',
  'version' => '7.0.1.1',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'abcd',
  'dbpassword' => '*** Removed for security reasons',
  'installed' => true,
  'forcessl' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'domain.nl',
  'mail_smtphost' => 'localhost',
);

Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no

Client configuration

Browser:
Any (firefox, ie, chrome, safari)
Operating system:
Any (iOS, Windows, Linux)

Logs

Web server error log

Allowed memory size of 2147483648 bytes exhausted (tried to allocate 72 bytes) at /var/www/owncloud/apps/files_sharing/lib/share/folder.php#41

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-08-22T07:59:30+00:00"}
{"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-08-22T07:59:30+00:00"}
{"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-08-22T07:59:50+00:00"}
{"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-08-22T07:59:50+00:00"}
{"app":"PHP","message":"Allowed memory size of 2147483648 bytes exhausted (tried to allocate 72 bytes) at \/var\/www\/owncloud\/apps\/files_sharing\/lib\/share\/folder.php#41","level":3,"time":"2014-08-22T08:01:07+00:00"}
{"app":"PHP","message":"Allowed memory size of 2147483648 bytes exhausted (tried to allocate 72 bytes) at \/var\/www\/owncloud\/apps\/files_sharing\/lib\/share\/folder.php#41","level":3,"time":"2014-08-22T08:28:59+00:00"}
{"app":"PHP","message":"Allowed memory size of 2147483648 bytes exhausted (tried to allocate 72 bytes) at \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php#216","level":3,"time":"2014-08-22T08:30:41+00:00"}
{"app":"PHP","message":"Undefined index: ocsid at \/var\/www\/owncloud\/lib\/private\/app.php#835","level":3,"time":"2014-08-22T08:32:59+00:00"}
{"app":"PHP","message":"Undefined index: ocsid at \/var\/www\/owncloud\/lib\/private\/app.php#835","level":3,"time":"2014-08-22T08:33:10+00:00"}

Browser log

NetworkError: 500 Internal Server Error - https://cloud.domain.nl:5000/index.php/core/ajax/share.php?fetch=getItem&itemType=folder&itemSource=22649&checkReshare=true&checkShares=true
TypeError: data.reshare is undefined
...(data !== false && data.reshare !== false && data.reshare.uid_owner !== undefine...

Extra info

We already tried to re-index manually, but it gives timeout. We changed the php_timeout and now it did it full run but no result.
We also rebooted and tried with normal HTTP instead of HTTPS.

Edit by PVince81: added triple backquotes to logs for better readability

Activity

  1. karlitschek commented on Aug 22, 2014

    @karlitschek
    Contributor

    @schiesbn

  2. PVince81 commented on Aug 22, 2014

    @PVince81
    Contributor

    If the browser hangs it's probably because of the synchronous ajax call inside of showDropDown(), and maybe that call is taking forever. (and we should definitely get rid of synchronous ajax calls in the future!)

    Since you got an "out of memory error" it is likely that the "share.php" call in question is taking forever, or has an infinite loop causing it to eat up all available memory.

    Now the tricky part is finding out where that error occurs and how to reproduce it.

    Can you enable XDebug (to get stack traces) and set loglevel to 0 in config.php, then reproduce the error ? This should hopefully output more information in the log.

  3. PVince81 commented on Aug 22, 2014

    @PVince81
    Contributor

    Another question: did you upload the files through the web UI or sync client ? Are you accessing files inside of the "data" directory directly ? Did you manually create symlinks in the data directory ? (which are not supported)
    Just trying to rule out a few ideas that are likely to cause infinite loops.

  4. check-ict commented on Aug 26, 2014

    @check-ict
    Author

    Please let me know how to enable XDebug. I have added it to php.ini and installed it, but I don't know how to get those stack traces. The logging to 0 doesn't give extra info.

    When we started we created the first folders and shared them.

    We have moved the data with rsync in those folders, changed owner (www-data:www-data) and indexed all. This worked before with about 200 GB data.

    The data location is not a symlink, it's a config setting. There are no manual symlinks.

  5. PVince81 commented on Aug 26, 2014

    @PVince81
    Contributor

    If you enabled XDebug in php.ini (xdebug.remote_enable = 1) you should see stack traces in the web server error log and possible also in owncloud.log.

  6. check-ict commented on Aug 30, 2014

    @check-ict
    Author

    This is all I get in the error log:

    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 72 bytes) in /var/www/owncloud/apps/files_sharing/lib/share/folder.php on line 41, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP Stack trace:, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   1. {main}() /var/www/owncloud/index.php:0, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   2. OC::handleRequest() /var/www/owncloud/index.php:28, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   3. OC\\Route\\Router->match() /var/www/owncloud/lib/base.php:697, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   4. call_user_func() /var/www/owncloud/lib/private/route/router.php:227, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   5. __lambda_func()/var/www/owncloud/lib/private/route/router.php:227, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   6. require_once()/var/www/owncloud/lib/private/route/route.php(135) : runtime-created function:1,referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   7. OCP\\Share::getItemShared() /var/www/owncloud/core/ajax/share.php:198, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   8. OC\\Share\\Share::getItemShared() /var/www/owncloud/lib/public/share.php:206, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP   9. OC\\Share\\Share::getItems() /var/www/owncloud/lib/private/share/share.php:439, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    [Sat Aug 30 12:36:24 2014] [error] [client 5.200.6.100] PHP  10. OC_Share_Backend_Folder->getChildren() /var/www/owncloud/lib/private/share/share.php:1440, referer: https://cloud.domain.nl:5000/index.php/apps/files/
    

    Edit by PVince81: added triple backticks

  7. check-ict commented on Aug 30, 2014

    @check-ict
    Author

    I just upgraded to 7.0.2 but the problem still exists. The upgrade took like 1,5 hour so I was hoping for some improvement.

  8. PVince81 commented on Aug 30, 2014

    @PVince81
    Contributor

    Wow, do you have lots of shared files ? Lots of individually shared files/folders ?

    It seems something is running out of memory, possibly in getChildren() for some reason.
    Needs further research.

  9. check-ict commented on Sep 1, 2014

    @check-ict
    Author

    The data contains alot of files, but there are only 4 top-level shared directories. It's impossible to share new top-level folders on inside existing shares because the option is not working. We wanted to share a file with 3th party and discovered it's not working anymore since we uploaded the data.

    Please let me know if you need more debug info.

  10. added this to the milestone on Sep 5, 2014
  11. check-ict commented on Sep 6, 2014

    @check-ict
    Author

    Any news on this?

  12. added this to the milestone on Sep 8, 2014
  13. 30 remaining items

  14. schiessle commented on Oct 7, 2014

    @schiessle
    Contributor

    @check-ict did you had the chance to test it? The patch still has some rough edges but I want to avoid to spend a lot of time with something which doesn't fix the issue at the end.

  15. check-ict commented on Oct 7, 2014

    @check-ict
    Author

    Hello,

    Good news, it seems to be working!

    Should "share link" give me a link? Because it doesn't give anything at the moment. The group/users work though.

  16. schiessle commented on Oct 7, 2014

    @schiessle
    Contributor

    Great!

    Should "share link" give me a link?

    Yes, this should give you a link. Maybe a regression from this fix, as said it is not really polished yet. Also some unit tests fail. But now that I know that I'm on the right track, I will finish it and also check the share link issue. Thanks for testing it!

  17. schiessle commented on Oct 9, 2014

    @schiessle
    Contributor

    @check-ict That's now the final PR #11380

    Can you give it another try? Sharing a link works for me too.

  18. check-ict commented on Oct 9, 2014

    @check-ict
    Author

    I edited the files but the link still doesn't work.

    {"app":"PHP","message":"Call to undefined method OC\Server::getSecureRandom() at /var/www/owncloud/lib/private/share/share.php#657","level":3,"time":"2014-10-09T22:22:54+00:00"}

  19. schiessle commented on Oct 10, 2014

    @schiessle
    Contributor

    OC\Server::getSecureRandom() only exists on master but not on stable7. You probably copied the whole share.php to your server instead of applying the changes only. This will be no problem as soon as I backported it to stable7.

  20. schiessle commented on Oct 10, 2014

    @schiessle
    Contributor

    fix merged and backported to stable7, will be released with OC7.0.3

  21. enoch85 commented on Nov 1, 2014

    @enoch85

    Is this bug fixed in 7.0.3? Got this recently in my log:

    {"app":"webdav","message":"Sabre\\DAV\\Exception\\BadRequest: expected filesize 278406 got 65536","level":4,"time":"2014-10-31T15:53:50+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:55:30+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:55:30+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:55:43+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:55:43+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:56:21+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:56:21+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:56:39+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:56:39+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:57:02+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:57:02+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T15:57:06+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T15:57:06+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T16:05:37+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T16:05:37+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T16:13:11+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T16:13:11+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T16:19:29+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T16:19:29+00:00"}
    {"app":"PHP","message":"Undefined index: mimetype at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#97","level":3,"time":"2014-10-31T16:43:19+00:00"}
    {"app":"PHP","message":"Undefined index: fileid at \/var\/www\/owncloud\/lib\/private\/files\/fileinfo.php#90","level":3,"time":"2014-10-31T16:43:19+00:00"}
    
  22. PVince81 commented on Nov 3, 2014

    @PVince81
    Contributor

    @enoch85 please raise as a separate ticket.
    I don't see any of the errors you're seeing in the original report, so it is very likely to be a different issue.

  23. coh7eiqu8thaBu commented on Feb 19, 2015

    @coh7eiqu8thaBu

    got the same bug.

    $OC_Version = array(7,0,4,2);
    $OC_VersionString = '7.0.4';
    $OC_Build = '2014-12-08T18:35:45+00:00';
    
    Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.6 OpenSSL/1.0.1f
    
    [Thu Feb 19 21:01:49.034700 2015] [:error] [pid 7658] [client 2a01:e35:ZZZZ:AAAA:BBBB:0000:XXXX:YYYY:XXXX] PHP Fatal error:  Call to undefined method OC_Share_Backend_Folder::getParents() in /var/www/owncloud/lib/private/share/share.php
    on line 1580, referer: https://www.XXXX.com/owncloud/index.php/apps/files?dir=%2FDocuments
    
  24. lock commented on Aug 2, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  25. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions