Skip to content

ConfigService::LOCK_TIMEOUT is not numerical, using default #940

@SystemKeeper

Description

@SystemKeeper

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Running on 32.0.3, I see the following logs:

{
  "Exception": "Exception",
  "Message": "",
  "Code": 0,
  "Trace": [
    {
      "file": "/var/www/nextcloud/apps/files_lock/lib/Cron/Unlock.php",
      "line": 32,
      "function": "getDeprecatedLocks",
      "class": "OCA\\FilesLock\\Service\\LockService",
      "type": "->"
    },
    {
      "file": "/var/www/nextcloud/apps/files_lock/lib/Cron/Unlock.php",
      "line": 28,
      "function": "deleteExpiredLocks",
      "class": "OCA\\FilesLock\\Cron\\Unlock",
      "type": "->"
    },
    {
      "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
      "line": 61,
      "function": "run",
      "class": "OCA\\FilesLock\\Cron\\Unlock",
      "type": "->"
    },
    {
      "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
      "line": 97,
      "function": "start",
      "class": "OCP\\BackgroundJob\\Job",
      "type": "->"
    },
    {
      "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
      "line": 84,
      "function": "start",
      "class": "OCP\\BackgroundJob\\TimedJob",
      "type": "->"
    },
    {
      "file": "/var/www/nextcloud/cron.php",
      "line": 175,
      "function": "execute",
      "class": "OCP\\BackgroundJob\\TimedJob",
      "type": "->"
    }
  ],
  "File": "/var/www/nextcloud/apps/files_lock/lib/Service/LockService.php",
  "Line": 296,
  "message": "ConfigService::LOCK_TIMEOUT is not numerical, using default",
  "current": 0,
  "exception": {},
  "CustomMessage": "ConfigService::LOCK_TIMEOUT is not numerical, using default"
}

I am wondering if this does serve a purpose, as the default value is 0?

The log is coming from

$timeout = (int)$this->configService->getAppValue(ConfigService::LOCK_TIMEOUT);
if ($timeout === 0) {
$this->logger->notice(
'ConfigService::LOCK_TIMEOUT is not numerical, using default', ['current' => $timeout, 'exception' => new \Exception()]
);
$timeout = (int)$this->configService->defaults[ConfigService::LOCK_TIMEOUT];
}

Which also does not make sense to me (maybe I am missing something), as the code in

public function getAppValue($key) {
$defaultValue = null;
if (array_key_exists($key, $this->defaults)) {
$defaultValue = $this->defaults[$key];
}
return $this->config->getAppValue($this->appName, $key, $defaultValue);
}

already retrieves the default as well, and since it is 0, we still use it? At least 0 seems to be still expected somehow.

Feel free to close, just noticed it while logging through the logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions