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

IEventDispatcher issue on 27 #828

Closed
juliushaertl opened this issue Aug 11, 2023 · 5 comments · Fixed by #833
Closed

IEventDispatcher issue on 27 #828

juliushaertl opened this issue Aug 11, 2023 · 5 comments · Fixed by #833
Assignees
Labels
1. to develop bug Something isn't working

Comments

@juliushaertl
Copy link
Member

Using the latest release on my 27 instance caused the following log entry:

We cannot just pass the IEventDispatcher here for Nextcloud <28, so we may need a fallback to pass the SymfonyDispatcher on older releases.

I can check this next week.

{
  "reqId": "YiBHLTQHe1Pao8XpFaFQ",
  "level": 3,
  "time": "2023-08-11T14:15:39+00:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job (class: OCA\\Collectives\\BackgroundJob\\ExpirePageVersions, arguments: )",
  "userAgent": "--",
  "version": "27.1.0.0",
  "exception": {
    "Exception": "TypeError",
    "Message": "OC\\User\\User::__construct(): Argument #3 ($dispatcher) must be of type Symfony\\Component\\EventDispatcher\\EventDispatcherInterface, OC\\EventDispatcher\\EventDispatcher given, called in /var/www/nextcloud/apps-extra/collectives/lib/Versions/CollectiveVersionsExpireManager.php on line 121",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps-extra/collectives/lib/Versions/CollectiveVersionsExpireManager.php",
        "line": 121,
        "function": "__construct",
        "class": "OC\\User\\User",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/collectives/lib/Versions/CollectiveVersionsExpireManager.php",
        "line": 96,
        "function": "expireFolder",
        "class": "OCA\\Collectives\\Versions\\CollectiveVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps-extra/collectives/lib/BackgroundJob/ExpirePageVersions.php",
        "line": 35,
        "function": "expireAll",
        "class": "OCA\\Collectives\\Versions\\CollectiveVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 81,
        "function": "run",
        "class": "OCA\\Collectives\\BackgroundJob\\ExpirePageVersions",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 103,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 93,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/User/User.php",
    "Line": 105,
    "message": "Error while running background job (class: OCA\\Collectives\\BackgroundJob\\ExpirePageVersions, arguments: )",
    "exception": {},
    "CustomMessage": "Error while running background job (class: OCA\\Collectives\\BackgroundJob\\ExpirePageVersions, arguments: )"
  }
}
@juliushaertl juliushaertl added the bug Something isn't working label Aug 11, 2023
@juliushaertl juliushaertl self-assigned this Aug 11, 2023
@solracsf
Copy link
Member

solracsf commented Aug 12, 2023

Also affects 25.0.10.

{
  "reqId": "yW7lz1Jft8FD4R4Mf8qg",
  "level": 3,
  "time": "2023-08-11T03:03:29+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "cron",
  "method": "",
  "url": "--",
  "message": "OC\\User\\User::__construct(): Argument #3 ($dispatcher) must be of type Symfony\\Component\\EventDispatcher\\EventDispatcherInterface, OC\\EventDispatcher\\EventDispatcher given, called in /var/www/nextcloud/apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php on line 121",
  "userAgent": "--",
  "version": "25.0.10.1",
  "exception": {
    "Exception": "TypeError",
    "Message": "OC\\User\\User::__construct(): Argument #3 ($dispatcher) must be of type Symfony\\Component\\EventDispatcher\\EventDispatcherInterface, OC\\EventDispatcher\\EventDispatcher given, called in /var/www/nextcloud/apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php on line 121",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php",
        "line": 121,
        "function": "__construct",
        "class": "OC\\User\\User",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php",
        "line": 96,
        "function": "expireFolder",
        "class": "OCA\\Collectives\\Versions\\CollectiveVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/collectives/lib/BackgroundJob/ExpirePageVersions.php",
        "line": 35,
        "function": "expireAll",
        "class": "OCA\\Collectives\\Versions\\CollectiveVersionsExpireManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 78,
        "function": "run",
        "class": "OCA\\Collectives\\BackgroundJob\\ExpirePageVersions",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 103,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 93,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 152,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/User/User.php",
    "Line": 101,
    "CustomMessage": "--"
  },
  "id": "64d7c6d35f930"
}

@theroch
Copy link

theroch commented Aug 23, 2023

Same on Nextcloud 26.0.5 with Collectives 2.7.0

TypeError: OC\User\User::__construct(): Argument #3 ($dispatcher) must be of type Symfony\Component\EventDispatcher\EventDispatcherInterface, OC\EventDispatcher\EventDispatcher given, called in apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php on line 121 and defined in lib/private/User/User.php:101
Stack trace:
#0 apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php(121): OC\User\User->__construct()
#1 apps/collectives/lib/Versions/CollectiveVersionsExpireManager.php(96): OCA\Collectives\Versions\CollectiveVersionsExpireManager->expireFolder()
#2 apps/collectives/lib/BackgroundJob/ExpirePageVersions.php(35): OCA\Collectives\Versions\CollectiveVersionsExpireManager->expireAll()
#3 lib/public/BackgroundJob/Job.php(78): OCA\Collectives\BackgroundJob\ExpirePageVersions->run()
#4 lib/public/BackgroundJob/TimedJob.php(103): OCP\BackgroundJob\Job->start()
#5 lib/public/BackgroundJob/TimedJob.php(93): OCP\BackgroundJob\TimedJob->start()
#6 cron.php(152): OCP\BackgroundJob\TimedJob->execute()
#7 {main}

@juliushaertl
Copy link
Member Author

Feel free to already give the patch in #833 a try

@theroch
Copy link

theroch commented Aug 23, 2023

I've installed the patch. Is it possible to trigger this event manual or have I to wait for the cron job?

@theroch
Copy link

theroch commented Aug 25, 2023

I've running the patch now several days without any issues. The message disappeared in our logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants