14.0.0 maintenance:update:htaccess fails

Hi,
Iā€™ve just installed a new 14.0.0.19 and I get this error when running sudo -u www-data php occ maintenance:update:htaccess
Error updating .htaccess file, not enough permissions or ā€œoverwrite.cli.urlā€ set to an invalid URL?

Permissions are fine. I even set g+w as suggested on the forum :confounded:
overwrite.cli.url on config.php containes the exact same string as the siteā€™s url ā€œhttps://foo-bar.bar.comā€

This worked ok on 13.0.5.
Any thoughts?

2 Likes

I have the same problem

1 Like

It is failing in lib/private/Setup.php (line 448) in function updateHtaccess().
This particular check fails and for good reason:
$webRoot = parse_url($webRoot, PHP_URL_PATH);
if ($webRoot === null) {
return false;
}
It should be $PHP_URL_PATH. However, that is not the only problem. It is unset when called from cli.

I simply commented out the ā€œreturn false;ā€ to patch it. The final code looks like:
$webRoot = parse_url($webRoot, PHP_URL_PATH);
if ($webRoot === null) {
//return false;
}

PS. Is this check even needed from cli?

I had to add a trailing ā€œ/ā€ to the value of ā€œoverwrite.cli.urlā€ after updating to NC 14.

I posted this bug against the documentation: https://github.com/nextcloud/documentation/issues/863

7 Likes