You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently deploying NextCloud using the official Helm chart which includes Nginx and PHP-FPM. However, I am facing an issue with the DAVx⁵ app on Android, where it reports a "PropFind method not allowed" error. It seems this issue has been previously documented in other issues, but the provided solutions do not resolve the problem and are not applicable to Kubernetes Ingress setups.
Actual Behavior:
When attempting to connect using DAVx⁵, the app encounters an error stating that the PropFind method is not allowed. This indicates a potential misconfiguration in either the Nginx setup or the Kubernetes Ingress rules that restrict HTTP methods essential for DAVx⁵'s operation.
nginx.ingress.kubernetes.io/enable-cors: "true"nginx.ingress.kubernetes.io/cors-allow-methods: "GET HEAD POST OPTIONS PUT PATCH DELETE PROPFIND MKCOL REPORT"nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-Forwarded-For"
It does not make any sense because it's not on the ingress side; it's about the nextcloud-nginx container.
Once I add those annotations to the ingress and test Davx5 again, it shows that those methods
are allowed, but I'm still encountering a 405 error.
DAVx5 logs after adding excplicit CORS annotations
2024-04-23 19:13:32 5350 [network.HttpClient] --> PROPFIND https://nextcloud.domain.org/ h2
2024-04-23 19:13:32 5350 [network.HttpClient] Depth: 0
2024-04-23 19:13:32 5350 [network.HttpClient] User-Agent: DAVx5/4.3.16-gplay (2024/04/14; dav4jvm; okhttp/4.12.0) Android/14
2024-04-23 19:13:32 5350 [network.HttpClient] Accept-Language: en-US, en;q=0.7, *;q=0.5
2024-04-23 19:13:32 5350 [network.HttpClient] Content-Type: application/xml; charset=utf-8
2024-04-23 19:13:32 5350 [network.HttpClient] Content-Length: 198
2024-04-23 19:13:32 5350 [network.HttpClient] Host: nextcloud.domain.org
2024-04-23 19:13:32 5350 [network.HttpClient] Connection: Keep-Alive
2024-04-23 19:13:32 5350 [network.HttpClient] Accept-Encoding: gzip
2024-04-23 19:13:32 5350 [network.HttpClient] Cookie: __Host-nc_sameSiteCookiestrict=true; oc_sessionPassphrase=pk5ZtvMczxv9NDTpvGHK5jpn%2FtjouU7lgLxyziS7rgiRRE3XkGNLzM4VJZXe7U1wq%2BdccZyf7mLlIaERwsGVDIL9N9CT3w6ASnW7NREBynQLowqjsipIcivVWdqdKS%2BW; oc4sncy5go9g=b42d9a10347aa65d7a8ad1a755536214; stickounet=1713892414.005.13187.415743|ec59da9da29dd3ab51c3e45939dab7d1; __Host-nc_sameSiteCookielax=true
2024-04-23 19:13:32 5350 [network.HttpClient]
2024-04-23 19:13:32 5350 [network.HttpClient] <?xml version='1.0' encoding='UTF-8'?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-principal /></prop></propfind>
2024-04-23 19:13:32 5350 [network.HttpClient] --> END PROPFIND (198-byte body)
2024-04-23 19:13:32 5350 [network.HttpClient] <-- 405 https://nextcloud.domain.org/ (3ms)
2024-04-23 19:13:32 5350 [network.HttpClient] date: Tue, 23 Apr 2024 17:13:33 GMT
2024-04-23 19:13:32 5350 [network.HttpClient] content-type: text/html
2024-04-23 19:13:32 5350 [network.HttpClient] content-length: 157
2024-04-23 19:13:32 5350 [network.HttpClient] referrer-policy: no-referrer
2024-04-23 19:13:32 5350 [network.HttpClient] x-content-type-options: nosniff
2024-04-23 19:13:32 5350 [network.HttpClient] x-download-options: noopen
2024-04-23 19:13:32 5350 [network.HttpClient] x-frame-options: SAMEORIGIN
2024-04-23 19:13:32 5350 [network.HttpClient] x-permitted-cross-domain-policies: none
2024-04-23 19:13:32 5350 [network.HttpClient] x-robots-tag: noindex, nofollow
2024-04-23 19:13:32 5350 [network.HttpClient] x-xss-protection: 1; mode=block
2024-04-23 19:13:32 5350 [network.HttpClient] strict-transport-security: max-age=31536000; includeSubDomains
2024-04-23 19:13:32 5350 [network.HttpClient] access-control-allow-origin: *
2024-04-23 19:13:32 5350 [network.HttpClient] access-control-allow-credentials: true
2024-04-23 19:13:32 5350 [network.HttpClient] access-control-allow-methods: GET HEAD POST OPTIONS PUT PATCH DELETE PROPFIND MKCOL REPORT
2024-04-23 19:13:32 5350 [network.HttpClient] access-control-allow-headers: DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-Forwarded-For
2024-04-23 19:13:32 5350 [network.HttpClient] access-control-max-age: 1728000
2024-04-23 19:13:32 5350 [network.HttpClient]
2024-04-23 19:13:32 5350 [network.HttpClient] <html><head><title>405 Not Allowed</title></head><body><center><h1>405 Not Allowed</h1></center><hr><center>nginx/1.25.5</center></body></html>
2024-04-23 19:13:32 5350 [network.HttpClient] <-- END HTTP (157-byte body)
2024-04-23 19:13:32 5350 [servicedetection.DavResourceFinder] No resource found
EXCEPTION at.bitfire.dav4jvm.exception.HttpException: HTTP 405
at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:3)
at at.bitfire.dav4jvm.DavResource.checkStatus(DavResource.kt:1)
at at.bitfire.dav4jvm.DavResource.processMultiStatus(DavResource.kt:2)
at at.bitfire.dav4jvm.DavResource.propfind(DavResource.kt:76)
at at.bitfire.davdroid.servicedetection.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.kt:37)
at at.bitfire.davdroid.servicedetection.DavResourceFinder.discoverPrincipalUrl(DavResourceFinder.kt:301)
at at.bitfire.davdroid.servicedetection.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:29)
at at.bitfire.davdroid.servicedetection.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:4)
at at.bitfire.davdroid.ui.setup.LoginModel$detectResources$job$1$configuration$1.invoke(LoginModel.kt:3)
at at.bitfire.davdroid.ui.setup.LoginModel$detectResources$job$1$configuration$1.invoke(LoginModel.kt:1)
at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:59)
at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invoke(Interruptible.kt:13)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:16)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:41)
at org.apache.commons.text.WordUtils.runInterruptible$default(WordUtils.java:9)
at at.bitfire.davdroid.ui.setup.LoginModel$detectResources$job$1.invokeSuspend(LoginModel.kt:38)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:4)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:98)
So, those Kubernetes annotations are essentially ineffective and permit
unrestricted access. I'm not entirely convinced that this is beneficial for security purposes.
Wayout
It appears that the "discovery" functionality is not functioning properly. However,
it is possible to manually configure DAVx5 to sync contacts by obtaining the URL from
the web interface. It seems like the URL format is: https://nextcloud.domain.org/remote.php/dav/addressbooks/users/username/contacts/
Addional
If someone could provide annotations for CORS, HSTS, etc. to enhance security, caching, and load balancing, I would greatly appreciate it. If someone revised my configuration from a high availability (HA) and security best practices standpoint, or offered criticism, I would be very grateful.
It's quite odd that nginx is disclosing its version.
I believe it's preferable to disable server tokens by default in the configuration of the nextcloud-nginx container.
<body><center><h1>405 Not Allowed</h1></center><hr><center>nginx/1.25.5</center></body></html>
The text was updated successfully, but these errors were encountered:
Issue Description:
I am currently deploying NextCloud using the official Helm chart which includes Nginx and PHP-FPM. However, I am facing an issue with the DAVx⁵ app on Android, where it reports a "PropFind method not allowed" error. It seems this issue has been previously documented in other issues, but the provided solutions do not resolve the problem and are not applicable to Kubernetes Ingress setups.
Actual Behavior:
When attempting to connect using DAVx⁵, the app encounters an error stating that the PropFind method is not allowed. This indicates a potential misconfiguration in either the Nginx setup or the Kubernetes Ingress rules that restrict HTTP methods essential for DAVx⁵'s operation.
Logs and Errors
Logs from DavX5
Environment
Kubernetes distribution: k3s
Helm Chart Version:
https://nextcloud.github.io/helm/
nextcloud/nextcloud
4.6.6
values.yaml
Explicit CORS ingress annotations do not resolve the issue with auto-discovery
I checked this #410
and tested by adding
It does not make any sense because it's not on the ingress side; it's about the nextcloud-nginx container.
Once I add those annotations to the ingress and test Davx5 again, it shows that those methods
are allowed, but I'm still encountering a 405 error.
DAVx5 logs after adding excplicit CORS annotations
Wayout
It appears that the "discovery" functionality is not functioning properly. However,
it is possible to manually configure DAVx5 to sync contacts by obtaining the URL from
the web interface. It seems like the URL format is:
https://nextcloud.domain.org/remote.php/dav/addressbooks/users/username/contacts/
Addional
If someone could provide annotations for CORS, HSTS, etc. to enhance security, caching, and load balancing, I would greatly appreciate it. If someone revised my configuration from a high availability (HA) and security best practices standpoint, or offered criticism, I would be very grateful.
It's quite odd that nginx is disclosing its version.
I believe it's preferable to disable server tokens by default in the configuration of the nextcloud-nginx container.
The text was updated successfully, but these errors were encountered: