Exception: The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php') at <<closure>>

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): Nextcloud Hub 4 (26.0.1)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.52 (Ubuntu)
PHP version (eg, 7.4): PHP8.1

The issue you are facing:

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

Hello All

After installing a fresh system with Ubuntu 22.04 i encounter this error like in the title. I googled around and i can find nothing which helps me to figure out, how to fix it.

[index] Fehler: Exception: The requested uri(/data/.ocdata) cannot be processed by the script ‘/nextcloud/index.php’) at <>

  1. /var/www/nextcloud/lib/base.php line 994
    OC\AppFramework\Http\Request->getRawPathInfo()
  2. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /data/.ocdata?t=1684533278856
from ClientIP by admin at 2023-05-19T21:53:27+00:00

Any ideas??? Verry welcome!!!

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'xxxx',
  'passwordsalt' => 'xxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' =>
  array (domain)',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '26.0.1.1',
  'overwrite.cli.url' => 'https://domain/nextcloud',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxx',
  'dbpassword' => 'xxxx',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'installed' => true,
  'enable_previews' => true,
  'default_phone_region' => 'US',
  'updater.release.channel' => 'stable',
);

The output of your Apache/nginx/system log in /var/log/____:

"GET /data/.ocdata?t=1684533278856 HTTP/1.1" 500 4751 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /nextcloud/index.php/.well-known/webfinger HTTP/1.1" 404 917 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /nextcloud/index.php/.well-known/nodeinfo HTTP/1.1" 404 916 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /index.php/apps/theming/manifest/settings?v=3b54574a HTTP/1.1" 200 2094 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /index.php/apps/theming/icon/settings?v=14 HTTP/1.1" 200 26543 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /ocs/v2.php/cloud/groups/details HTTP/1.1" 200 1019 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "PROPFIND /remote.php/webdav HTTP/1.1" 207 2896 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "PROPFIND /nextcloud/remote.php/dav HTTP/1.1" 207 1378 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "PROPFIND /nextcloud/remote.php/dav HTTP/1.1" 207 1378 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:27 +0000] "GET /index.php/settings/ajax/checksetup HTTP/1.1" 200 2159 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:35 +0000] "GET /index.php/settings/admin/logging HTTP/1.1" 200 12864 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:35 +0000] "GET /apps/logreader/js/logreader-main.css?v=6c1e7ede-14 HTTP/1.1" 200 2570 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:35 +0000] "GET /apps/logreader/l10n/de.js?v=4c90d2ce-14 HTTP/1.1" 200 1796 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
SERVERIP - - [19/May/2023:21:53:35 +0000] "GET /apps/logreader/js/logreader-main.js?v=4c90d2ce-14 HTTP/1.1" 200 168798 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.


{"reqId":"xxxx","level":3,"time":"2023-05-18T16:26:12+00:00","remoteAddr":"xxxxxxxx","user":"admin","app":"index","method":"GET","url":"/data/.ocdata?t=1684427243020","message":"The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php')","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36","version":"26.0.1.1","exception":{"Exception":"Exception","Message":"The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php')","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/base.php","line":994,"function":"getRawPathInfo","class":"OC\\AppFramework\\Http\\Request","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Request.php","Line":730,"CustomMessage":"--"}}

That’s all i have… Enough?

Best, Skywalker

PS: The .ocdata file exists in the data directory with 644 rights and i used when i have everything installed the chmod www-data command.

Hello All

Well Error 400 i get too:

[20/May/2023:11:56:32 +0000] "GET /nextcloud/index.php/.well-known/nodeinfo HTTP/1.1" 404 916 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42"
From:
/var/log/apache2/access.log
Web server 400 error code.

Any ideas where to start troubleshooting? Everything seem’s to work well. What does it mean error 500?

Thank’s for any hint…

Best, skywalker

ls -ald .ocdata

It should be both 644 and owned by www-data:

-rw-r--r-- 1 www-data www-data 0 Apr 20 21:54 .ocdata

If it isn’t:

chmod 644 .ocdata
chown www-data:www-data .ocdata

The more interesting question is how this got there way to start with. Did you manually migrate some data or anything like that?

Hi jtr!

TNX for the fast answer. No , everything is default installation. Made the manual installation. I come from owncloud which i used since 2014. Wanna give it a try with nextcloud. I miss some documentations so i had to google around to make it work. Everything seem’s fine. Only this error seem’s to be, but not realy make some issues!!! I like more nextcloud than owncloud for the design… I’m new at nextcloud but some stuff is the same as for owncloud. Owncloud works well…

Here’s my info:

root@nc:/var/www/nextcloud/data# ls -ald .ocdata
-rw-r--r-- 1 www-data www-data 0 Mai 19 22:21 .ocdata
root@nc:/var/www/nextcloud/data

Strange behavior not? How can i troubleshoot deeper to find out, what seem’s to block the request?

Did you also do the Apache subdirectory setup here:

https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-configuration-label

And does an .htaccess file exist in /var/www/nextcloud that has probably a good screen full of stuff in it?

Hi jtr

I have this in nextcloud.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName nc.domain.com
DocumentRoot /var/www/nextcloud
Alias /nextcloud "/var/www/nextcloud"
<Directory /var/www/nextcloud/>
 Require all granted
 Options FollowSymlinks MultiViews
 AllowOverride All
 Satisfy Any
 <IfModule mod_dav.c>
 Dav off
 </IfModule>
</Directory>

ErrorLog /var/log/apache2/yourdomain.com.error_log
CustomLog /var/log/apache2/yourdomain.com.access_log common
</VirtualHost>

Here’s my .htaccess


root@nc:/var/www/nextcloud# cat .htaccess
<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
    Header always set Referrer-Policy “no-referrer”
    # 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"
# Fabio Edit https://securityheaders.com/

    Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
# Edit Fabio off
    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 /nextcloud/index.php/error/403
ErrorDocument 404 /nextcloud/index.php/error/404
root@nc:/var/www/nextcloud#

.user.ini

mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0

default-ssl.conf

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                Protocols h2 http/1.1
                ServerAdmin webmaster@localhost
                ServerName nc.domain.org
                DocumentRoot /var/www/nextcloud
                Alias /nextcloud "/var/www/nextcloud"
                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn
<IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
#Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;secure
</IfModule>

 Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
 Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav
 Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger
 Redirect 301 /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo


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

                # For most configuration files from conf-available/, which are
                # enabled or disabled at a global level, it is possible to
                # include a line for only one particular virtual host. For example the
                # following line enables the CGI configuration for this host only
                # after it has been globally disabled with "a2disconf".
                #Include conf-available/serve-cgi-bin.conf

                #   SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on

                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile      /etc/ssl/private/nc.domain.org.crt
                SSLCertificateKeyFile /etc/ssl/private/server.key
                SSLCertificatechainFile /etc/ssl/private/nc.domain.org.ca-bundle
               #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

Hi. I tried going a bit further. When i log in with admin and go to administratorsettings i get this error. I can reproduce it.

Webfinger and nodeinfo bringts me:

{"message":"webfinger not supported"}

Same for nodeinfo.

Uploading files seem’s also to work without any issues…

Also i have the issue which is already known:

[index] Fehler: Exception: The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php') at <<closure>>

0. /var/www/nextcloud/lib/base.php line 994
   OC\AppFramework\Http\Request->getRawPathInfo()
1. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

GET /data/.ocdata?t=1684758193878
from Client IP by admin at 2023-05-22T12:22:00+00:00

Sad i am unable to fix it… :frowning:

Best, Skywalker

Error from Log → nextcloud.log

"2023-05-22T11:33:04+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"admin","app":"index","method":"GET","url":"/data/.ocdata?t=1684755257875","message":"The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php')","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50","version":"26.0.1.1","exception":{"Exception":"Exception","Message":"The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php')","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/base.php","line":994,"function":"getRawPathInfo","class":"OC\\AppFramework\\Http

And a new one. As i have seen on google and nextcloud forum also other users are thinking, that this doesn’t affect the functionality:

[index] Fehler: Exception: The requested uri(/data/index.php/csrftoken) cannot be processed by the script '/nextcloud/index.php') at <<closure>>

0. /var/www/nextcloud/lib/base.php line 994
   OC\AppFramework\Http\Request->getRawPathInfo()
1. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

GET /data/index.php/csrftoken
from ClientIP by admin at 2023-05-22T12:35:25+00:00

Are you trying to have Nextcloud accessible via a subdirectory (in your URLs) or under it’s own vhost? Your configuration looks like it’s a mix of both which is a bit odd. That could be creating some of these issues.

Also, anything special about /var/www/nextcloud/data? Does it happen to be a separate partition or mount point at the OS level?

Hi Jtr

Everything ia default. Also partition. Nothing special. Data is under /var/www/nextcloud/data. Default install and normal default ubuntu setup with lvm.

Can you tell me, how i can fix it? Which parameters i have set?

I open it with https:/_nc.domain.com instead adding also /nexcloud on the link.

Is that enough for you as information?

Best

Hi

I dissite the nextcloud.conf and corrected the default-ssl.conf.

Now it seem’s to be ok!

Best, Skywalker

1 Like

Hi @skywalker ,

did you find another solution?

I have the same problem but changing site management in apache2 cannot really be the answer/solution or cause to this problem.

Exception: The requested uri(/data/.ocdata) cannot be processed by the script '/nextcloud/index.php'

Thanks,
Florom

Hi

I adjusted also the config php file with loglevel 2.

I did not see this error again in my admin weblogin. But i will check again the logs…

Best, Skywalker

Thanks for looking into it.