Not properly set up to resolve "/ocs-provider/" after Upgrade to NC26

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.1

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Just open the Overview Page

After Upgrading from NC25 to NC26 i’m starting to get this error. I tried many different solutions from the web but none of them works for me, mostly of the solution was for the Nginx server and I’m using an apache server. I know the problem is probably with my .htaccess file, I have added my .htaccess file, please help me out
here is my .htaccess file:

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
    <IfModule mod_lsapi.c>
      SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
      RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers

    # Avoid doubled headers by unsetting headers in "onsuccess" table,
    # then add headers to "always" table: https://github.com/nextcloud/server/pull/19002
    Header onsuccess unset Referrer-Policy
    Header always set Referrer-Policy "no-referrer"

    Header onsuccess unset X-Content-Type-Options
    Header always set X-Content-Type-Options "nosniff"

    Header onsuccess unset X-Frame-Options
    Header always set X-Frame-Options "SAMEORIGIN"

    Header onsuccess unset X-Permitted-Cross-Domain-Policies
    Header always set X-Permitted-Cross-Domain-Policies "none"

    Header onsuccess unset X-Robots-Tag
    Header always set X-Robots-Tag "noindex, nofollow"

    Header onsuccess unset X-XSS-Protection
    Header always set X-XSS-Protection "1; mode=block"

    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for static resources
  <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
    <If "%{QUERY_STRING} =~ /(^|&)v=/">
      Header set Cache-Control "max-age=15778463, immutable"
    </If>
    <Else>
      Header set Cache-Control "max-age=15778463"
    </Else>
  </FilesMatch>

  # Let browsers cache WOFF files for a week
  <FilesMatch "\.woff2?$">
    Header set Cache-Control "max-age=604800"
  </FilesMatch>
</IfModule>

# PHP 7.x
<IfModule mod_php7.c>
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>

# PHP 8+
<IfModule mod_php.c>
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>

<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddType application/wasm wasm
  AddEncoding gzip svgz
</IfModule>

<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>

<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>

<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 ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

AddDefaultCharset utf-8
Options -Indexes
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /index.php/error/403
ErrorDocument 404 /index.php/error/404
<IfModule mod_rewrite.c>
  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|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} !/(ocm-provider|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 /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

Try to clear the PHP opcache from the admin UI under “TOOLS”.
This error message is likely caused by crashes in the PHP JIT.
Unfortunately that sometimes happens with PHP 8

hey, thanks for your reply.
I browsed through all the settings of nextcloud but i didn’t found any settings related to opcache.
Would you please tell me, where i can find the option to clear opcache?
Thankyou

Oh, I am sorry, I was assuming that you are using NextcloudPi, since you used the ncp tag.
That function is a NextcloudPi specific tool, so it won’t be available on your installation.

You could try to disable the PHP opcache by editing the config in /etc/php/8.1/fpm/conf.d/10-opcache.ini (or similar) to see if that’s really the issue.

tried, didn’t worked bro

Your .htaccess looks fine (it’s exactly what I’d expect for a current v26 installation).

Couple possibilities come to mind:

  • Your .htaccess is being ignored which can happen in a few different ways:
    • file permissions
    • you’re using php-fpm
    • if your original setup embedded its configuration directly in your Apache configuration (this would typically be something you manually did during your original installation pre-dating the v26 upgrade)
    • The Apache configuration has AllowOverride disabled
  • Your have a reverse proxy in front of your NC web server
    • Cloudflare Tunnel might also qualify some notes I’ve seen

What happens if you visit https://YOUR_SITE/ocs-provider directly in your browser?

Can you see if you have a /etc/apache2/sites-available/nextcloud.conf file? And that it matches this one: Installation on Linux — Nextcloud latest Administration Manual latest documentation

Do you know which installation approach you followed originally? Was it the manual one? And how did you do the upgrade?

Any other changes at the same time (like an OS upgrade)?

if i open my https://YOUR_SITE/ocs-provider I’m getting this:

Installation: Originally for the installation i used Web Based Installer Package, Downloaded the installation php file, put it on root directory and then followed the website instructions.

How I upgrade: My updater was not working, so i downloaded the NC26 from Download Now which was located just right to the Updater, paste all the files in installation directory except data and config and then ran occ upgrade command. that’s it.

Nope i didn’t did any os upgrade

Gotcha.

That’s weird. If you’re htaccess was being ignored entirely I’d expect you to have a couple other bits failing than just ocs/ocm (namely some messages about /.well-known/blahblah failing).

Just to confirm: you’re definitely running Nextcloud in your webroot? No subdirectory is required to access it like https://domain.com/nextcloud?

What are the chances you added some redirects or aliases or even rewrite rules to your main Apache configuration manually during your original installation? Probably would have either been directly to config files in /etc/apache2/sites-enabled or along those lines. Or put possibly via a server control panel if you’re using one.

Also, post your redacted NC config.php (aka: occ config:list system)

Any interesting entries in your Apache error_log files?

Hey JTR.
Yes i’m definitely using root directory, i actually created subdomain and installed on it.
I haven’t done any changes in apache configuration.

Here is redacted config file,

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.pratikpathak.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.1.1",
        "overwrite.cli.url": "https:\/\/cloud.pratikpathak.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "simpleSignUpLink.shown": false,
        "default_phone_region": "IN",
        "mail_smtpmode": "sendmail",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "default_locale": "en_US",
        "default_language": "en",
        "htaccess.RewriteBase": "\/",
        "htaccess.IgnoreFrontController": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "preview_max_memory": 512,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Movie"
        ],
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "socialsharing_facebook"
        ],
        "tempdirectory": "\/home\/cloud.pratikpathak.com\/public_html\/data\/tmp",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.path": "\/home\/cloud.pratikpathak.com\/public_html\/apps\/memories\/exiftool-bin\/go-vod-amd64",
        "memories.exiftool_no_local": true,
        "memories.vod.vaapi.low_power": true,
        "integrity.check.disabled": true,
        "memories.gis_type": 1
    }
}

Also I’m using Litespeed server, if that’s help

Yes, that matters a great deal.

You said Apache earlier my friend. Apache. LOL.

You’re going to have to find a way to map a lot of different things over to Litespeed. And I’m afraid I have no experience with LS+NC.

I do see that there are Rewrite rule differences:

And I suspect the default mode for running PHP is more akin to FPM-PHP mode which means none of the php configuration values from .htaccess will be available so those will have to be ported over somehow as well probably.

And possibly other things:

You might find this helpful from the looks of it:

But that assumes the rewrite rules are the only issue. :slight_smile:

1 Like

Noticed a thread from last year from someone that supposedly got things working with Litespeed:

Thought you might find it of interest.

1 Like