Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.well-known URLs, failed on: /.well-known/caldav #701

Open
rodinux opened this issue Jun 30, 2024 · 6 comments
Open

.well-known URLs, failed on: /.well-known/caldav #701

rodinux opened this issue Jun 30, 2024 · 6 comments

Comments

@rodinux
Copy link
Contributor

rodinux commented Jun 30, 2024

Describe the bug

After upgrade I have a message .well-known URLs, failed on: /.well-known/caldav

Context

  • Hardware: Old laptop or computer
  • YunoHost version: 11.2.17.1
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: yes
    • If yes, please explain: I have the found the issue upgrading to nextcloud 29.0.2~ynh1 (stable branch) and have try the testing branch nextcloud 29.0.3~ynh1
  • If upgrading, current package version: 29.0.3~ynh1 (was also with 29.0.2~ynh1)

Steps to reproduce

  • If you performed a command from the CLI, the command itself is enough. For example:

    sudo yunohost app upgrade nextcloud
    sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
  • If the error occurs in your browser, explain what you did:

    1. Go to ' the admin settings parameters on nextcloud
    2. **See error Your web server is not properly set up to resolve .well-known URLs, failed on: /.well-known/caldav For more details see the [documentation ↗](https://docs.nextcloud.com/server/29/go.php?to=admin-setup-well-known-URL). **

Expected behavior

*Keep the /.well-known/caldav working after an update *

This issue is related there :

nextcloud/server#45033

After trying a lot of things to debug, like editing the nginx nextcloud.conf, I have understood my problem is because for subfolder installations because this will be checking for /subfolder/.well-known/carddav instead of /.well-known/carddav whereas applications using WebDAV will be querying for /.well-known/carddav without the subfolder.

So this issue comes with a nextcloud installed on a subpath URL like https://mydomain.tld/nextcloud/

This post help me resolve the issue: nextcloud/server#45033 (comment)

So editing the file /var/www/nextcloud/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php and change the line 64

 60         protected function getTestUrls(string $url): array {
 61                 $hosts = $this->config->getSystemValue('trusted_domains', []);
 62                 $cliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
 63                 if ($cliUrl !== '') {
 64                         $hosts[] =  $cliUrl;
 65                 }

with :

 60         protected function getTestUrls(string $url): array {
 61                 $hosts = $this->config->getSystemValue('trusted_domains', []);
 62                 $cliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
 63                 if ($cliUrl !== '') {
 64                         $hosts[] = rtrim(str_replace($this->urlGenerator->getWebroot(), '', $cliUrl), '/');
 65                 }
@rodinux
Copy link
Contributor Author

rodinux commented Jul 2, 2024

Be careful, it seems not been a good idea to try this patch !

The issue will be fixed in version 29.0.4
While browsing the discussion, MichaIng reports that carddav and caldav work perfectly but it is the verification mechanism that bug, that is why the fix is not considered urgent and that it must be checked that it will not break something else.
In short, modify by hand php files of such a complex application, I will avoid until the developer has not asked.

@SQLSlacker
Copy link

SQLSlacker commented Jul 19, 2024

29.0.4 does not fix the issue for my server using NGINX with Nextcloud in a subdirectory

@rodinux
Copy link
Contributor Author

rodinux commented Jul 21, 2024

The trailing slash is now not needed anymore, but sub directories are still not supported. But a PR is open, and awaits review/suggested adjustments: nextcloud/server#46255

@MCMic
Copy link

MCMic commented Jan 6, 2025

It seems the check expects a redirection to /<subfolder>/remote.php/dav, but what happens is a redirection to /<subfolder>/index.php/.well-known/caldav
Ref https://docs.nextcloud.com/server/30/admin_manual/issues/general_troubleshooting.html#service-discovery (see also the page about nginx configuration).

So

# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
return 301 __PATH__/index.php$request_uri;
would need to be changed to match https://docs.nextcloud.com/server/30/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-the-nginx-webroot

@ericgaspar
Copy link
Member

ericgaspar commented Jan 7, 2025

@MCMic can you be more specific about what need to be changed?

our settings seem to be the same as suggested in the doc...

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /nextcloud/index.php$request_uri;

@MCMic
Copy link

MCMic commented Jan 7, 2025

        location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /nextcloud/remote.php/dav/; }

I thought this part was missing, it’s missing in my local version, it seems to be there in the git version.

The file does not appear in the output of yunohost tools regen-conf --list-pending. Can I still regen it somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants