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

[28.0.12] "Cannot call constructor" in RemoteActivity background job #1847

Closed
julien-nc opened this issue Nov 22, 2024 · 1 comment
Closed

Comments

@julien-nc
Copy link
Member

In Nextcloud 28.0.12, I think there is a bug in lib/BackgroundJob/RemoteActivity.php . It is calling its parent's constructor. It extends the deprecated OC\BackgroundJob\QueuedJob. The issue is that none of the parent classes has a constructor.

This has been seen in nextcloud.log when running cron.php:

{
  "reqId": "xxxxxxx",
  "level": 3,
  "time": "xxxxxx",
  "remoteAddr": "",
  "user": "--",
  "app": "cron",
  "method": "",
  "url": "--",
  "message": "Exception thrown: Error",
  "userAgent": "--",
  "version": "28.0.12.3",
  "exception": {
    "Exception": "Error",
    "Message": "Cannot call constructor",
    "Code": 0,
    "Trace": [
      {
        "function": "__construct",
        "class": "OCA\\Activity\\BackgroundJob\\RemoteActivity",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 83,
        "function": "newInstanceArgs",
        "class": "ReflectionClass",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 128,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 146,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 470,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/ServerContainer.php",
        "line": 155,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 64,
        "function": "query",
        "class": "OC\\ServerContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/public/Server.php",
        "line": 55,
        "function": "get",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/BackgroundJob/JobList.php",
        "line": 325,
        "function": "get",
        "class": "OCP\\Server",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/BackgroundJob/JobList.php",
        "line": 234,
        "function": "buildJob",
        "class": "OC\\BackgroundJob\\JobList",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/cron.php",
        "line": 145,
        "function": "getNext",
        "class": "OC\\BackgroundJob\\JobList",
        "type": "->"
      }
    ],
    "File": "/var/www/html/nextcloud/apps/activity/lib/BackgroundJob/RemoteActivity.php",
    "Line": 40,
    "CustomMessage": "Exception thrown: Error"
  }
}
@joshtrichards
Copy link
Member

Fixed in #1842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants