Your web server is not properly set up to resolve "/.well-known/caldav". ///// Sabre\DAV\Exception: Unknown error while seeking content //// Sync pending perpetually

Nextcloud SERVER version: Nextcloud Hub II (23.0.0)
Operating system and version: Debian 11 Stable
Apache or nginx version: Apache 2.4.52
PHP version : 7.24.25

Nextcloud CLIENT version: 3.4.1
OS: Windows 10 Pro 21H2 19044.1415

The issue you are facing:
1 - " Your web server is not properly set up to resolve “/.well-known/caldav”. " message in overview panel.
2 - Files in the Windows Eplorer keep having the arrows and sync pending message while the client says “All synced!” and “Last Sync was successful”
image

Steps to reproduce the issue:
1 Just open the client and connect

Is this the first time you’ve seen this error? Yes

The output of your Nextcloud log in Admin > Logging:
Log too long, using hastebin with json format.

https://www.toptal.com/developers/hastebin/mebuboxiyo.json

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

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxxxx',
  'trusted_domains' =>
  array (
    0 => '192.168.200.104',
    1 => 'xxxx.org',
  ),
  'datadirectory' => '/home/raid1Disk/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwrite.cli.url' => 'https://192.168.200.104/nextcloud',
  'dbname' => 'nextcloudDB',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'mail_from_address' => 'xxxx',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'hotmail.it',
  'mail_smtpauthtype' => 'LOGIN',
  'memcache.local' => '\\OC\\Memcache\\APCu',
);

The output of Apache error.log:

[Mon Jan 10 00:00:03.741606 2022] [ssl:warn] [pid 859] AH01906: localhost:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jan 10 00:00:03.742292 2022] [ssl:warn] [pid 859] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 10 00:00:03.742393 2022] [mpm_prefork:notice] [pid 859] AH00163: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Mon Jan 10 00:00:03.742398 2022] [core:notice] [pid 859] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 10 12:59:06.662373 2022] [access_compat:error] [pid 12537] [client 79.49.3.55:49841] AH01797: client denied by server configuration: /home/raid1Disk/nextcloud/data/.ocdata
[Mon Jan 10 13:00:18.872382 2022] [mpm_prefork:notice] [pid 859] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jan 10 13:01:06.877436 2022] [ssl:warn] [pid 809] AH01906: localhost:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jan 10 13:01:06.889498 2022] [ssl:warn] [pid 809] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 10 13:01:12.893608 2022] [ssl:warn] [pid 950] AH01906: localhost:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jan 10 13:01:12.893628 2022] [ssl:warn] [pid 950] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 10 13:01:12.897189 2022] [mpm_prefork:notice] [pid 950] AH00163: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Mon Jan 10 13:01:12.897214 2022] [core:notice] [pid 950] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 10 13:02:35.512214 2022] [access_compat:error] [pid 1855] [client 79.49.3.55:49951] AH01797: client denied by server configuration: /home/raid1Disk/nextcloud/data/.ocdata
[Mon Jan 10 13:26:27.559678 2022] [mpm_prefork:notice] [pid 950] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jan 10 13:27:16.047037 2022] [ssl:warn] [pid 802] AH01906: localhost:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jan 10 13:27:16.059267 2022] [ssl:warn] [pid 802] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 10 13:27:21.648022 2022] [ssl:warn] [pid 954] AH01906: localhost:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jan 10 13:27:21.648050 2022] [ssl:warn] [pid 954] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jan 10 13:27:21.652788 2022] [mpm_prefork:notice] [pid 954] AH00163: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Mon Jan 10 13:27:21.652813 2022] [core:notice] [pid 954] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 10 13:50:04.497039 2022] [access_compat:error] [pid 2615] [client 79.49.3.55:55934] AH01797: client denied by server configuration: /home/raid1Disk/nextcloud/data/.ocdata

.htaccess file below

Maybe this helps: https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#apache-web-server-configuration Seems like the apache config is not complete.

“AllowOverride All” is needed for the htaccess to take effect.

1 Like

This is my Apache .conf file. As you can see, AllowOverride All is already present.

Alias /nextcloud "/home/raid1Disk/nextcloud"

<VirtualHost *:443>
  DocumentRoot /home/raid1Disk/nextcloud
  ServerName localhost

  SSLEngine On
  SSLCertificateFile /etc/ssl/private/apache-selfsigned.crt
  SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

  <Directory /home/raid1Disk/nextcloud>
    Require all granted
    AllowOverride All
    Options FollowSymLinks MultiViews
    Satisfy Any

    <IfModule mod_dav.c>
      Dav off
    </IfModule>
    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
    </IfModule>
  </Directory>
</VirtualHost>

I also wanna add the .htaccess file that I edited in relation to this guide.

<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

    # 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"

    Header onsuccess unset X-Content-Type-Options
    Header always set X-Content-Type-Options "nosniff"

    Header onsuccess unset X-Download-Options
    Header always set X-Download-Options "noopen"

    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 "none"

    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)$">
    Header set Cache-Control "max-age=15778463"
  </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 #####

# I commented these lines
#ErrorDocument 403 /nextcloud/
#ErrorDocument 404 /nextcloud/

# these are the lines as guide recommends 
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^\.well-known/carddav /home/raid1Disk/nextcloud/remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/caldav /home/raid1Disk/nextcloud/remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/webfinger /home/raid1Disk/nextcloud/index.php/.well-known/webfinger [R=301,L]
  RewriteRule ^\.well-known/nodeinfo /home/raid1Disk/nextcloud/index.php/.well-known/nodeinfo [R=301,L]
</IfModule>

As you set the DocumentRoot to “/home/raid1Disk/nextcloud” your nextcloud isn’t running in a subfolder. Why are you setting the alias before setting the document root? Could work if you remove the part you added to htaccess file.

//Edit: I guess you mixed the config for directory based and virtual host installation. It could help to reread https://docs.nextcloud.com/server/23/admin_manual/installation/source_installation.html#apache-web-server-configuration

1 Like

I deleted the Alias line, but I haven’t quite understood how I should set the directories. Can you point it out for me? I still get plenty of errors.

EDIT: The dav exception still stands even tho’ in the overview panel there’s no "Your web server is not properly set up to resolve “/.well-known/caldav”. " message anymore.

What errors do you get?

As you set the DocumentRoot to your nextcloud folder you don’t need the alias line and the htaccess should work WITHOUT the modification you did at the end.

1 Like

Same errors as before.

Sabre\DAV\Exception: Unknown error while seeking content

/home/raid1Disk/nextcloud/apps/dav/lib/BulkUpload/MultipartRequestParser.php - line 129:

OCA\DAV\BulkUpload\MultipartRequestParser->isAt()

/home/raid1Disk/nextcloud/apps/dav/lib/BulkUpload/BulkUploadPlugin.php - line 69:

OCA\DAV\BulkUpload\MultipartRequestParser->isAtLastBoundary()

/home/raid1Disk/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

OCA\DAV\BulkUpload\BulkUploadPlugin->httpPost()

/home/raid1Disk/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

Sabre\DAV\Server->emit()

/home/raid1Disk/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

Sabre\DAV\Server->invokeMethod()

/home/raid1Disk/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

Sabre\DAV\Server->start()

/home/raid1Disk/nextcloud/apps/dav/lib/Server.php - line 339:

Sabre\DAV\Server->exec()

/home/raid1Disk/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/home/raid1Disk/nextcloud/remote.php - line 166:

require_once("/home/raid1 ... p")

Add into your Apache httpd file this. Replace “cloud” with the subdomainname you use. The exapmple is for DirectAdmin users.

|*if SUB=“cloud”|

RewriteEngine on
RewriteRule ^.well-known/carddav /cloud/remote.php/dav [R=301,L]
RewriteRule ^.well-known/caldav /cloud/remote.php/dav [R=301,L]
RewriteRule ^.well-known/webfinger /cloud/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^.well-known/nodeinfo /cloud/index.php/.well-known/nodeinfo [R=301,L]

|*endif|

@Hendrik: He posted his apache-config, so no, this is just not right!

@Yosyp: Read somewhere about using an older version of the client for not getting this errors anymore. Maybe you can try this?

1 Like

@swindhab Do you know where I can find them? I will later try opening a bug report on GitHub.

edit: nvm I’ve found them. What version do you recommend using?

I don’t have the problem myself as I don’t use the client. But what I read is this post: Sabre\DAV\Exception: Unknown error while seeking content - #11 by m707

1 Like

Thank you, I’ll try that.

I also got another error:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

[Sabre\DAV\Exception: Unknown error while seeking content ----- Sync pending perpetually · Issue #30626 · nextcloud/server · GitHub] there it is the github thread

This is handled in the official docs: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1

1 Like

I have already appended the required line to the crontab, although now that I think about it I may have written it wrongly.
This is the crontab -l .

*/5  *  *  *  * php -f /home/raid1Disk/nextcloud/cron.php --define apc.enable_cli=1

Maybe it should be like this?

*/5  *  *  *  * php -f  --define apc.enable_cli=1 /home/raid1Disk/nextcloud/cron.php

Is the php module installed?

1 Like

Yup!

[PHP Modules]
apc
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Was it right in the first instance? Because I changed the crontab to the last I’ve typed.

EDIT: I followed OCC won't run with memcache/apcu - #7 by Reiner_Nippes this thread and it worked.

EDIT2: the webdav error still stands, waiting for GitHub responses.

You are using localhost as domain with a self-signed cert, maybe this is the problem? Maybe it helps to try a FQDN with an appropriate cert… At least make sure the client is trusting your self-signed cert.

1 Like

I made the client trust the certificate when first connected.

Try something like this:
*/5 * * * * /usr/local/php74/bin/php -f /home/xxxx/domains/xxx.eu/public_html/cloud/cron.php

I needed the php version explicit and also the real path for the user access. This is with DirectAdmin on RedHat 8 linux.