Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Your web server is not properly set up to resolve "/nextcloud/ocm-provider/" #40803

Closed
5 of 8 tasks
wuda2525 opened this issue Oct 6, 2023 · 50 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug

Comments

@wuda2525
Copy link

wuda2525 commented Oct 6, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

Ever since I updated the latest version of NextCloud from v27.1.1 to v27.1.2 using the Updater, I get the following warning message in the Administration Overview page

Your web server is not properly set up to resolve "/nextcloud/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it's documentation page ↗. On Nginx those are typically the lines starting with "location ~" that need an update.

Steps to reproduce

  1. Click on Administration Settings
  2. On the left pane, click Overview
  3. Click on the Update button

Expected behavior

Should be receiving no warning messages after an update

Installation method

Community Web installer on a VPS or web space

Nextcloud Server version

27

Operating system

Other

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

Looking at the Nextcloud Server Repo (https://github.com/nextcloud/server), it looks like ocm-provider folder. My solution was the following:

  1. Download the previous version (v27.1.1) of Nextcloud server, https://download.nextcloud.com/server/releases/nextcloud-27.1.1.zip
  2. Unzip the file and copy the ocm-provider folder and it's content (index.php) into Apache
@wuda2525 wuda2525 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Oct 6, 2023
@alars
Copy link

alars commented Oct 6, 2023

The error seems to be caused by this recent commit:

commit a250250985e6517c1c3a1cc7cd28008948353cb3
Author: Maxence Lange <maxence@artificial-owl.com>
Date:   2023-10-03 14:19:44 -0100

    Update .htaccess
    
    Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
    Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

diff --git a/.htaccess b/.htaccess
index 2be3c1b9e15..52caeaf70d4 100644
--- a/.htaccess
+++ b/.htaccess
@@ -90,7 +90,7 @@
   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 ^ocm-provider/?$ /index.php [QSA,L]
   RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
 </IfModule>

The new RewriteRule looks weird (?$ isn't correct perl re syntax) - when I change it to
RewriteRule ^ocm-provider/(.*) /index.php [QSA,L]
the error disappears.

@solracsf solracsf changed the title [Bug]: [Bug]: Your web server is not properly set up to resolve "/nextcloud/ocm-provider/" Oct 6, 2023
@solracsf solracsf added bug and removed bug labels Oct 6, 2023
@solracsf
Copy link
Member

solracsf commented Oct 6, 2023

Cc @blizzz

@joshtrichards
Copy link
Member

joshtrichards commented Oct 6, 2023

Someone else with subdir install noted the recent PR may have an oversight but I haven't looked deeper into it:

#40794 (comment)

@wuda2525
Copy link
Author

wuda2525 commented Oct 6, 2023

Hey Everyone,

Dumb question. Was the ocm-provider folder needed? I'm looking at the master branch (https://github.com/nextcloud/server) and the ocm-provider directory is not present or removed

Dave

@PVasileff
Copy link

Same warning here after updating v27.1.1 to v27.1.2.
Using nginx webserver (nextcloud is not in subfolder)

@solracsf
Copy link
Member

solracsf commented Oct 7, 2023

@ernolf
Copy link
Contributor

ernolf commented Oct 7, 2023

@PVasileff
Using nginx webserver (nextcloud is not in subfolder)

Nginx does not make use of .htaccess files, so you have to edit it by hand anyway. If you have chosen for nginx as webserver, you should read the manual if anything had changed after each update and change it yourself..

Old config: https://docs.nextcloud.com/server/25/admin_manual/installation/nginx.html?highlight=oc[ms]-provider
New config: https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html?highlight=ocs-provider

In detail:
Search for this re-string: oc[ms]-provider in your nginx configfile and replace it by this string: ocs-provider

reload or restart nginx

That should do it for you (and nginx users in general)

much luck!

@M3taKn1ght
Copy link

M3taKn1ght commented Oct 7, 2023

I also did an update from 27.1.1 to 27.1.2 and get this error.
I use an Nginx Proxy Manager to redirect to my cloudserver. For this I use a subdomain wolke.mydomain.net.
The Cloudserver itself use Apache and root-folder is set to /var/www/nextcloud
Interessting to see is, that wolke.mydomain.net/index.php/ocm-provider will give me an result, but wolke.mydomain.net/ocm-provider will not work.
I updated .htaccess with occ commands, so I see the correct content of the file. For me it seems that an redirect from wolke.mydomain.net/ocm-provider to wolke.mydomain.net/index.php/ocm-provider is not working.
`
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]

AddDefaultCharset utf-8
Options -Indexes

DO NOT CHANGE ANYTHING ABOVE THIS LINE

ErrorDocument 403 /index.php/error/403
ErrorDocument 404 /index.php/error/404

Options -MultiViews
RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
RewriteCond %{REQUEST_FILENAME} !.(css|js|mjs|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$
RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon.ico|manifest.json)$
RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status).php
RewriteCond %{REQUEST_FILENAME} !/ocs/v(1|2).php
RewriteCond %{REQUEST_FILENAME} !/robots.txt
RewriteCond %{REQUEST_FILENAME} !/(ocs-provider|updater)/
RewriteCond %{REQUEST_URI} !^/.well-known/(acme-challenge|pki-validation)/.*
RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /
`
Thats my complete .htaccess-file

@wuda2525
Copy link
Author

wuda2525 commented Oct 8, 2023

Hey Everyone,

I tried implementing the changes mentioned here from @Lawkss (#40794 (comment)) with a brand new install of Nextcloud v27.1.2 using Apache 2.4

Changes below:
RewriteRule ^ocm-provider/?$ index.php [QSA,L]

However, I'm still getting the warning message. Also, I'm using a path(domain.tld/nextcloud) for Nextcloud, as mentioned by @Lawkss

This worksi
domain.tld/nextcloud/index.php/ocm-provider

But, this does not work
domain.tld/nextcloud/ocm-provider

@PVasileff
Copy link

oc[ms]-provider

@PVasileff
Using nginx webserver (nextcloud is not in subfolder)

Nginx does not make use of .htaccess files, so you have to edit it by hand anyway. If you have chosen for nginx as webserver, you should read the manual if anything had changed after each update and change it yourself..

Old config: https://docs.nextcloud.com/server/25/admin_manual/installation/nginx.html?highlight=oc[ms]-provider New config: https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html?highlight=ocs-provider

In detail: Search for this re-string: oc[ms]-provider in your nginx configfile and replace it by this string: ocs-provider

reload or restart nginx

That should do it for you (and nginx users in general)

much luck!

Thanks. That works!

@ivnmad
Copy link

ivnmad commented Oct 8, 2023

Hey Everyone,

I tried implementing the changes mentioned here from @Lawkss (#40794 (comment)) with a brand new install of Nextcloud v27.1.2 using Apache 2.4

Changes below: RewriteRule ^ocm-provider/?$ index.php [QSA,L]

However, I'm still getting the warning message. Also, I'm using a path(domain.tld/nextcloud) for Nextcloud, as mentioned by @Lawkss

This worksi domain.tld/nextcloud/index.php/ocm-provider

But, this does not work domain.tld/nextcloud/ocm-provider

I managed to remove the warning by adding the following to my Nextcloud .conf file:


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

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

@SKJoy
Copy link

SKJoy commented Oct 8, 2023

Try this: #40818 (comment)

@M3taKn1ght
Copy link

Try this: #40818 (comment)

This is not a solution at all, cause i use everytime after an Update Firefox in private Mode and get the Same Errors all over again!

@M3taKn1ght
Copy link

Hey Everyone,
I tried implementing the changes mentioned here from @Lawkss (#40794 (comment)) with a brand new install of Nextcloud v27.1.2 using Apache 2.4
Changes below: RewriteRule ^ocm-provider/?$ index.php [QSA,L]
However, I'm still getting the warning message. Also, I'm using a path(domain.tld/nextcloud) for Nextcloud, as mentioned by @Lawkss
This worksi domain.tld/nextcloud/index.php/ocm-provider
But, this does not work domain.tld/nextcloud/ocm-provider

I managed to remove the warning by adding the following to my Nextcloud .conf file:


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

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

Oh boy, there was my problem! In german we would say "You don't see the forest, cause of all the trees" and this is quiet what happend. It seems to me, I used an very old apache-config. What was missing was the complete Directory-Node :(
Just this adding to my server, everything is working correct now AND I dont need to copy the old ocm-folder anymore.
Maybe there should be a hint in the documentation, in the update or in the description of the error, taht this message comes up, if apache needs the missing node ^^

@JazMTaz
Copy link

JazMTaz commented Oct 8, 2023

@PVasileff
Using nginx webserver (nextcloud is not in subfolder)

Nginx does not make use of .htaccess files, so you have to edit it by hand anyway. If you have chosen for nginx as webserver, you should read the manual if anything had changed after each update and change it yourself..

Old config: https://docs.nextcloud.com/server/25/admin_manual/installation/nginx.html?highlight=oc[ms]-provider New config: https://docs.nextcloud.com/server/27/admin_manual/installation/nginx.html?highlight=ocs-provider

In detail: Search for this re-string: oc[ms]-provider in your nginx configfile and replace it by this string: ocs-provider

reload or restart nginx

That should do it for you (and nginx users in general)

much luck!

Manually updated config as described be ernolf for nginx, warning resolved

@wuda2525
Copy link
Author

wuda2525 commented Oct 9, 2023

That solution that @ivnmad suggested did the trick.
Thanks everyone for chiming in with suggestions and solutions.

Closing the ticket

@wuda2525 wuda2525 closed this as completed Oct 9, 2023
@shahn
Copy link

shahn commented Oct 9, 2023

I needed to change the RewriteRule in addition to adding the Directory stanza to the Apache config. Is this really closed or does the .htaccess-file need a patch?

@M3taKn1ght
Copy link

I needed to change the RewriteRule in addition to adding the Directory stanza to the Apache config. Is this really closed or does the .htaccess-file need a patch?

I think, if you read carfully the manual again (e.g. apache and nginx config) and also all Rewrite-Rules, there is no need for a patch.
Seems to me, that only a hint to the webserver-configuration is missing in the warning-msg. Maybe this can be done?

@shahn
Copy link

shahn commented Oct 9, 2023

Do you also have your nextcloud installation in a subdirectory? If yes, I would appreciate if you could point out which part of the documentation I may have missed.

@M3taKn1ght
Copy link

Do you also have your nextcloud installation in a subdirectory? If yes, I would appreciate if you could point out which part of the documentation I may have missed.

No, but it's a combination of the update of your webserver-config and .htaccess.
First things first, check the docu
https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
or for apache
https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#apache-web-server-configuration
if this looks like your configuration, you need to edit .htaccess like @alars wrote.
You need to include your subfolder to the rewrite rule and bingo ;)

@ckorn
Copy link

ckorn commented Oct 9, 2023

For me this does not fix the issue:
#40803 (comment)
But this does:
#40794 (comment)

This is my nextcloud.conf:

Alias /nextcloud "/var/www/nextcloud/"

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

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

        #SetEnv HOME /var/www/nextcloud
        #SetEnv HTTP_HOME /var/www/nextcloud

        #<IfModule mod_rewrite.c>
        #        RewriteEngine on
        #        RewriteRule ^/ocm-provider     /nextcloud/ocm-provider/     [R=301,L]
        #        RewriteRule ^/ocs-provider     /nextcloud/ocs-provider/     [R=301,L]
        #        RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
        #        RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]
        #</IfModule>

</Directory>

@shahn
Copy link

shahn commented Oct 9, 2023

Do you also have your nextcloud installation in a subdirectory? If yes, I would appreciate if you could point out which part of the documentation I may have missed.

No, but it's a combination of the update of your webserver-config and .htaccess. First things first, check the docu https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html or for apache https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#apache-web-server-configuration if this looks like your configuration, you need to edit .htaccess like @alars wrote. You need to include your subfolder to the rewrite rule and bingo ;)

My argument is that the RewriteRule should be written such that it works for both installations that are in / as well as in /nextcloud/, because you are not supposed to edit the rewrite rules as per a comment included in that very file, and that is why this issue is not resolved IMO. That in addition you need to edit the apache configuration is a separate point.

@wrecklass
Copy link

Problem still exists in latest update.

@wuda2525
Copy link
Author

wuda2525 commented Oct 11, 2023

Hey Everyone,
I'm going to reopen this ticket. It seems that some of the solutions proposed is not working for everyone.

This question is for the Nextcloud developers and architects. I'm just wondering if the removing ocm-provider folder/directory and redirecting it to use index.php is short term solution or a permanent fix?

Just want to say Thank You to the Nextcloud team for giving all of us a great product.

@wuda2525 wuda2525 reopened this Oct 11, 2023
@OlafTitz
Copy link

The real issue is that all RewriteRule entries must produce relative instead of absolute URL paths, i.e. the leading slash is wrong in all of them. ("Relative" here really means "relative to the directory where the .htaccess file is".) You can verify this by trying curl -i https://your.host/path/to/nextcloud/.well-known/caldav, this will produce a wrong redirect URL.

This patch fixes all of them, I've checked manually.
htaccess.diff.txt
What appears to be missing is a matching RewriteBase, but that is installation-specific.

See also first answer in https://stackoverflow.com/questions/21347768/what-does-rewritebase-do-and-how-to-use-it which explains better than the Apache docs what happens with absolute and relative redirect results.

@blizzz
Copy link
Member

blizzz commented Oct 11, 2023

fix is in #40843 + backported, i.e. arrives with next maintenance releases.

@blizzz blizzz closed this as completed Oct 11, 2023
@enricotagliavini
Copy link

It looks like the .htaccess RewriteRule is not generic enough. It works for setups without a subfolder, but not when using a subfolder (i.e. nextcloud in accessed via https://domain.tld/nextcloud/). The original line is

RewriteRule ^ocm-provider/?$ /index.php [QSA,L]

which is an absolute rewrite rule. Any subfolder component would be lost, i.e. https://domail.tld/nextcloud/ocm-provider/, becomes https://domail.tld/index.php/ocm-provider/, rather than https://domail.tld/nextcloud/index.php/ocm-provider/

Changing the line above to

RewriteRule ^ocm-provider/?$ index.php [QSA,L]

making it a relative substitution, will solve the issue provided you set the correct 'htaccess.RewriteBase' option in config/config.php and ran

sudo -u <apache user> php /var/www/nextcloud/occ maintenance:update:htaccess

@recrunchi
Copy link

Hi. Even if i try modifying .htaccess in nextcloud folder, it fails the overall check because there is no ocm-provider folder anymore, after today i updated to 27.1.2

I've noticed that in my previous backup folder of older nextcloud versions the ocm-provider folder exists.
f.e.:
locate ocm-provider
backups/nextcloud-27.0.2.1-1694975084/ocm-provider
backups/nextcloud-27.0.2.1-1694975084/ocm-provider/index.php
backups/nextcloud-27.1.0.7-1697195388/ocm-provider
backups/nextcloud-27.1.0.7-1697195388/ocm-provider/index.php

So i copied on of these "old" folders and now i have the "All checks passed" in Administration Settings.

Hope it helps.
Bye.

@MegaV0lt
Copy link

Changing .htaccess works for me. Thanks!

@darkBuddha
Copy link

How to fix in Nginx?

@Hetti
Copy link

Hetti commented Oct 14, 2023

How to fix in Nginx?

As mentioned by @ernolf #40803 (comment)

image

Then reload config with nginx -s reload

@MattRGX
Copy link

MattRGX commented Oct 19, 2023

Hello,
Do we have to wait for an update to fix this issue on apache web server ?

@joshtrichards
Copy link
Member

@MattRGX - No see #40920 (comment)

@catfish-k
Copy link

catfish-k commented Oct 23, 2023

I don't have an ocm-provider folder after upgrade to 27.1.2. I do have an ocs-provider folder. I edited my .htaccess to remove the slash:

RewriteRule ^ocm-provider/?$ /index.php [QSA,L]

changed to:

RewriteRule ^ocm-provider/?$ index.php [QSA,L]

But I still get the error.

EDIT: Same ocm-provider error in 27.1.3.

EDIT2: Linking the ocs-provider directory to what I assume is the old location of ocm-provider fixes the error, ie. "ln - s ocs-provider ocm-provider" in the nextcloud installation directory

@ScrambleTheRamble
Copy link

The solution mentioned by @alars here solved the issue for me

@catfish-k
Copy link

catfish-k commented Oct 31, 2023

In my case I think I had a malformed apache virtual host config. I no longer have the warning after changing .htaccess to:

RewriteRule ^ocm-provider/(.*) /index.php [QSA,L]

And adding these starred lines to my apache virtual host config:

 <VirtualHost *:80>
            ServerAdmin webmaster@domain.com
            ServerName nextcloud.domain.com
            DocumentRoot /var/www/nextcloud

            **<Directory /var/www/nextcloud>
             Require all granted
             AllowOverride All
             Options FollowSymLinks MultiViews
             SetEnv HOME /var/www/nextcloud
             SetEnv HTTP_HOME /var/www/nextcloud
            </Directory>**

            <IfModule mod_headers.c>
                    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
            </IfModule>

            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined

    </VirtualHost>

(I have a Caddy SSL reverse proxy, so no SSL)

Thanks all!

@BenS89
Copy link

BenS89 commented Nov 1, 2023

Hey Everyone,
I tried implementing the changes mentioned here from @Lawkss (#40794 (comment)) with a brand new install of Nextcloud v27.1.2 using Apache 2.4
Changes below: RewriteRule ^ocm-provider/?$ index.php [QSA,L]
However, I'm still getting the warning message. Also, I'm using a path(domain.tld/nextcloud) for Nextcloud, as mentioned by @Lawkss
This worksi domain.tld/nextcloud/index.php/ocm-provider
But, this does not work domain.tld/nextcloud/ocm-provider

I managed to remove the warning by adding the following to my Nextcloud .conf file:


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

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

That did the trick for me! Thanks a lot

@david-kalbermatten
Copy link

For anyone using Nginx Proxy Manager with Nextcloud being hosted on a sub-domain instead of a sub-folder

I added the following lines to the 'Advanced' Tab:

location = /ocs-provider {
    try_files $uri $uri/ /index.php$request_uri;
}

location ~ ^/ocm-provider {
    try_files $uri $uri/ /index.php$request_uri;
}

@Dizspy
Copy link

Dizspy commented Nov 25, 2023

Folder ocm-provider has been removed from Nextcloud since 27.1.2, which has been confirmed in another thread.
But the stupid check for this folder still persists even in 27.1.4, which has been released recently.
Could you please be so kind to finally remove the obsolete check for 'ocm-provider' which is bugging so many users with a non existent error?

@joshtrichards
Copy link
Member

@Dizspy The old folder is gone, not the new handler for it is not. The check isn't for the folder, but for the URL which is an endpoint handled in-code. It's still very much a legitimate endpoint:

['name' => 'OCM#discovery', 'url' => '/ocm-provider/'],

@dd5fz
Copy link

dd5fz commented Nov 30, 2023

I just updated to 27.1.4 and am also, yet again, getting the error message: Your web server is not properly set up to resolve "/nextcloud/ocm-provider/"...

Operating System: Linux 6.1.21-v8+ aarch64
CPU: Raspberry Pi 3 Model B Plus Rev 1.3 (4 cores)
Memory: 959.00 MB
Webserver: Apache/2.4.56 (Debian)
URL: https://xxx.yyyyy.zzz/nextcloud/index.php
NextCloud Directory: /var/www/html/nextcloud

PHP:
Version: 8.1.13
Memory limit: 512 MB
Max execution time: 3600
Upload max size: 4 GB
Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, imap, intl, exif, msgpack, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, memcached, Zend OPcache

Database:
Type: mysql
Version: 10.5.21

@ulno
Copy link

ulno commented Dec 30, 2023

I don't get the above error message, though I think my problem is related. I am on nextcloud aoi (running in docker). On "Checking for system and security issues." In the admin overview it says "All checks passed."

My rewrite rule in the aoi-nextcloud container .htaccess is: RewriteRule ^ocm-provider/?$ index.php [QSA,L]

However since the last update to Nextcloud AIO v7.9.0 / Nextcloud Hub 6 (27.1.5) I get the following and the system is slow as molasses (4 core i7, 32 gb ram, SSD storage):

[no app in context] Warning: GuzzleHttp\Exception\ConnectException: cURL error 28: Connection timed out after 10003 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://192.168.1.10/nextcloud/ocm-provider/ at <<closure>>

 0. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection("*** sensitive parameters replaced ***")
 1. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError(["GuzzleHttp\\Handler\\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\\Handler\\CurlFactory"])
 2. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish(["GuzzleHttp\\Handler\\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\\Handler\\CurlFactory"])
 3. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 137
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 4. /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php line 114
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 7. /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
10. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
11. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
12. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***")
13. /var/www/html/lib/private/Http/Client/Client.php line 230
    GuzzleHttp\Client->request("*** sensitive parameters replaced ***", "https://192.168 ... /", [true,10,10,[tru ... "])
14. /var/www/html/lib/private/OCM/OCMDiscoveryService.php line 92
    OC\Http\Client\Client->get("https://192.168 ... /", [10,true,10])
15. /var/www/html/apps/files_sharing/lib/External/Storage.php line 84
    OC\OCM\OCMDiscoveryService->discover("https://192.168.1.10/nextcloud")
16. /var/www/html/lib/private/Files/Mount/MountPoint.php line 168
    OCA\Files_Sharing\External\Storage->__construct(["https://192.16 ... "])
17. /var/www/html/lib/private/Files/Mount/MountPoint.php line 193
    OC\Files\Mount\MountPoint->createStorage("*** sensitive parameters replaced ***")
18. /var/www/html/lib/private/Files/Mount/MountPoint.php line 294
    OC\Files\Mount\MountPoint->getStorage()
19. /var/www/html/lib/private/Files/Config/UserMountCache.php line 83
    OC\Files\Mount\MountPoint->getStorageRootId()
20. /var/www/html/lib/private/Files/SetupManager.php line 297
    OC\Files\Config\UserMountCache->registerMounts("*** sensitive parameters replaced ***", [["OC\\Files\\Mo ... ]], ["OC\\Files\\Mou ... "])
21. /var/www/html/lib/private/Files/SetupManager.php line 221
    OC\Files\SetupManager->afterUserFullySetup("*** sensitive parameters replaced ***", [])
22. /var/www/html/lib/private/legacy/OC_Util.php line 111
    OC\Files\SetupManager->setupForUser("*** sensitive parameters replaced ***")
23. /var/www/html/custom_apps/memories/lib/Service/Index.php line 75
    OC_Util::setupFS("ulno")
24. /var/www/html/custom_apps/memories/lib/Cron/IndexJob.php line 92
    OCA\Memories\Service\Index->indexUser("ulno")
25. /var/www/html/lib/private/User/Manager.php line 632
    OCA\Memories\Cron\IndexJob->OCA\Memories\Cron\{closure}("*** sensitive parameters replaced ***")
26. /var/www/html/custom_apps/memories/lib/Cron/IndexJob.php line 100
    OC\User\Manager->callForSeenUsers(["Closure"])
27. /var/www/html/custom_apps/memories/lib/Cron/IndexJob.php line 63
    OCA\Memories\Cron\IndexJob->indexAllUsers()
28. /var/www/html/lib/public/BackgroundJob/Job.php line 81
    OCA\Memories\Cron\IndexJob->run(null)
29. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 103
    OCP\BackgroundJob\Job->start(["OC\\BackgroundJob\\JobList"])
30. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 93
    OCP\BackgroundJob\TimedJob->start(["OC\\BackgroundJob\\JobList"])
31. /var/www/html/cron.php line 152
    OCP\BackgroundJob\TimedJob->execute(["OC\\BackgroundJob\\JobList"], ["OC\\Log"])

at 2023-12-30T19:38:55+00:00

Why is it trying to connect to 192.168.1.10? I have not configured that anywhere.
I can successfully open on my server /index.php/ocm-provider/ as well as only /ocm-provider/ (both giving a json file).

Also the /nextcloud/ prefix seems weird.

Any idea what could have gone wrong here?

Can also start a new issue if this one is significantly different.

@joshtrichards
Copy link
Member

@ulno Your matter appears unrelated. I suggest posting over at the Nextcloud Help Forum - https://help.nextcloud.com - since it also appears to likely be a configuration matter.

@ulno
Copy link

ulno commented Jan 3, 2024

@Uncert
Copy link

Uncert commented Aug 20, 2024

How to fix in Nginx?

As mentioned by @ernolf #40803 (comment)

image

Then reload config with nginx -s reload

its doesn't work for me. : (


    location ~ ^\/(?:updater|ocs-provider)(?:$|\/) {
        try_files $uri/ =404;
        index index.php;
    }

@joshtrichards
Copy link
Member

joshtrichards commented Aug 21, 2024

@Uncert Compare your config to the actual documented one. Yours does not match:

https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

Please follow-up at the help forum - https://help.nextcloud.com - for further troubleshooting since this is not a bug.

@apotek
Copy link

apotek commented Oct 22, 2024

The new RewriteRule looks weird (?$ isn't correct perl re syntax) - when I change it to
RewriteRule ^ocm-provider/(.*) /index.php [QSA,L]

I don't think the problem is that the pattern is incorrect. It's a correct pattern, the $ indicating end of the line, meaning that the intent is that the rule should only apply if the url IS literally either ocm-provider or ocm-provider/.

RewriteRule ^ocm-provider/?$ /index.php [QSA,L]

So it looks like the developer meant for this to only work if there are no query parameters, etc, which might be correct, depending on what an ocm-provider route is supposed to do.

I think the "root" issue here is that this pattern assumes nextcloud is installed at root and not in a subfolder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug
Projects
None yet
Development

No branches or pull requests