Skip to content

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

@julien-nc

Description

@julien-nc

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"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions