No Response of Rest-API (302

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): 22.2.0.2
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.18.0
PHP version (eg, 7.4): 7.4.3

The issue you are facing: I installed Nextcloud behind a reverse SSH but every Rest-Request (to ocs/v2.php), the nextcloud instance mades, end in an empty response, so for example is the group / user manegement broken.

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

The output of your Nextcloud log in Admin > Logging:

{"reqId":"ffF3twiaBDzFczArFyCU","level":3,"time":"2021-10-11T03:43:22+00:00","remoteAddr":"127.0.0.1","user":"eriktunsch","app":"PHP","method":"POST","url":"/index.php/apps/theming/ajax/updateStylesheet","message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud/lib/private/Files/Storage/Local.php","line":291,"function":"unlink"},{"function":"unlink","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":193,"function":"call_user_func"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":1171,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":728,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/File.php","line":131,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/SimpleFS/SimpleFile.php","line":149,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":397,"function":"delete","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":289,"function":"resetCache","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":153,"function":"variablesChanged","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/apps/theming/lib/Controller/ThemingController.php","line":188,"function":"process","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"updateStylesheet","class":"OCA\\Theming\\Controller\\ThemingController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"Dk3K7QaNyarmoxpAR26w","level":3,"time":"2021-10-11T03:43:22+00:00","remoteAddr":"127.0.0.1","user":"eriktunsch","app":"PHP","method":"POST","url":"/index.php/apps/theming/ajax/updateStylesheet","message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css.deps): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css.deps): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud/lib/private/Files/Storage/Local.php","line":291,"function":"unlink"},{"function":"unlink","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":193,"function":"call_user_func"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":1171,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":728,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/File.php","line":131,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/SimpleFS/SimpleFile.php","line":149,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":397,"function":"delete","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":289,"function":"resetCache","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":153,"function":"variablesChanged","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/apps/theming/lib/Controller/ThemingController.php","line":188,"function":"process","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"updateStylesheet","class":"OCA\\Theming\\Controller\\ThemingController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"Dk3K7QaNyarmoxpAR26w","level":3,"time":"2021-10-11T03:43:22+00:00","remoteAddr":"127.0.0.1","user":"eriktunsch","app":"PHP","method":"POST","url":"/index.php/apps/theming/ajax/updateStylesheet","message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css.gzip): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"unlink(/var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css.gzip): No such file or directory at /var/www/cloud/lib/private/Files/Storage/Local.php#291","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud/lib/private/Files/Storage/Local.php","line":291,"function":"unlink"},{"function":"unlink","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":193,"function":"call_user_func"},{"file":"/var/www/cloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":1171,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud/lib/private/Files/View.php","line":728,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/File.php","line":131,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud/lib/private/Files/SimpleFS/SimpleFile.php","line":149,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":397,"function":"delete","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":289,"function":"resetCache","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/Template/SCSSCacher.php","line":153,"function":"variablesChanged","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/apps/theming/lib/Controller/ThemingController.php","line":188,"function":"process","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"updateStylesheet","class":"OCA\\Theming\\Controller\\ThemingController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}


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

<?php
$CONFIG = array (
  'instanceid' => 'xxxxx',
  'passwordsalt' => 'xxxxxx',
  'secret' => 'xxxxx1',
  'trusted_domains' => 
  array (
    0 => 'xxxxxxx',
    1 => 'localhost',
  ),
  'datadirectory' => '/var/www/cloud_data',
  'dbtype' => 'mysql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'xxxxxx',
  'dbname' => 'xxxxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxx',
  'dbpassword' => 'xxxxxx',
  'installed' => true,
  'app_install_overwrite' => 
  array (
    0 => 'pride',
  ),
  'trusted_proxies' =>  
  array ( 
    0 => '10.42.0.0/16',
    1 => '103.21.244.0/22', 
    2 => '103.22.200.0/22', 
    3 => '103.31.4.0/22', 
    4 => '104.16.0.0/12', 
    5 => '108.162.192.0/18', 
    6 => '131.0.72.0/22', 
    7 => '141.101.64.0/18', 
    8 => '162.158.0.0/15', 
    9 => '172.64.0.0/13', 
    10 => '173.245.48.0/20', 
    11 => '188.114.96.0/20', 
    12 => '190.93.240.0/20', 
    13 => '197.234.240.0/22', 
    14 => '198.41.128.0/17', 
    15 => '2400:cb00::/32', 
    16 => '2606:4700::/32', 
    17 => '2803:f800::/32', 
    18 => '2405:b500::/32', 
    19 => '2405:8100::/32', 
    20 => '2c0f:f248::/32', 
    21 => '2a06:98c0::/29',
    22 => 'proxy IPv4, 
    23 => 'proxy IPv6',
 ),
  'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
  'overwriteprotocol' => 'https',
);

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

NO OUTPUT

I think the path is not correct. Correct is perhaps:
/../../cloud/apps/user_status/css/user-status-menu.css
Please search the correct path of the files.
I think there is a problem with your reverse proxy for matching the correct path.

This is the data path of your nextcloud e.g. user data.
The css files are not in this path.

In which path is nextcloud installed?
Where have you found the config.php?
It is the upper directory to the direcotry config including config.php.

Hi,

the problem is not a missing css file. The problem is, that the v2 Apo is returning constant 302 found errors.

Yes. But i think you must also solve the other problem.
And perhaps youf find your problem with the other problem.

Do you have (more) logs?
Please post some nginx - configs.

This is my nginx config from the nextcloud-instance:

server {
    listen                  80;
    listen                  [::]:80;
    server_name             cloud.humboldt-makerspace.de makerspace-cloud.dk7et.de;
    root                    /var/www/cloud/;

    # logging
    access_log              /var/log/nginx/cloud/cloud.humboldt-makerspace.de.access.log;
    error_log               /var/log/nginx/cloud/cloud.humboldt-makerspace.de.error.log warn;

    # index.php
    index                   index.php index.html index.htm;

    # index.php fallback
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
	include snippets/fastcgi-php.conf;
	fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    }  

}

and this are the apache parameters for the reverse proxy pointing to the by reverse ssh opened port:

RequestHeader set Host "makerspace-git.dk7et.de"
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:4788/"
ProxyPassReverse "/" "http://127.0.0.1:4788/"

It was actually correct… the css file is to find under /var/www/cloud_data/appdata_ocalc7xglk46/css/user_status/62ab-dc35-user-status-menu.css

I looked btw again at the log… It seems, that the entries are way older than the errors of the api…

I got it running now! It was a missing config in the php part :sweat_smile: