API Calls not working anymore?! (21.0.3)

Nextcloud Update from 17.0.1 -> 21.03 (with all steps)
Now i need to reshare some folders and want to do this with a script (300 users ~)

When using Curl the API calls always fail as an example:
  <status>failure</status>
  <statuscode>997</statuscode>
  <message>Current user is not logged in</message>

Nextcloud version (eg, 20.0.5): 21.0.3
Operating system and version (eg, Ubuntu 20.04): Debian 10 Latest
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38
PHP version (eg, 7.4): 7.4-FPM

The issue you are facing:
When i try to run a mass update via the nextcloud API, i receive following error:
$ curl -u admin:admin http://localhost/ocs/v1.php/cloud/users -H “OCS-APIRequest: true”

<?xml version="1.0"?> failure 997 Current user is not logged in

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

Steps to replicate it:

  1. Call
  2. The
  3. API

The output of your Nextcloud log in Admin > Logging:

NO LOG ENTRY

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


<?php
$CONFIG = array (
  'instanceid' => 'assfasfaasfag',
  'passwordsalt' => 'safagasgagafg',
  'secret' => '9vWasdadsadasVohWBhSQDPH0CR02oz9fK7Hd',
  'trusted_domains' =>
  array (
    0 => 'x',
    1 => 'x',
    2 => 'x',
    3 => 'x',
    4 => 'x',
  ),
  'datadirectory' => '/DATA_pool/x/nextcloud',
  'dbtype' => 'mysql',
  'version' => '21.0.3.1',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.0.52',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nexxxtcloud',
  'dbpassword' => 'xxx',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'appstore.experimental.enabled' => false,
  'loglevel' => 1,
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'theme' => 'xxx',
  'updater.release.channel' => 'stable',
  'mail_template_class' => '\\OC\\Mail\\xxx',
  'skeletondirectory' => '',
  'mysql.utf8mb4' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\BMP',
    3 => 'OC\\Preview\\TXT',
    4 => 'OC\\Preview\\PDF',
  ),
  'integrity.check.disabled' => true,
  'overwrite.cli.url' => 'http://192.168.0.xx',
  'default_phone_region' => 'DE',
);

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

ALL GOOD

Update:
Disabled FPM now it’s working again!