Skip to content

NC 15.0.14 occ files:scan crashes on StorageNotAvailableException #18864

@hagbartus

Description

@hagbartus

Steps to reproduce

  1. Download and install NC 15.0.14
  2. Run occ files:scan -all
  3. If a storage is not available it crashes

Expected behaviour

Handle exception instead of crash

Actual behaviour

Crashes because its calling a function that is only introduced in NC 16!

Error: Call to undefined method OC\AllConfig::getSystemValueInt() in/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php:454

	protected function setUnavailable(StorageNotAvailableException $e) {
		$delay = self::RECHECK_TTL_SEC;
		if($e instanceof StorageAuthException) {
			$delay = max(
				// 30min
	--->			$this->config->getSystemValueInt('external_storage.auth_availability_delay', 1800),
				self::RECHECK_TTL_SEC
			);
		}
		$this->getStorageCache()->setAvailability(false, $delay);
		throw $e;
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions