Nextcloud Music : "Trust anchor for certification path not found" error with Power Ampache 2

Support intro

Hello,
I cannot connect to my Nextcloud Music using Power Ampache 2 from Android. I can successfully connect using the web browser using the same URL (using https).

My configuration is made with a docker stack from Linuxserver.io : Nextcloud + Mariadb + Swag.
Swag is essentially nginx + fail2ban + letsencrypt cert validation built-in.
Swag logs show that Letsencrypt certificate is OK for my domain, Nextcloud instance is a subdomain of it. As said above, I can connect using HTTPS connection.

Nextcloud version : 25.0.13
Operating system and version: Armbian 24.5.1 bookworm (x32)
Apache or nginx version : 1.20.2
PHP version : 8.1.16

The issue you are facing:

Looking at Power Ampache logs, I can see :

2024-06-23 15:51:54
authorize() - cannot load data HttpException {"code":404,"message":"{ \"exception\" : \"java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.\" }","detailMessage":"HTTP 404 { \"exception\" : \"java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.\" }","stackTrace":[],"suppressedExceptions":[]}

2024-06-23 15:51:54
retrofit2.HttpException: HTTP 404 { "exception" : "java.security.cert.CertPathValidatorException: Trust anchor for certification path not found." }
    at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
    at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:535)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)

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

Steps to replicate it:

  1. Run Power Ampache 2 on Android
  2. Choose login and enter URL prposed by Nextcloud Music (https://nextcloud.mydomain/apps/music/ampache)
  3. Check logs

The output of your Nextcloud log in Admin > Logging:

Nothing. I can only see this in the nginx log :

92.xxx.yyy.zzz - - [23/Jun/2024:18:11:56 +0200] "GET /apps/music/ampache/server/json.server.php?action=handshake&auth=0dc8eab854xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx289e9ded5423&user=xxxxxxx&timestamp=1719159117 HTTP/2.0" 404 146 "-" "PowerAmpache2-1.00-60-fdroid" 

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

PASTE HERE

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

92.xxx.yyy.zzz - - [23/Jun/2024:18:11:56 +0200] "GET /apps/music/ampache/server/json.server.php?action=handshake&auth=0dc8eab854xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx289e9ded5423&user=xxxxxxx&timestamp=1719159117 HTTP/2.0" 404 146 "-" "PowerAmpache2-1.00-60-fdroid" 

What’s wrong on my server ?

After some investigations, it appears that nginx configuration file needs some specific directives when using Ampache client with Nextcloud music.

See Add specific setting to nginx proxy server configuration when using Nextcloud Music app with Ampache client · Issue #11951 · nextcloud/documentation · GitHub issue asking for documentation to be amended with that information.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.