getgrav/grav · error · InvalidArgumentException
The path of a URI with an authority must start with a slash
Error message
The path of a URI with an authority must start with a slash '/' or be empty
What it means
Error "The path of a URI with an authority must start with a slash '/' or be empty" thrown in getgrav/grav.
Source
Thrown at system/src/Grav/Framework/Psr7/AbstractUri.php:415
);
}
if ($this->getAuthority() === "") {
if (str_starts_with($this->path, "//")) {
throw new InvalidArgumentException(
'The path of a URI without an authority must not start with two slashes \'//\''
);
}
if (
$this->scheme === "" &&
str_contains(explode("/", $this->path, 2)[0], ":")
) {
throw new InvalidArgumentException(
"A relative URI must not have a path beginning with a segment containing a colon"
);
}
} elseif (isset($this->path[0]) && $this->path[0] !== "/") {
throw new InvalidArgumentException(
'The path of a URI with an authority must start with a slash \'/\' or be empty'
);
}
}
/**
* @return bool
*/
protected function isDefaultPort()
{
$scheme = $this->scheme;
$port = $this->port;
return $this->port === null ||
(isset(static::$defaultPorts[$scheme]) &&
$port === static::$defaultPorts[$scheme]);
}
View on GitHub (pinned to 6040efed04)
When it happens
Trigger: Thrown at system/src/Grav/Framework/Psr7/AbstractUri.php:415 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17).
Data as JSON: /api/errors/7d5c3d52d4a0de2a.
Report an issue: GitHub.