Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trashbin doesn't load #13428

Closed
LEDfan opened this issue Jan 8, 2019 · 19 comments

Comments

@LEDfan
Copy link
Member

@LEDfan LEDfan commented Jan 8, 2019

Steps to reproduce

  1. open trashbin

Expected behaviour

Trashbin should load.

Actual behaviour

Trashbin doesn't load, 500 returned to PROPFIND request.

Server configuration

Operating system: Centos 7.6

Web server: Apache/2.4.6

Database: mysql Ver 15.1 Distrib 5.5.60-MariaDB,

PHP version: PHP 7.3.0

Nextcloud version: 15.0.0

Updated from an older Nextcloud/ownCloud or fresh install: updated from 14 (and 15 beta/rc)

Where did you install Nextcloud from: zip file

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - accessibility: 1.1.0
  - activity: 2.8.2
  - bookmarks: 0.15.1
  - calendar: 1.6.4
  - cloud_federation_api: 0.1.0
  - comments: 1.5.0
  - contacts: 3.0.1
  - dav: 1.8.0
  - deck: 0.5.2
  - encryption: 2.3.0
  - federatedfilesharing: 1.5.0
  - federation: 1.5.0
  - files: 1.10.0
  - files_external: 1.6.0
  - files_pdfviewer: 1.4.0
  - files_sharing: 1.7.0
  - files_texteditor: 2.7.0
  - files_trashbin: 1.5.0
  - files_versions: 1.8.0
  - files_videoplayer: 1.4.0
  - gallery: 18.2.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.3.0
  - mail: 0.11.0
  - news: 13.0.3
  - nextcloud_announcements: 1.4.0
  - notifications: 2.3.0
  - oauth2: 1.3.0
  - password_policy: 1.5.0
  - previewgenerator: 2.0.0
  - provisioning_api: 1.5.0
  - serverinfo: 1.5.0
  - sharebymail: 1.5.0
  - spreed: 5.0.0
  - support: 1.0.0
  - survey_client: 1.3.0
  - systemtags: 1.5.0
  - theming: 1.6.0
  - twofactor_backupcodes: 1.4.1
  - twofactor_totp: 2.1.0
  - updatenotification: 1.5.0
  - workflowengine: 1.5.0
Disabled:
  - admin_audit
  - bookmarks.bak
  - caniupdate
  - drawio
  - end_to_end_encryption
  - files_downloadactivity
  - firstrunwizard
  - user_external
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            ""
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "15.0.0.10",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "maintenance": false,
        "maxZipInputSize": 0,
        "allowZipDownload": true,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "app.mail.server-side-cache.enabled": true,
        "trashbin_retention_obligation": "auto",
        "preview_max_scale_factor": 1,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "htaccess.RewriteBase": "\/",
        "overwrite.cli.url": "",
        "updater.release.channel": "stable",
        "mysql.utf8mb4": true,
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2
    }
}

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

Are you using encryption: No.

Nextcloud log (data/nextcloud.log)

Nextcloud log
{
  "reqId": "XDTLVTxaidDFwsfofQbtZgAAAAo",
  "level": 3,
  "time": "2019-01-08T16:09:58+00:00",
  "remoteAddr": "",
  "user": "ledfan",
  "app": "remote",
  "method": "PROPFIND",
  "url": "/remote.php/dav/trashbin/ledfan/trash",
  "message": {
    "Exception": "TypeError",
    "Message": "Argument 2 passed to OCA\\Files_Trashbin\\Trash\\TrashItem::__construct() must be of the type string, null given, called in /srv/host.be/www/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php on line 57",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php",
        "line": 57,
        "function": "__construct",
        "class": "OCA\\Files_Trashbin\\Trash\\TrashItem",
        "type": "->",
        "args": [
          "*** sensitive parameter replaced ***",
          null,
          1532667637,
          "/Applications-laptop.d1532667637",
          "*** sensitive parameter replaced ***",
          {
            "__class__": "OC\\User\\User"
          }
        ]
      },
      {
        "function": "OCA\\Files_Trashbin\\Trash\\{closure}",
        "class": "OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php",
        "line": 55,
        "function": "array_map",
        "args": [
          {
            "__class__": "Closure"
          },
          [
            {
              "__class__": "OC\\Files\\FileInfo___ a lot of these!"
            }
          ]
        ]
      },
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php",
        "line": 69,
        "function": "mapTrashItems",
        "class": "OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\Files\\FileInfo___ a lot of these!"
          }
        ]
      },
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Trash/TrashManager.php",
        "line": 48,
        "function": "listTrashRoot",
        "class": "OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\User\\User"
          }
        ]
      },
      {
        "function": "OCA\\Files_Trashbin\\Trash\\{closure}",
        "class": "OCA\\Files_Trashbin\\Trash\\TrashManager",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Trash/TrashManager.php",
        "line": 49,
        "function": "array_reduce",
        "args": [
          {
            "OCP\\Files\\Storage\\IStorage": "*** sensitive parameter replaced ***"
          },
          {
            "__class__": "Closure"
          },
          "*** sensitive parameter replaced ***"
        ]
      },
      {
        "file": "/srv/host.be/www/apps/files_trashbin/lib/Sabre/TrashRoot.php",
        "line": 68,
        "function": "listTrashRoot",
        "class": "OCA\\Files_Trashbin\\Trash\\TrashManager",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\User\\User"
          }
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 195,
        "function": "getChildren",
        "class": "OCA\\Files_Trashbin\\Sabre\\TrashRoot",
        "type": "->",
        "args": []
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 899,
        "function": "getChildren",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "trashbin/ledfan/trash"
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 978,
        "function": "generatePathNodes",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\DAV\\PropFind"
          },
          [
            {
              "__class__": "Sabre\\DAV\\PropFind"
            },
            {
              "__class__": "OCA\\Files_Trashbin\\Sabre\\TrashRoot"
            }
          ]
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1666,
        "function": "getPropertiesIteratorForPath",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "trashbin/ledfan/trash",
          [
            "{http://nextcloud.org/ns}trashbin-filename",
            "{http://nextcloud.org/ns}trashbin-deletion-time",
            "{DAV:}getlastmodified",
            "{DAV:}getetag",
            "{DAV:}getcontenttype",
            "{DAV:}resourcetype",
            "{http://owncloud.org/ns}fileid",
            "{http://owncloud.org/ns}permissions",
            "{http://owncloud.org/ns}size",
            "{DAV:}getcontentlength",
            "{http://nextcloud.org/ns}has-preview",
            "{http://nextcloud.org/ns}mount-type",
            "{http://nextcloud.org/ns}is-encrypted",
            "{http://open-collaboration-services.org/ns}share-permissions",
            "{http://owncloud.org/ns}comments-unread"
          ],
          1
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 355,
        "function": "generateMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Generator"
          },
          false
        ]
      },
      {
        "function": "httpPropFind",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://host.be/remote.php/dav/trashbin/ledfan/trash",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/event/lib/EventEmitterTrait.php",
        "line": 105,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "__class__": "Sabre\\DAV\\CorePlugin"
            },
            "httpPropFind"
          ],
          [
            {
              "absoluteUrl": "https://host.be/remote.php/dav/trashbin/ledfan/trash",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 479,
        "function": "emit",
        "class": "Sabre\\Event\\EventEmitter",
        "type": "->",
        "args": [
          "method:PROPFIND",
          [
            {
              "absoluteUrl": "https://host.be/remote.php/dav/trashbin/ledfan/trash",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/srv/host.be/www/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 254,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://host.be/remote.php/dav/trashbin/ledfan/trash",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/srv/host.be/www/apps/dav/lib/Server.php",
        "line": 301,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/srv/host.be/www/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/srv/host.be/www/remote.php",
        "line": 163,
        "args": [
          "/srv/host.be/www/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/srv/host.be/www/apps/files_trashbin/lib/Trash/TrashItem.php",
    "Line": 41,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0",
  "version": "15.0.1.0",
  "id": "5c34cb656b6b4"
}

I tried to run a occ files:scan and clean command, but that didn't help. I never had the issue in 14, but now having it in 15 (upgraded since the beta, but never loaded the trahsbin...)

I guess cc @icewind1991 because you refactored the trashbin code 😃

@LEDfan LEDfan changed the title Tashbin doesn't load Trashbin doesn't load Jan 14, 2019
@felix-berlin

This comment has been minimized.

Copy link

@felix-berlin felix-berlin commented Jan 14, 2019

Same problem here. I use v15.02

@ja573

This comment has been minimized.

Copy link

@ja573 ja573 commented Jan 16, 2019

Same problem on v15.0.2 over docker, using nginx and nextcloud:fpm

@ja573

This comment has been minimized.

Copy link

@ja573 ja573 commented Jan 16, 2019

The actual error I get is:

[remote] Error: TypeError: Argument 2 passed to OCA\Files_Trashbin\Trash\TrashItem::__construct() must be of the type string, null given, called in /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php on line 62 at <>

  1. /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 62
    __construct("*** sensitive parameter replaced ", null, 1525437913, "/Salesdata.d1525437913", " sensitive parameter replaced ***", OC\User\User {})
  2. <>
    OCA\Files_Trashbin\Trash{closure}("*** sensitive parameters replaced ***")
  3. /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 64
    array_map(Closure {}, ["*** sensitive ... }])
  4. /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 69
    mapTrashItems(["*** sensitive ... }], OC\User\User {})
  5. /var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php line 48
    listTrashRoot(OC\User\User {})
  6. <>
    OCA\Files_Trashbin\Trash{closure}("*** sensitive parameters replaced ***")
  7. /var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php line 49
    array_reduce({OCP\Files\Stora ... "}, Closure {}, "*** sensitive parameter replaced ***")
  8. /var/www/html/apps/files_trashbin/lib/Sabre/TrashRoot.php line 68
    listTrashRoot(OC\User\User {})
  9. /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php line 195
    getChildren()
  10. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 899
    getChildren("trashbin/javi/trash")
  11. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 978
    generatePathNodes(Sabre\DAV\PropFind {}, [Sabre\DAV\PropF ... }])
  12. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    getPropertiesIteratorForPath("trashbin/javi/trash", ["{http://nextcl ... "], 1)
  13. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    generateMultiStatus(Generator {}, false)
  14. <>
    httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  15. /var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
  16. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
  17. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
  18. /var/www/html/apps/dav/lib/Server.php line 301
    exec()
  19. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    exec()
  20. /var/www/html/remote.php line 163
    require_once("/var/www/html/a ... p")
@paskalito

This comment has been minimized.

@paskalito

This comment has been minimized.

Copy link

@paskalito paskalito commented Jan 23, 2019

i have the same problem my log goes as

[remote] Error: TypeError: Return value of OCA\Files_Trashbin\Sabre\AbstractTrash::getSize() must be of the type int, float returned at <<closure>>

 0. /var/www/html/owncloud/apps/files_trashbin/lib/Sabre/PropfindPlugin.php line 78
    getSize()
 1. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/PropFind.php line 98
    OCA\Files_Trashbin\Sabre\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/owncloud/apps/files_trashbin/lib/Sabre/PropfindPlugin.php line 79
    handle("{http://owncloud.org/ns}size", Closure {})
 3. <<closure>>
    propFind(Sabre\DAV\PropFind {}, OCA\Files_Trashbin\Sabre\TrashFolder {})
 4. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([OCA\Files_Trash ... "], [Sabre\DAV\PropF ... }])
 5. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1059
    emit("propFind", [Sabre\DAV\PropF ... }])
 6. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 981
    getPropertiesByNode(Sabre\DAV\PropFind {}, OCA\Files_Trashbin\Sabre\TrashFolder {})
 7. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    getPropertiesIteratorForPath("trashbin/xxxx/trash", ["{http://nextcl ... "], 1)
 8. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    generateMultiStatus(Generator {}, false)
 9. <<closure>>
    httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
10. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
11. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
12. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
13. /var/www/html/owncloud/apps/dav/lib/Server.php line 301
    exec()
14. /var/www/html/owncloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
15. /var/www/html/owncloud/remote.php line 163
    require_once("/var/www/html/o ... p")

PROPFIND /owncloud/remote.php/dav/trashbin/xxxx/trash
from 87.123.193.166 by xxxx at 2019-01-22T17:26:49+00:00

also additionaly an account where there are no deleted files successfully loads the page saying that there are no deleted files.

and also when i create one textfile and then deletes it works. - i can see and recover it in deleted files.

@mateusfmello

This comment has been minimized.

Copy link

@mateusfmello mateusfmello commented Jan 24, 2019

I have the same problem

CentOS 7.6
Apache 2.4.6
PHP 7.2
PostgreSQL 9.6.11
Nextcloud 15.0.2.0

[remote] Error: TypeError: Argument 2 passed to OCA\Files_Trashbin\Trash\TrashItem::__construct() must be of the type string, null given, called in /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php on line 62 at <<closure>>

 0. /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 62
    __construct("*** sensitive parameter replaced ***", null, 1541076592, "/Comprovante_09 ... 2", "*** sensitive parameter replaced ***", OC\User\User {})
 1. <<closure>>
    OCA\Files_Trashbin\Trash\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 64
    array_map(Closure {}, [OC\Files\FileIn ... }])
 3. /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 69
    mapTrashItems([OC\Files\FileIn ... }], OC\User\User {})
 4. /var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php line 48
    listTrashRoot(OC\User\User {})
 5. <<closure>>
    OCA\Files_Trashbin\Trash\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php line 49
    array_reduce({OCP\Files\Stora ... }}, Closure {}, "*** sensitive parameter replaced ***")
 7. /var/www/nextcloud/apps/files_trashbin/lib/Sabre/TrashRoot.php line 68
    listTrashRoot(OC\User\User {})
 8. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 195
    getChildren()
 9. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 899
    getChildren("trashbin/mateus/trash")
10. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 978
    generatePathNodes(Sabre\DAV\PropFind {}, [Sabre\DAV\PropF ... }])
11. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    getPropertiesIteratorForPath("trashbin/mateus/trash", ["{http://nextcl ... "], 1)
12. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    generateMultiStatus(Generator {}, false)
13. <<closure>>
    httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
14. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
15. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
16. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
17. /var/www/nextcloud/apps/dav/lib/Server.php line 301
    exec()
18. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
19. /var/www/nextcloud/remote.php line 163
    require_once("/var/www/nextcl ... p")

PROPFIND /remote.php/dav/trashbin/mateus/trash
from 10.0.0.11 by mateus at 2019-01-24T19:56:05+00:00
@paskalito

This comment has been minimized.

Copy link

@paskalito paskalito commented Jan 25, 2019

@icewind1991 Do you have any thoughts on this?

@ALL i am in the situation that loads of data got deleted that need to be recovered as soon as possible, and at least preferably before they get deleted in the trashbin. that should happen in about 10 days.

I have a filesystem backup of the data, so it should not get lost entirely, but its like 30GB, and its on the other side of the world with not so fast internet connection. do you have any recemendation, how i could add the data to server again directly?
maybe add it again to the filestructure and then run the occ:filesscan command from above?

@koehn

This comment has been minimized.

Copy link

@koehn koehn commented Jan 26, 2019

FWIW I had this same problem and ran occ trashbin:cleanup [userid] and afterwards I could view my (now empty) deleted items folder.

@paskalito

This comment has been minimized.

Copy link

@paskalito paskalito commented Jan 28, 2019

i went for restoring the data from my backup and doing a file scan which luckily seems to work.

@frederikmoellers

This comment has been minimized.

Copy link

@frederikmoellers frederikmoellers commented Jan 29, 2019

Edit: Don't follow this workaround, there is a PR with a proper fix. See the next comment for details.

As a workaround, try this:
Open file apps/files_trashbin/lib/Trash/LegacyTrashBackend.php with an editor. Go to line 58. It should be something like

$isRoot ? $file['extraData'] : $parent->getOriginalLocation() . '/' . $file->getName(),

Then, replace this line by the following:

$isRoot ? '/' . $file->getName() : $parent->getOriginalLocation() . '/' . $file->getName(),

Don't read the rest if you just want a quick fix.
I tried to understand the code (which is hard because there are virtually no comments describíng what exactly is happening within a function), but failed. I thought that this would restore files which were in the root of the trash bin to the root directory. However, I just tested it with a file that was removed individually (i.e. the directory was not removed as a whole, so the file ended up in the root of the trash bin) and it ended back in the directory it was originally in. So in the end I'm pretty sure that this workaround is not correct wrt. how the function should work, but so far I just don't see what exactly is wrong about it.

Unless someone from the team jumps in to provide some help/guidance I probably won't research this further and won't submit a PR, simply because I still think this is not a correct/good fix and I don't have the time to work my head around the code to make a good one :(

@kesselb

This comment has been minimized.

Copy link
Contributor

@kesselb kesselb commented Jan 29, 2019

#13886 might work for you? 🤔

@frederikmoellers

This comment has been minimized.

Copy link

@frederikmoellers frederikmoellers commented Jan 30, 2019

Indeed, thanks for the pointer! I updated my comment to not mislead anyone coming here.

This issue is also a duplicate of #13005, if anybody wants to mark it as such and close it.

@kesselb

This comment has been minimized.

Copy link
Contributor

@kesselb kesselb commented Jan 30, 2019

Closed by #13886. Fix will be part of 15.0.3.

@rpellerin

This comment has been minimized.

Copy link

@rpellerin rpellerin commented Mar 4, 2019

@kesselb I am running 15.0.5 and the problem is still there. Wasn't it released?

Here is some extract of the logs:

{"Exception":"TypeError","Message":"Return value of OCA\\Files_Trashbin\\Sabre\\AbstractTrash::getSize() must be of the type integer, float returned","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Sabre\/PropfindPlugin.php","line":78,"function":"getSize","class":"OCA\\Files_Trashbin\\Sabre\\AbstractTrash","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/PropFind.php","line":98,"function":"OCA\\Files_Trashbin\\Sabre\\{closure}","class":"OCA\\Files_Trashbin\\Sabre\\PropfindPlugin",
@alexandernst

This comment has been minimized.

Copy link

@alexandernst alexandernst commented Mar 14, 2019

I too get this problem and I'm on 15.0.5

{"reqId":"SZjkbPIstzqCB6apncPs","level":3,"time":"2019-03-14T12:37:30+00:00","remoteAddr":"172.16.20.23","user":"foobar","app":"remote","method":"PROPFIND","url":"\/remote.php\/dav\/trashbin\/root\/trash","message":{"Exception":"TypeError","Message":"Argument 3 passed to OCA\\Files_Trashbin\\Trash\\TrashItem::__construct() must be of the type integer, string given, called in \/var\/www\/nextcloud\/apps\/groupfolders\/lib\/Trash\/TrashBackend.php on line 209","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/apps\/groupfolders\/lib\/Trash\/TrashBackend.php","line":209,"function":"__construct","class":"OCA\\Files_Trashbin\\Trash\\TrashItem","type":"->","args":["*** sensitive parameter replaced ***","","art","\/7\/Parte admin.bmpr.d1552566701.part",{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/nextcloud\/apps\/groupfolders\/lib\/Trash\/TrashBackend.php","line":65,"function":"getTrashForFolders","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[{"__class__":"OC\\User\\User"},[2,3,4,1,5,6,7]]},{"file":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashManager.php","line":48,"function":"listTrashRoot","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"function":"OCA\\Files_Trashbin\\Trash\\{closure}","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashManager.php","line":49,"function":"array_reduce","args":[{"OCP\\Files\\Storage\\IStorage":{"__class__":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend"},"OCA\\GroupFolders\\Mount\\GroupFolderStorage":"*** sensitive parameter replaced ***"},{"__class__":"Closure"},"*** sensitive parameter replaced ***"]},{"file":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Sabre\/TrashRoot.php","line":68,"function":"listTrashRoot","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php","line":195,"function":"getChildren","class":"OCA\\Files_Trashbin\\Sabre\\TrashRoot","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":899,"function":"getChildren","class":"Sabre\\DAV\\Tree","type":"->","args":["trashbin\/root\/trash"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":978,"function":"generatePathNodes","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashRoot"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":1666,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["trashbin\/root\/trash",["{http:\/\/nextcloud.org\/ns}trashbin-filename","{http:\/\/nextcloud.org\/ns}trashbin-deletion-time","{http:\/\/nextcloud.org\/ns}trashbin-original-location","{DAV:}getlastmodified","{DAV:}getetag","{DAV:}getcontenttype","{DAV:}resourcetype","{http:\/\/owncloud.org\/ns}fileid","{http:\/\/owncloud.org\/ns}permissions","{http:\/\/owncloud.org\/ns}size","{DAV:}getcontentlength","{http:\/\/nextcloud.org\/ns}has-preview","{http:\/\/nextcloud.org\/ns}mount-type","{http:\/\/nextcloud.org\/ns}is-encrypted","{http:\/\/open-collaboration-services.org\/ns}share-permissions","{http:\/\/owncloud.org\/ns}comments-unread"],1]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":355,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"http:\/\/cloud.develat.io\/remote.php\/dav\/trashbin\/root\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPropFind"],[{"absoluteUrl":"http:\/\/cloud.develat.io\/remote.php\/dav\/trashbin\/root\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PROPFIND",[{"absoluteUrl":"http:\/\/cloud.develat.io\/remote.php\/dav\/trashbin\/root\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"http:\/\/cloud.develat.io\/remote.php\/dav\/trashbin\/root\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php","line":301,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":163,"args":["\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashItem.php","Line":41,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/73.0.3683.75 Safari\/537.36","version":"15.0.5.3"}

I'm using S3 as my primary storage.

@paskalito

This comment has been minimized.

Copy link

@paskalito paskalito commented Mar 17, 2019

Same for me - nohing changed with the update
@kesselb do you wanna reopen this issue or do we need to open a new one?

@kesselb

This comment has been minimized.

Copy link
Contributor

@kesselb kesselb commented Mar 17, 2019

If you see AbstractTrash::getSize() must be of the type integer, float returned in your logs than #13160 is the right issue for you.

@kesselb

This comment has been minimized.

Copy link
Contributor

@kesselb kesselb commented Mar 17, 2019

@alexandernst looks like an issue with the groupfolders. Could you report this issue to https://github.com/nextcloud/groupfolders/issues?

@bcutter

This comment has been minimized.

Copy link

@bcutter bcutter commented Mar 17, 2019

Same for me, fix doesn´t work cause it´s already applied in AbstractTrash.php.
Running on a Raspberry Pi with NC v15.0.5.3, deleted files totally at least 8 to 9 GB. No way to recover... horrible, I´m lost :-(

@nextcloud nextcloud locked as resolved and limited conversation to collaborators Mar 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.