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