social icon indicating copy to clipboard operation
social copied to clipboard

Webfinger: `Exception parse_str(): Argument #1 ($string) must be of type string, null given in file '/opt/nextcloud/apps/social/lib/WellKnown/WebfingerHandler.php' line [...]`

Open HighWingy opened this issue 1 year ago • 12 comments

Describe the bug Going to the url for webfinger on my Nextcloud gives an internal server error. And when I check the logs, I see the following message:

Exception parse_str(): Argument #1 ($string) must be of type string, null given in file '/opt/nextcloud/apps/social/lib/WellKnown/WebfingerHandler.php' line 235

To Reproduce Steps to reproduce the behavior:

  1. Go to https://cloud.home.dragongames.net/index.php/.well-known/webfinger
  2. See error

Expected behavior I'm not entirely sure what is supposed to happen as I've never been able to get this to work. But I do know that the 500 error and the error in the log file are not correct

Screenshots n/a my site is public ish

Client details:

  • OS: Fedora 39
  • Browser: Chrome
  • Version: 29
  • Device: Laptop
Server details **Social app version:** 8.0 **Operating system**: Debian 12.5 **Web server:** Apache2 **Database:** MariaDB **PHP version:** 8.2 **Nextcloud version:** (see Nextcloud admin page) 29
Logs

Nextcloud log (data/nextcloud.log)

Exception parse_str(): Argument #1 ($string) must be of type string, null given in file '/opt/nextcloud/apps/social/lib/WellKnown/WebfingerHandler.php' line 235

#### Browser log

n/a this is all server side

HighWingy avatar Jun 05 '24 21:06 HighWingy

{
  "reqId": "IhilB622InmPCwv23SD0",
  "level": 4,
  "time": "2024-09-24T13:07:15+00:00",
  "remoteAddr": "192.168.7.117",
  "user": "--",
  "app": "social",
  "method": "GET",
  "url": "/apps/logreader/api/poll?lastReqId=RkpiDP9XvTgAf96Sv9l7",
  "message": "Error during app service registration: Call to undefined method OC\\Server::getEventDispatcher()",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
  "version": "30.0.0.14",
  "exception": {
    "Exception": "Error",
    "Message": "Call to undefined method OC\\Server::getEventDispatcher()",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/social/lib/AppInfo/Application.php",
        "line": 71,
        "function": "registerDeprecatedListener",
        "class": "OCA\\Social\\AppInfo\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
        "line": 99,
        "function": "register",
        "class": "OCA\\Social\\AppInfo\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
        "line": 48,
        "function": "registerApps",
        "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 657,
        "function": "runInitialRegistration",
        "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1132,
        "function": "init",
        "class": "OC",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 22,
        "args": [
          "/var/www/nextcloud/lib/base.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/apps/social/lib/AppInfo/Application.php",
    "Line": 82,
    "message": "Error during app service registration: Call to undefined method OC\\Server::getEventDispatcher()",
    "exception": [],
    "CustomMessage": "Error during app service registration: Call to undefined method OC\\Server::getEventDispatcher()"
  },
  "id": "66f2b98370f2a"
}

noci2012 avatar Sep 24 '24 13:09 noci2012

I didn't have this before, but I have it now that I updated to the release 0.7.0. Were you running a snapshot after 0.6.2 @HighWingy?

paulvt avatar Oct 28 '24 18:10 paulvt

DbalException An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_social_actor' doesn't exist

Both after upgrade and removal and reinstall, just opening the app).

noci2012 avatar Nov 07 '24 21:11 noci2012

While social should handle missing parameters better to avoid the exception (that's the bug), technically it doesn't impact functionality because it only occurs if you leave off the required ?resource= parameter when querying the /.well-known/webfinger URL.

joshtrichards avatar Nov 21 '24 18:11 joshtrichards

If you're able, test #1951. Should fix this issue.

joshtrichards avatar Nov 21 '24 19:11 joshtrichards

If you're able, test #1951. Should fix this issue.

It didn't for me. The error now is on line 229, which is, for me, this:

	parse_str(parse_url($requestUri, PHP_URL_QUERY), $query);

oculos avatar Nov 21 '24 20:11 oculos

I feel I should add I don't only get this error when going to the well-known url. It happens when trying to view user profiles via the social app, and various other actions on it. I can post and view messages, so it's not like it's completely broken. But that makes me think that there is something else going on for profile pages to also be generating this same error?

HighWingy avatar Nov 21 '24 21:11 HighWingy

this bug is still present in the last release installed via the app manager, and prevent nextcloud accounts from being followed from mastodon at least. this is a showstopper as it renders nextcloud social completely useless for most use cases (eg fediverse self hosting)

edit: it's not the webfinger. the webfinger works. but the URL retrieved next by mastodon just returns a broken webpage

Here are my logs (actual account name changed):

192.168.0.6 - - [22/Nov/2024:03:49:14 -0600] "GET /.well-known/webfinger?resource=acct:[email protected] HTTP/1.1" 200 1766 "-" "Mastodon/4.3.1 (http.rb/5.2.0; +https://chaos.social/)"
192.168.0.6 - - [22/Nov/2024:03:49:14 -0600] "GET /index.php/apps/social/@user HTTP/1.1" 200 2208 "-" "Mastodon/4.3.1 (http.rb/5.2.0; +https://chaos.social/)"

Last URL returns a page with an infinite spinner. and nothing else happens.

When I visit the above page while not being loaded, the page displays a popup that says: Failed to load relationship info

looks like there is a neglected entry for this bug: https://github.com/nextcloud/social/issues/1160

ghost avatar Nov 22 '24 09:11 ghost

I can confirm that bug is still present on NC 30.0.6. I have debugged situation, and path leads to webfinger handler direction on Social app. Unfortunately bug cripples app in whole.

1m2lab avatar Feb 26 '25 00:02 1m2lab

Still present on 30.0.9.

guandalf avatar Apr 13 '25 17:04 guandalf

If you're able, test #1951. Should fix this issue.

for me this fixed the issue. but yes the comment from come-nc on Nov 28, 2024 is right

dragonpil avatar Apr 18 '25 08:04 dragonpil

I'm still having the same issue. I was running v0.8.0, which I'm not sure where I got that one. But I've since removed that and installed the v0.7.0 that I see as the latest here on github. And on that one, the file is already very different from #1951 so no that doesn't work for me.

HighWingy avatar May 13 '25 16:05 HighWingy