CalDAV/CardDAV Error 503

Nextcloud version (eg, 20.0.5): 25.0.3.2
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 11. 5.15.84-v8+ (aarch64)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.54
PHP version (eg, 7.4): PHP 8.1.14

For a few days now, I’ve been struggling with a very strange problem that I can’t explain and for which, despite intensive research, I can’t find anything that solves it.

I get the error 503 with the address book or calendar again and again. Sometimes changes work, sometimes not.
For example, I have set up the address book in Thunderbird again and now get no result when retrieving the operation REPORT.
The same when syncing the address book on my smartphone (DAVx5) or even iOS.

Here are some examples:

2.243.5.200 - - [08/Feb/2023:11:55:45 +0100] "REPORT /remote.php/dav/addressbooks/users/xxxx/contacts/ HTTP/2.0" 503 639 "https://nextcloudpi.****************.myfritz.net/remote.php/dav/addressbooks/users/xxxx/contacts/" "Thunderbird CardBook/84.3"
2.243.5.200 - - [08/Feb/2023:12:24:28 +0100] "REPORT /remote.php/dav/addressbooks/users/xxxx/contacts/ HTTP/2.0" 503 639 "-" "DAVx5/4.2.6-ose (2022/12/12; dav4jvm; okhttp/4.10.0) Android/13"
2.243.5.200 - - [08/Feb/2023:12:37:28 +0100] "REPORT /remote.php/dav/addressbooks/users/xxxx/contacts/ HTTP/2.0" 503 639 "-" "iOS/16.3 (20D47) dataaccessd/1.0"

If I change an appointment in the calendar, the operation PUT generates the error 503 but is executed successfully. When loading the calendar the change is visible.

2.243.5.200 - - [08/Feb/2023:12:01:16 +0100] "PUT /remote.php/dav/calendars/xxxx/personal/aa2e51c2-7f45-48d9-be3b-7c342983f865.ics HTTP/2.0" 503 639 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1"
[Wed Feb 08 12:01:17.543899 2023] [proxy_fcgi:error] [pid 1454:tid 548324970880] [client 2.243.5.200:57239] AH01067: Failed to read FastCGI header
[Wed Feb 08 12:01:17.544047 2023] [proxy_fcgi:error] [pid 1454:tid 548324970880] (104)Connection reset by peer: [client 2.243.5.200:57239] AH01075: Error dispatching request to :

If I change a task (is also saved in the calendar), then I also get the error 503 with the operation PUT, but this is not updated.

2.243.5.200 - - [08/Feb/2023:12:04:46 +0100] "PUT /remote.php/dav/calendars/xxxx/personal/b89aa20d-586c-47f3-a4d3-a7c0a107a9b1.ics HTTP/2.0" 503 639 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1"
[Wed Feb 08 12:04:46.859200 2023] [proxy_fcgi:error] [pid 1454:tid 548324970880] [client 2.243.5.200:57266] AH01067: Failed to read FastCGI header
[Wed Feb 08 12:04:46.859325 2023] [proxy_fcgi:error] [pid 1454:tid 548324970880] (104)Connection reset by peer: [client 2.243.5.200:57266] AH01075: Error dispatching request to :

Here are the related entries in oc-calendarobjects

"lastmodified"	"uri"
"2023-02-08 11:01:17"	"aa2e51c2-7f45-48d9-be3b-7c342983f865.ics"
"2023-02-06 22:24:18"	"b89aa20d-586c-47f3-a4d3-a7c0a107a9b1.ics"

In the Nextcloud Error Log, very often I get the message for the operations,

"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, 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".

and in apaches nextcloud related error log

[Wed Feb 08 11:40:14.617704 2023] [proxy_fcgi:error] [pid 1453:tid 548333371776] [client 2.243.5.200:56970] AH01067: Failed to read FastCGI header, referer: https://nextcloudpi.****************.myfritz.net/remote.php/dav/addressbooks/users/xxxx/contacts/
[Wed Feb 08 11:40:14.617812 2023] [proxy_fcgi:error] [pid 1453:tid 548333371776] (104)Connection reset by peer: [client 2.243.5.200:56970] AH01075: Error dispatching request to : , referer: https://nextcloudpi.****************.myfritz.net/remote.php/dav/addressbooks/users/xxxx/contacts/

.htaccess in webroot folder contains

<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>
....

Since I can log in and get data, it doesn’t seem to be a general authorization problem. I suspect something is missing in the configuration, but I don’t know what.
I have also looked through countless threads on the web, but without success.

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

Steps to replicate it:

  1. Sync addressbook
  2. or modify calendar entries

The output of your Nextcloud log in Admin > Logging:

Admin > Logging
Zum Hauptinhalt springen	Zum Navigationsbereich der App springen	
Homepage von NextCloudPi
Level	App	Nachricht		Zeit
Fehlersuche	webdav	Sabre\DAV\Exception\NotAuthenticated: No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, 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	
2023-02-08T15:11:19+0100
Fehlersuche	webdav	Sabre\DAV\Exception\NotAuthenticated: No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, 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	
2023-02-08T15:11:18+0100
Fehlersuche	webdav	Sabre\DAV\Exception\NotAuthenticated: No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, 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	
2023-02-08T15:11:18+0100
Fehlersuche	webdav	Sabre\DAV\Exception\NotAuthenticated: No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, 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	
2023-02-08T15:11:16+0100
Fehlersuche	logreader	Could not find resource file "/apps/logreader/css/../js/logreader-main.css"	
2023-02-08T15:11:08+0100
Warnung	settings	Controller OCA\Settings\Controller\CheckSetupController::check executed 3788 queries.	
2023-02-08T15:10:39+0100
Information	no app in context	Deprecated event type for OCP\IDBConnection::CHECK_MISSING_COLUMNS: Symfony\Component\EventDispatcher\GenericEvent is used	
2023-02-08T15:10:38+0100
Information	no app in context	Deprecated event type for OCP\IDBConnection::CHECK_MISSING_INDEXES: Symfony\Component\EventDispatcher\GenericEvent is used	
2023-02-08T15:10:36+0100
Information	no app in context	Deprecated event type for OCP\IDBConnection::CHECK_MISSING_PRIMARY_KEYS: Symfony\Component\EventDispatcher\GenericEvent is used	
2023-02-08T15:10:35+0100
Fehlersuche	no app in context	2 well known handlers registered	
2023-02-08T15:10:35+0100
Fehlersuche	no app in context	2 well known handlers registered	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	No flow configurations is going to run Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	workflowengine	Flow activation: rules were requested for operation Zugriff auf Datei verhindern	
2023-02-08T15:10:34+0100
Fehlersuche	cron	CLI cron call has selected job with ID 24643	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 24642	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 24641	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 24618	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 22896	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Finished OCA\Notifications\BackgroundJob\SendNotificationMails job with ID 21450 in 0 seconds	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Run OCA\Notifications\BackgroundJob\SendNotificationMails job with ID 21450	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 21450	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 21449	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 6587	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Finished OCA\Circles\Cron\Maintenance job with ID 6521 in 0 seconds	
2023-02-08T15:10:02+0100
Fehlersuche		[debug] running maintenance (1)	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Run OCA\Circles\Cron\Maintenance job with ID 6521	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 6521	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 6518	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 4763	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 4116	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Finished OCA\UserStatus\BackgroundJob\ClearOldStatusesBackgroundJob job with ID 3891 in 0 seconds	
2023-02-08T15:10:02+0100
Fehlersuche	cron	Run OCA\UserStatus\BackgroundJob\ClearOldStatusesBackgroundJob job with ID 3891	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 3891	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 3889	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 3887	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 3526	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 3267	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 1652	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 1650	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 889	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 888	
2023-02-08T15:10:02+0100
Fehlersuche	cron	CLI cron call has selected job with ID 649	
2023-02-08T15:10:02+0100

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "3": "nextcloudpi",
            "1": "192.168.**.**",
            "2": "nextcloudpi.****************.myfritz.net",
            "11": "2a01:c23:****:****:***:****:****:****",
            "14": "nextcloudpi"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.3.2",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/media\/myCloudDrive1\/ncdata\/data\/tmp",
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "debug": true,
        "loglevel": 0,
        "default_phone_region": "de",
        "log_type": "file",
        "maintenance": false,
        "theme": "",
        "logfile": "\/media\/myCloudDrive1\/ncdata\/data\/nextcloud.log",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "app_install_overwrite": [
            "files_texteditor",
            "gallery"
        ],
        "data-fingerprint": "85debc01f804ff063236f876f2563a0d",
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [
            "2FA"
        ],
        "twofactor_enforced_excluded_groups": [],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}

1 Like

Exactly the same problem here! Same NC version, I’m using NPC 1.51.0 on an Odroid C4 freshly installed some days ago.
From the web ui, contacts cannot be saved and calendars keep loading endlessly due to the 503 error

Have you tried clearing the cache?

sudo bash -c 'source /usr/local/etc/library.sh && clear_opcache' 
sudo service php8.1-fpm restart
1 Like

Wow! That’s it! I am so happy now, because everything is working as usual again. I spent days with research and many (configuration) attempts in vain to solve the problem. Thank you very much.

No problem. I would like to know what causes it. Updated apps? Maybe somebody more familiar with NCP can shed some light on this reoccurring issue.

Basically, I don’t know what led to the problem. I switched my Nextcloud from 32 to 64 bit by reinstalling everything. At the beginning everything worked fine, then I had problems with Thunderbird (offline functionality). After a while I saw in the administration view that there were problems with the resolution of ‘./well-known/nodeinfo’ and ‘./well-know/webfinger’. During the analysis I noticed errors with the code 503 in one of the apaches log. I tried to solve the problem according to Service Discovery instructions,but I had no success. At some point I noticed that I also got the error 503 during synchronization and changes to the calendar and address book. After trying many things mentioned on the web without success, I decided to open a ticket here in the help forum.

Considering the solution I think, I had the opcache problem probably already at the beginning.

Today, I rebuilt all my config back to the initial state after everything was running for now. I also had the error 503 again, but another clear_opcache solved the problem.

I suspect that there is some authentication information held in the cache that caused the problem, kind of like web browsers. I noticed in some debug information (cativated in config.php settings) that for successful operations the user was set, but for failed operations it was not (value “–”), for whatever reason.

Hi, I believe I’m encountering the same issue, but this fix doesn’t seem to help.

I’ve ran a support ticket with DAVx5 : Contacts (and Contacts birthday calendar) not syncing from Nextcloud · bitfireAT/davx5-ose · Discussion #279 · GitHub

Thanks

Same here, I even had contact to a DAVx5 dev who said that he sees nothing wrong in the DAVx5 logs, just the reaction to 503, which is to do nothing - resulting in calendars (in case of my colleague) or contacts (in my case) not being synced. So it’s not only about birthday calendars. To me it looks like it could be relevant how many calendars or address book (or the sum of both?) are being synced at a time (throttling?).

As for the “fix” - doesn’t work for me either. But maybe I missed something: I was looking for how to clear opcache, and to me it seems that restarting PHP-FPM should do that. Didn’t work for me. If there’s something else @sven1234 or @kjathome did to flush opcache, please let us know.

Also have this problem. Appeared after upgrading PHP to 8.2 and NC to 26. Tried using PHP 8.1 but it didn’t help. I also noticed that Tasks.org using CalDAV doesn’t work as it should too. OX Sync on Android however works okay with the contacts. DAVx5 gets 503 from the server as well as Tasks.org does.

It is not only restarting. You omitted the first line.

@sven1234 True :wink: That is due to (a) the fact that I searched on how to clear opcache and found that it is always cleared upon restart (wrong?) and (b) the fact that my system does not have /usr/local/etc/library.sh or even any library.sh (searched as root using updatedb;locate library.sh). I’m on Arch using NGINX and PHP-FPM.

Interesting, so you did not encounter it on NC25 using PHP 8.1?
I ask because I do, also on NC26RC2 using PHP8.1.

I did actually, but I simply upgraded to 26th dev quite fast hoping this will get fixed somehow. Last a few weeks I’m using NC 26 so I tried and tested everything I could on the new version. Just don’t want to downgrade in order to test it once more if it isn’t really necessary.

I don’t have the required library.sh file either and can’t complete the first line.

Well, the problem has been going on for about 2 weeks now and still no idea how to fix this, even temporarily.