Nextcloud app ping fail

Summary
Hi,
I am currently trying to integrate the nextcloud integration app… I am trying to configure and submit the configuration but I get the following error “failed to install App: failed to install, /ping path is not accessible: failed to call /ping endpoint: failed to invoke via HTTP: {“type”:“error”,“text”:“signature is invalid”}{“type”:“ok”,“text”:“PONG”}”. Does anyone have an advice for me what my problem could be? I checked the mattermost and the app logs but I cannot see any usefull information…

Steps to reproduce

  • Install apps plugin.
  • Add localhost into the whitelist.
  • Clone GitHub - mattermost/mattermost-app-nextcloud: Nextcloud App for Mattermost
  • Run “docker compose up” in the cloned directory
  • Run “/apps install http http://localhost:8082/manifest.json
  • Configure and submit
  • The following error message is returned “failed to install App: failed to install, /ping path is not accessible: failed to call /ping endpoint: failed to invoke via HTTP: {“type”:“error”,“text”:“signature is invalid”}{“type”:“ok”,“text”:“PONG”}”

Expected behavior
The app gets added and I can use “/nextcloud”

Thanks in advance guys!

Hi renek95,

I’m sorry to hear you’re having trouble with integrating Nextcloud into your Mattermost platform. The error message you’re receiving seems to indicate an issue with the validation of a digital signature.

Here are a few things to check or try:

  1. App Secret: Ensure the App secret is correctly configured. This error message, “signature is invalid,” usually pops up when there is a discrepancy between the secret used by Mattermost and the Nextcloud app. Double-check the app secret configured in Mattermost matches that configured in your Nextcloud app.

  2. URL Corrections: Please verify the URL “http://localhost:8082/manifest.json” used during the “/apps install” process. Ensure there is no trailing space or unnecessary characters that could potentially lead to mismatches or validation errors.

  3. Firewall/Security Settings: Sometimes, security settings or firewall configurations can block communication between Mattermost and the apps. Ensure the firewall settings are not blocking the IP of Mattermost or the localhost:8082.

  4. Docker Compose: Make sure your Docker compose up process didn’t fail and that it’s correctly deploying the app as expected. Double-check the console logs for any warnings or errors.

  5. App Updates: It might be helpful to ensure that all your Mattermost and Nextcloud plugins/apps are updated to the latest versions, as this might affect compatibility.

  6. Restart Services: After making these changes, be sure to restart your Mattermost service as well as your Nextcloud app.

If these suggestions do not resolve your issue, could you please provide some additional information? The exact copy of Mattermost Server logs and Apps plugin logs around the time this issue is happening would be very helpful for further troubleshooting.

Please let me know how it goes or if you need further assistance. We’re here to help!

Best Regards,
~Mattermost AI Assistant :robot:

[Disclaimer: This was an AI assisted response powered by Mattermost AI. Were any of the above suggestions inaccurate? Let us know by replying to this comment!]

Hi,
same problem here.

As you can see in the capture, an error occurs when I try to enter the following command in the channel chat input box.

command: /apps install http http://localhost:8082/manifest.json

Remark: This is a very long post as it includes logs and settings.
Anyway, I don’t know if the administrator will be able to check the entire post I left, even though I completed leaving the message, it shows only part of it.

  • However, I was able to confirm that my writing is still there when I see it in edit mode.

=== error log ====
{“timestamp”:“2024-01-16 00:37:09.380 +07:00”,“level”:“debug”,“msg”:“Received HTTP request”,“caller”:“web/handlers.go:172”,“method”:“POST”,“url”:“/api/v4/channels/members/me/view”,“request_id”:“t6cey63h87d1iptddxaxyrxfmw”,“user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“status_code”:“200”}
{“timestamp”:“2024-01-16 00:37:09.454 +07:00”,“level”:“debug”,“msg”:“Received HTTP request”,“caller”:“app/plugin_api.go:982”,“plugin_id”:“com.mattermost.apps”,“request_id”:“7h9japs7nid88ctom45s4nu17r”,“plugin_caller”:“server/httpin/service.go:168”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“path”:“/api/v1/call”,“method”:“POST”,“url”:“/api/v1/call”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36”}
{“timestamp”:“2024-01-16 00:37:09.455 +07:00”,“level”:“debug”,“msg”:“app install flow: nextcloud can be installed, proceeding”,“caller”:“app/plugin_api.go:982”,“plugin_id”:“com.mattermost.apps”,“deploy_type”:“HTTP”,“destination”:“apps”,“request_id”:“5ip4tt54atb1jn7pxotgjyknma”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“plugin_caller”:“server/proxy/install.go:60”,“app_id”:“nextcloud”}
{“timestamp”:“2024-01-16 00:37:09.455 +07:00”,“level”:“debug”,“msg”:“app install flow: no previous installation detected”,“caller”:“app/plugin_api.go:982”,“plugin_id”:“com.mattermost.apps”,“request_id”:“5ip4tt54atb1jn7pxotgjyknma”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“app_id”:“nextcloud”,“deploy_type”:“HTTP”,“destination”:“apps”,“plugin_caller”:“server/proxy/install.go:66”}
{“timestamp”:“2024-01-16 00:37:09.456 +07:00”,“level”:“debug”,“msg”:“app install flow: updated app configuration”,“caller”:“app/plugin_api.go:982”,“plugin_id”:“com.mattermost.apps”,“destination”:“apps”,“request_id”:“5ip4tt54atb1jn7pxotgjyknma”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“plugin_caller”:“server/proxy/install.go:88”,“app_id”:“nextcloud”,“deploy_type”:“HTTP”}
{“timestamp”:“2024-01-16 00:37:09.458 +07:00”,“level”:“error”,“msg”:“InstallApp failed”,“caller”:“app/plugin_api.go:988”,“plugin_id”:“com.mattermost.apps”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“app_id”:“nextcloud”,“deploy_type”:“HTTP”,“plugin_caller”:“server/proxy/install.go:34”,“elapsed”:“3.214235ms”,“error”:“failed to install, /ping path is not accessible: failed to call /ping endpoint: failed to invoke via HTTP: {"type":"error","text":"signature is invalid"}{"type":"ok","text":"PONG"}”,“destination”:“apps”,“request_id”:“5ip4tt54atb1jn7pxotgjyknma”}
{“timestamp”:“2024-01-16 00:37:09.459 +07:00”,“level”:“debug”,“msg”:“Call returned an error from app: failed to install App: failed to install, /ping path is not accessible: failed to call /ping endpoint: failed to invoke via HTTP: {"type":"error","text":"signature is invalid"}{"type":"ok","text":"PONG"}”,“caller”:“app/plugin_api.go:982”,“plugin_id”:“com.mattermost.apps”,“elapsed_expand”:“430.1µs”,“elapsed_call”:“3.847831ms”,“request_id”:“7h9japs7nid88ctom45s4nu17r”,“from_user_id”:“nyzdjzwhkpn39dzi43nhzxphsc”,“path”:“/api/v1/call”,“destination”:“apps”,“plugin_caller”:“server/proxy/invoke_call.go:167”,“elapsed”:“4.278931ms”}

The execution environment is as follows:

  1. Nextcloud Hub 3 (25.0.13)
    config.php
<?php $CONFIG = array ( 'instanceid' => 'ocak3ws5nc1e', 'passwordsalt' => 'XXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXX', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'nextcloud.xxx.com', 2 => 'nextcloud.xxx.com.ngrok.io', 3 => 'localhost:8082', ), 'datadirectory' => '/srv/nextcloud/data', 'dbtype' => 'mysql', 'version' => '25.0.13.2', 'overwrite.cli.url' => 'https://nextcloud.xxx.com', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'dbpassword' => 'XXXXXX', 'updater.release.channel' => 'git', 'installed' => true, 'twofactor_enforced' => 'false', 'twofactor_enforced_groups' => array ( ), 'twofactor_enforced_excluded_groups' => array ( ), 'maintenance' => false, 'allow_local_remote_servers' => true, ); 2. Mattermost Version: 9.4.1 Database Schema Version: 117 Build Number: 7424719315 Database: postgres config.json { "ServiceSettings": { "SiteURL": "https://mattermost.xxx.com", "WebsocketURL": "", "LicenseFileLocation": "", "ListenAddress": ":8065", "ConnectionSecurity": "", "TLSCertFile": "", "TLSKeyFile": "", "TLSMinVer": "1.2", "TLSStrictTransport": false, ..... default setting "SqlSettings": { "DriverName": "postgres", "DataSource": "postgres://mattermost:XXXXXX@localhost/mattermost?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes", "DataSourceReplicas": [], "DataSourceSearchReplicas": [], ...... default setting 3. apache2 ServerName mattermost.xxx.com RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] #Redirect permanent / https://mattermost.xxx.com/ ServerName mattermost.xxx.com ServerAdmin hostmaster@mydomain.com ProxyPreserveHost On # setup the proxy Order allow,deny Allow from all RewriteEngine On RewriteCond %{REQUEST_URI} ^/api/v3/users/websocket [NC,OR] RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR] RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] RewriteRule .* ws://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L] Require all granted ProxyPass ws://127.0.0.1:8065/api/v3/users/websocket ProxyPassReverse ws://127.0.0.1:8065/api/v3/users/websocket ProxyPassReverseCookieDomain 127.0.0.1 mattermost.xxx.com Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" Header set X-Frame-Options "SAMEORIGIN" # Generated by Certbot SSLEngine On SSLCertificateFile /etc/letsencrypt/live/xxx.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/xxx.com/privkey.pem ServerAdmin admin@example.com DocumentRoot /srv/nextcloud/ ServerName nextcloud.xxx.com ServerAlias nextcloud.xxx.com ErrorLog /var/log/apache2/nextcloud-error.log CustomLog /var/log/apache2/nextcloud-access.log combined Options +FollowSymlinks AllowOverride All Require all granted SetEnv HOME /srv/nextcloud SetEnv HTTP_HOME /srv/nextcloud Dav off Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" Header set X-Frame-Options "SAMEORIGIN" #ProtocolsHonorOrder On #Protocols h2 h2c http/1.1 #RewriteEngine On SSLEngine On SSLCertificateFile /etc/letsencrypt/live/xxx.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/xxx.com/privkey.pem ServerName nextcloud.xxx.com ServerAlias nextcloud.xxx.com #RewriteEngine On #RewriteCond %{HTTPS} off #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] Redirect permanent / https://nextcloud.xxx.com/