How to troubleshoot Sabre Exception NotAuthenticated?

I do not understand how am I supposed to troubleshoot this error, I am able to connect to NextCloud using the same username/password, but Sabre claims I am not authenticated when using it with the curl command. (it doesn’t say the user or password is invalid)

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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): 24.0.2
Operating system and version (eg, Ubuntu 20.04): unspecified by host
Apache or nginx version (eg, Apache 2.4.25): unspecified by host
PHP version (eg, 7.4): 7.4

The issue you are facing:

<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“”>
<s:message>No public access to this resource., No ‘Authorization: Bearer’ header found. Either the client didn’t send one, or the server is mis-configured, No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured</s:message>

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

  1. curl --silent --request PROPFIND --header ‘Content-Type: text/xml’ --header ‘Depth: 0’ --data ‘<d:propfind xmlns:d=“DAV:”><d:prop> <d:current-user-principal /></d:prop></d:propfind>’ --user ‘Username:Passwordwithspecialchars’ “

The output of your Nextcloud log in Admin > Logging:


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

$CONFIG = array (
  'instanceid' => 'ocvh4sxxx',
  'passwordsalt' => 'WO0H2adJ8HUX21xxx',
  'secret' => 'aTCb8JFgi9v7B/JRrMTy36sxxx',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/home/xxx/',
  'dbtype' => 'sqlite3',
  'version' => '',
  'overwrite.cli.url' => '',
  'installed' => true,

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


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.

nextcloud.log is empty