Your web server is not properly set up to resolve "/ocm-provider/". following upgrade to 27.1.2

Thank you!

Changing nginx config in this way resolved the issue for me.

For me also still the same error messages for /ocm-provider/ & /ocs-provider/ - also after update to current NC 27.1.3 - for me with ngnix & php 8.2.
I tried all the suggested ideas, nothing helps - please solve this bug … never had problems before with that.

Nothing helps and nothing will help, until this issue will be addressed on a Nextcloud side.
The matter of fact is that the folder ‘ocm-provider’ has been removed from Nextcloud installation, I believe with 27.1.2 update. But forwarding rule and check for this folder still exists, even in 27.1.4.
No matter how you edit your web server forwarding rule - it won’t work, because there is no such folder as ‘ocm-provider’ anymore. The only way to get rid of this error is to wait until Nextcloud team will address this issue and remove such check from admin page in further Nextcloud update.
I hope it will be fixed in 27.1.5, but we’ll see.

Hmmm, so all those users who no longer get the warning, or never got it in the first place, must be doing something wrong.

1 Like

For me the problem is back since update form 27.1.3 to 27.1.4. Now I get warnings again.
Before that I could solve it with the rewrite rule in .htaccess: ^ocm-provider/?$ /index.php [QSA,L]
Now nothing seams to work. I tried all possible kinds of rewrite rules. But if I go on “https://nextcloud.xyz.ch/ocm-provider/” it looks good and it says enabled = true.

1 Like

I’ve tried every single way suggested.
.httaccess, Apache config, etc.
No luck.
But when I put ‘ocm-provider’ folder back from my old backup - boom, no warning anymore.
What am I doing wrong?:man_shrugging:t2:

How are we supposed to know if we don’t know your exact configuration?

If you are using Apache, the .htaccess file that is included in the Nextcloud folder should take care of this and it should also be updated automatically during a Nextcloud upgrade. If this didn’t work for some reason, you can update the .htaccess file manually with the occ maintenance:update:htaccess command.

Also, your Apache VirtualHost must contain the following section in order for .htaccess. files to work: (Path to your Nextcloud folder may need to be adjusted)

<Directory /var/www/html/nextcloud/>
     Require all granted
     AllowOverride All
     Options FollowSymLinks MultiViews

     <IfModule mod_dav.c>
       Dav off
     </IfModule>
   </Directory>

If that doesn’t help, please open a new thread and fill out the support template, unless you want to keep trying random things that people post here.

Also getting enabled=true from “https://nextcloud.xyz.ch/ocm-provider/”

Not sure what it is supposed to say, I guess I could dive through the code to find out the correct response.

Very confused why this error would suddenly pop up after years of the default config working fine.

So, looked at the error checker:

Looks like a 302 will result in this error, 302 Found ? Not sure why a redirect found is cause for alarm, but… I’m not a web dev.

Anyway, a 200 will result in “no error”, so I checked my end point, and sure enough:

So, it appears the “redirect” is supposed to be taking a root level request and shunting it off to the index.php/ocm-provider . I’m assuming this based on the following failure when I run the status checker I get the following 404:

So… time to figure out why my .htaccess isn’t working correctly:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^ocm-provider/?$ index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

Any insights would be very appreciated!

1 Like

Fixed it,

For some reason the following file’s AllowOverride All (the thing that makes htaccess files work) is being ignored. I’m not sure the reason.

root@nextcloud:/etc/apache2/sites-available# cat nextcloud.conf 
Alias /nextcloud "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews

  <IfModule mod_dav.c>
    Dav off
  </IfModule>
</Directory>

I edited the following file: /etc/apache2/apache2.conf

I changed this block:

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

to say

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted
</Directory>

I’m not finding any good info in my searches about why this is. Is nextcloud.conf just not being read at all? Does an AllowOverride in a higher directory preclude subdirectories from working? Many questions. Anyway, I’ve got it working, it seems to possibly been an apache update as the culprit:

https://httpd.apache.org/docs/current/mod/core.html#allowoverride

But who knows, it definitely wasn’t there one day, and after an upgrade, boom!

Better fix below

Somewhere along the way nextcloud.conf inside sites-enabled was removed either from the apache.conf or list of sites for apache, this is why the AllowOverrides was being ignored.

So I ran the following command to get Apache to use the nextcloud.conf located: /etc/apache2/sites-enabled/nextcloud.conf

a2ensite nextcloud.conf

This file looks like the following (in case you don’t want to scroll up)

root@nextcloud:/etc/apache2/sites-enabled# cat nextcloud.conf 
Alias /nextcloud "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews

  <IfModule mod_dav.c>
    Dav off
  </IfModule>
</Directory>

Once complete, I undid the change I did in my previous post and set the following block in /etc/apache2/apache.conf to AllowOverrides None

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

Theory of least privilege and all.

Rebooted apache with a systemctl reload apache2 and boom, my htaccess file in /var/www/nextcloud is working still.

and no more error! Besides the “you do not have an email server”, like yah, no duh, who wants to deal with that noise!

Cheers!

Adding this line to my nextcloud-le-ssl.conf file solved this issue for me!
Thanks :slight_smile: