pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.89k stars 77 forks source link

StorageInvalidException: Sabre\HTTP\ClientHttpException: Unauthorized #1187

Open simonspa opened 3 weeks ago

simonspa commented 3 weeks ago

Describe the bug

In the Nextcloud logger I see many entries of Memories trying to index a folder that is a share from a remote Nextcloud server. According to the error message, it does not seem to be able to access the folder. Curiously, there is no issue when accessing it via the Files app and all content can be accessed and displayed.

See errors below.

To Reproduce Receive a federated share from a remote Nextcloud server, observe errors by Memories in Nextcloud log.

Platform:

Additional context Nextcloud server log errors:

{
    "reqId": "7ltsAUNDVwVMu4W1QQUB",
    "level": 3,
    "time": "2024-05-12T21:25:18+02:00",
    "remoteAddr": "",
    "user": "--",
    "app": "memories",
    "method": "",
    "url": "--",
    "message": "Failed to index folder /path/to/shared/folder: ",
    "userAgent": "--",
    "version": "28.0.5.1",
    "data":
    {
        "app": "memories"
    },
    "id": "6641199fca0b7"
}

ANd right before that, the SabreDAV warning log entry:

{
    "reqId": "7ltsAUNDVwVMu4W1QQUB",
    "level": 2,
    "time": "2024-05-12T21:25:18+02:00",
    "remoteAddr": "",
    "user": "--",
    "app": "no app in context",
    "method": "",
    "url": "--",
    "message": "External storage not available: Sabre\\HTTP\\ClientHttpException: Unauthorized",
    "userAgent": "--",
    "version": "28.0.5.1",
    "exception":
    {
        "Exception": "OCP\\Files\\StorageInvalidException",
        "Message": "Sabre\\HTTP\\ClientHttpException: Unauthorized",
        "Code": 0,
        "Trace":
        [
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/DAV.php",
                "line": 298,
                "function": "convertException",
                "class": "OC\\Files\\Storage\\DAV",
                "type": "->",
                "args":
                [
                    [
                        "Sabre\\HTTP\\ClientHttpException"
                    ],
                    ""
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/DAV.php",
                "line": 600,
                "function": "propfind",
                "class": "OC\\Files\\Storage\\DAV",
                "type": "->",
                "args":
                [
                    ""
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/DAV.php",
                "line": 660,
                "function": "getMetaData",
                "class": "OC\\Files\\Storage\\DAV",
                "type": "->",
                "args":
                [
                    ""
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Common.php",
                "line": 466,
                "function": "stat",
                "class": "OC\\Files\\Storage\\DAV",
                "type": "->",
                "args":
                [
                    ""
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php",
                "line": 213,
                "function": "test",
                "class": "OC\\Files\\Storage\\Common",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 480,
                "function": "test",
                "class": "OCA\\Files_Sharing\\External\\Storage",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
                "line": 69,
                "function": "test",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
                "line": 83,
                "function": "updateAvailability",
                "class": "OC\\Files\\Storage\\Wrapper\\Availability",
                "type": "->",
                "args":
                [
                    "*** sensitive parameters replaced ***"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
                "line": 92,
                "function": "isAvailable",
                "class": "OC\\Files\\Storage\\Wrapper\\Availability",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
                "line": 242,
                "function": "checkAvailability",
                "class": "OC\\Files\\Storage\\Wrapper\\Availability",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 233,
                "function": "file_exists",
                "class": "OC\\Files\\Storage\\Wrapper\\Availability",
                "type": "->",
                "args":
                [
                    ".nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/View.php",
                "line": 1332,
                "function": "file_exists",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->",
                "args":
                [
                    ".nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/View.php",
                "line": 1376,
                "function": "getCacheEntry",
                "class": "OC\\Files\\View",
                "type": "->",
                "args":
                [
                    [
                        "OCA\\Files_Trashbin\\Storage",
                        null,
                        null,
                        null,
                        null,
                        null
                    ],
                    ".nomedia",
                    "/path/to/shared/folder/.nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Node/Root.php",
                "line": 203,
                "function": "getFileInfo",
                "class": "OC\\Files\\View",
                "type": "->",
                "args":
                [
                    "/path/to/shared/folder/.nomedia",
                    false
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Node/Folder.php",
                "line": 135,
                "function": "get",
                "class": "OC\\Files\\Node\\Root",
                "type": "->",
                "args":
                [
                    "/path/to/shared/folder/.nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/Files/Node/Folder.php",
                "line": 144,
                "function": "get",
                "class": "OC\\Files\\Node\\Folder",
                "type": "->",
                "args":
                [
                    ".nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Service/Index.php",
                "line": 142,
                "function": "nodeExists",
                "class": "OC\\Files\\Node\\Folder",
                "type": "->",
                "args":
                [
                    ".nomedia"
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Service/Index.php",
                "line": 215,
                "function": "indexFolder",
                "class": "OCA\\Memories\\Service\\Index",
                "type": "->",
                "args":
                [
                    [
                        "OC\\Files\\Node\\Folder"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Service/Index.php",
                "line": 215,
                "function": "indexFolder",
                "class": "OCA\\Memories\\Service\\Index",
                "type": "->",
                "args":
                [
                    [
                        "OC\\Files\\Node\\Folder"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Service/Index.php",
                "line": 120,
                "function": "indexFolder",
                "class": "OCA\\Memories\\Service\\Index",
                "type": "->",
                "args":
                [
                    [
                        "OC\\Files\\Node\\Folder"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Cron/IndexJob.php",
                "line": 92,
                "function": "indexUser",
                "class": "OCA\\Memories\\Service\\Index",
                "type": "->",
                "args":
                [
                    "*** sensitive parameters replaced ***"
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/private/User/Manager.php",
                "line": 656,
                "function": "OCA\\Memories\\Cron\\{closure}",
                "class": "OCA\\Memories\\Cron\\IndexJob",
                "type": "->",
                "args":
                [
                    "*** sensitive parameters replaced ***"
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Cron/IndexJob.php",
                "line": 90,
                "function": "callForSeenUsers",
                "class": "OC\\User\\Manager",
                "type": "->",
                "args":
                [
                    [
                        "Closure"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/memories/lib/Cron/IndexJob.php",
                "line": 63,
                "function": "indexAllUsers",
                "class": "OCA\\Memories\\Cron\\IndexJob",
                "type": "->",
                "args":
                []
            },
            {
                "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
                "line": 81,
                "function": "run",
                "class": "OCA\\Memories\\Cron\\IndexJob",
                "type": "->",
                "args":
                [
                    null
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                "line": 102,
                "function": "start",
                "class": "OCP\\BackgroundJob\\Job",
                "type": "->",
                "args":
                [
                    [
                        "OC\\BackgroundJob\\JobList"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                "line": 92,
                "function": "start",
                "class": "OCP\\BackgroundJob\\TimedJob",
                "type": "->",
                "args":
                [
                    [
                        "OC\\BackgroundJob\\JobList"
                    ]
                ]
            },
            {
                "file": "/var/www/nextcloud/cron.php",
                "line": 152,
                "function": "execute",
                "class": "OCP\\BackgroundJob\\TimedJob",
                "type": "->",
                "args":
                [
                    [
                        "OC\\BackgroundJob\\JobList"
                    ],
                    [
                        "OC\\Log"
                    ]
                ]
            }
        ],
        "File": "/var/www/nextcloud/lib/private/Files/Storage/DAV.php",
        "Line": 881,
        "message": "External storage not available: Sabre\\HTTP\\ClientHttpException: Unauthorized",
        "exception":
        [],
        "CustomMessage": "External storage not available: Sabre\\HTTP\\ClientHttpException: Unauthorized"
    },
    "id": "6641199fca2d1"
}