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

[Bug] Failed to fetch albums list when go to Albums - also can't add photos to albums #1398

Closed
Tracked by #1280
nicrame opened this issue Oct 19, 2022 · 5 comments
Closed
Tracked by #1280
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@nicrame
Copy link

nicrame commented Oct 19, 2022

Describe the bug
When clicking on albums in photo app there is box with information Failed to fetch albums list, and "An error occured" message in the center.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Photos app.
  2. Click on Albums.

Expected behavior
Show albums.

Screenshots
Zrzut ekranu (11)
Zrzut ekranu (13)
Zrzut ekranu (17)
Zrzut ekranu (18)
Zrzut ekranu (19)

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Browser Firefox 106 and 106
  • Version - Nextcloud 25

Browser log

In the screenshots above.

Additional context
Nextcloud log: nextcloud.log

@nicrame nicrame added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Oct 19, 2022
@skjnldsv
Copy link
Member

skjnldsv commented Oct 26, 2022

@artonge

{
  "reqId": "HFVz7RvLO6tHg8Gbmj0E",
  "level": 3,
  "time": "2022-10-14T20:53:10+00:00",
  "remoteAddr": "78.9.155.233",
  "user": "Marcin",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/remote.php/dav/photos/Marcin/albums/",
  "message": "OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 202",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0",
  "version": "25.0.0.17",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 202",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php",
        "line": 202,
        "function": "__construct",
        "class": "OCA\\Photos\\Album\\AlbumFile",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Album/AlbumWithFiles.php",
        "line": 81,
        "function": "getForAlbumIdAndUserWithFiles",
        "class": "OCA\\Photos\\Album\\AlbumMapper",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Album/AlbumWithFiles.php",
        "line": 51,
        "function": "fetchFiles",
        "class": "OCA\\Photos\\Album\\AlbumWithFiles",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Sabre/Album/AlbumRoot.php",
        "line": 131,
        "function": "getFiles",
        "class": "OCA\\Photos\\Album\\AlbumWithFiles",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Sabre/Album/PropFindPlugin.php",
        "line": 116,
        "function": "getChildren",
        "class": "OCA\\Photos\\Sabre\\Album\\AlbumRoot",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php",
        "line": 95,
        "function": "OCA\\Photos\\Sabre\\Album\\{closure}",
        "class": "OCA\\Photos\\Sabre\\Album\\PropFindPlugin",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/photos/lib/Sabre/Album/PropFindPlugin.php",
        "line": 116,
        "function": "handle",
        "class": "Sabre\\DAV\\PropFind",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "propFind",
        "class": "OCA\\Photos\\Sabre\\Album\\PropFindPlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1052,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 984,
        "function": "getPropertiesByNode",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1662,
        "function": "getPropertiesIteratorForPath",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1647,
        "function": "writeMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 346,
        "function": "generateMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPropFind",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
        "line": 360,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/remote.php",
        "line": 167,
        "args": [
          "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/apps/photos/lib/Album/AlbumFile.php",
    "Line": 40,
    "message": "OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 202",
    "exception": {},
    "CustomMessage": "OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 202"
  }
}

@nicrame
Copy link
Author

nicrame commented Nov 4, 2022

Just updated to Nextcloud 25.01. There is same problem.
Here is the nextcloud.log report:

{"reqId":"pbBAcVETqseYqpKRnqr7","level":3,"time":"2022-11-04T08:17:32+00:00","remoteAddr":"192.168.50.1","user":"Marcin","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/photos/Marcin/albums/","message":"OCA\\Photos\\Album\\Albu
mFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 210","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/2010010
1 Firefox/106.0","version":"25.0.1.1","exception":{"Exception":"TypeError","Message":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Alb
um/AlbumMapper.php on line 210","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php","line":210,"function":"__construct","class":"OCA\\Photos\\Album\\AlbumFile","type":"->"},{"file":"/var/www/nextcloud/app
s/photos/lib/Album/AlbumWithFiles.php","line":81,"function":"getForAlbumIdAndUserWithFiles","class":"OCA\\Photos\\Album\\AlbumMapper","type":"->"},{"file":"/var/www/nextcloud/apps/photos/lib/Album/AlbumWithFiles.php","line":51,"function"
:"fetchFiles","class":"OCA\\Photos\\Album\\AlbumWithFiles","type":"->"},{"file":"/var/www/nextcloud/apps/photos/lib/Sabre/Album/AlbumRoot.php","line":133,"function":"getFiles","class":"OCA\\Photos\\Album\\AlbumWithFiles","type":"->"},{"f
ile":"/var/www/nextcloud/apps/photos/lib/Sabre/Album/PropFindPlugin.php","line":129,"function":"getChildren","class":"OCA\\Photos\\Sabre\\Album\\AlbumRoot","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php"
,"line":95,"function":"OCA\\Photos\\Sabre\\Album\\{closure}","class":"OCA\\Photos\\Sabre\\Album\\PropFindPlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/photos/lib/Sabre/Album/PropFi
ndPlugin.php","line":129,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"OCA\\Photos\\Sabre\\Album\\P
ropFindPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","li
ne":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","typ
e":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line"
:346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"-
>"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invok
eMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server
.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remo
te.php","line":171,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/photos/lib/Album/AlbumFile.php","Line":40,"message":"OCA\\Photos\\Album\\AlbumFile::__construct()
: Argument #8 ($owner) must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 210","exception":{},"CustomMessage":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #8 ($owner)
 must be of type string, null given, called in /var/www/nextcloud/apps/photos/lib/Album/AlbumMapper.php on line 210"}}

@GitWidi
Copy link

GitWidi commented Nov 8, 2022

I had the same problems and was hoping it would be over with a release for NC 25. Unfortunately, that was not the case.
Now I have found that it seems to be due to old data in the database tables for albums. Presumably these are from a pre-release version of the app Photos.
In my case there were some old entries in the table photos_albums_files with a NULL value in the column owner. These led to the error.
I used a DB tool to edit the database, deleted these old entries ... and now it works.

Regards, Friedbert

@nicrame
Copy link
Author

nicrame commented Nov 8, 2022

@GitWidi It was the solution. Thank You!

@nicrame nicrame closed this as completed Nov 8, 2022
@sakihayashi
Copy link

I faced the same issue.
I don't find DB. Where is it?
I created a subdomain and installed NextCloud with web installer using community version.
Can anyone help? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants