Backend (NC) not responding, Debug mode/log not working/empty
-
Hey.
Id like to give more information but im currently just trying to set up backend auth. Sadly I just get prompted with “Backend not responding” while making sure all credentials and the URL is correct. WebDAV connection works on other clients but not with FormsBridge.
The debug mode is showing a large blank log and the log file itself remains empty so theres nothing for me to work off from.
Im on the newest WP and FormsBridge version.
Any Idea why the debug mode not working?
Best Regards.
-
Hi @bazed,
With this little information it could be hard to understand what’s going on with your bridge, but lets give it a try.
I assume you are trying to build a bridge using the template wizard and you are stuck in the backend step, isn’t it? At this step Forms Bridge tries to ping the backend to validate the credentials and without a successful response you can’t go further.
The wizard process lacks a more in depth logs coverage to make it more debugable. We are working on it. At the same time, if you aren’t seeing nothing on the debug console is because there are no errors, good news.
Let me explain a little more in detail how the bridge connection is done: Nextcloud exposes its Webdav API (the protocol that uses Forms Bridge to talk with it) under the endpoint
/remote.php/dav/files/${username}. This URL path is appended to the base URL of your backend by Forms Bridge. For example, if your have your backend registered with the base URLhttps://nextcloud.example.coop, the endpoint where the ping will be done will behttps://nextcloud.example.coop/remote.php/dav/files/${username}.Nextcloud supports to be exposed under a sub-path of a domain, like
https://example.coop/nextcloud. If that is the case, the resulting endpoint will behttps://example.coop/nextcloud/remote.php/dav/files/${username}. If you are in this second scenario, double check that the backend URL has the sub-path included in such a way that the resulting URL matches one of the examples. Take in mind that the/remote.php/dav/files/${username}is appended dynamically by PHP and the backend base URL should have only the root URL of your Nextcloud.Lets talk about the
${username}part of this URLs. This is a variable part that is replaced by the username from the backend credential. The webdav protocol works with the Basic HTTP authentication schema. This means that, to grant access to your private files, the webdav requests should includes an authorization header with your user login and your password. In Forms Bridge you can attach this kind of credentials to the backend. If you are working with the template wizard you’ve probably done it in the previous step. If you are trying to do it manually, start by registering a Basic credential with your login and password and then bind it to the backend. To work properly, the user login should be your username, not your email, and that’s because the username of the credential is the value that Forms Bridge will be use to replace the${username}part of the endpoint and if you try to authenticate with your user email the resulting URL will be invalid.That’s all we can tell to you, I hope it helps. Excuse me for going on so long wit the explanation. If you have more details about your problem maybe we can be able to give you more precise answers.
We look forward to hearing from you!
Hey. Thanks for your detailed reply.
First I tried using the template wizard, as the ping didnt work with all the correct credentials entered I tried setting it up manually according to the documentation.
Trying to ping it there also leads to:
and the debug log remains empty, so I gotta asume its something on my end/the credentials?
I think I understood everything correctly but I double checked my input on credentials without success.
To make it a bit more practicale:
Auth Client ID:Bridge
Auth Client Secret:PW of above User
Base URL:URL thats blurred in the screen below
Filepath:relative to base URL, leading to .csv
If Im just “building” the link my self and putting it into a browser im getting the prompt to enter auth details and after entering them I get access to the filepath. Im able to edit/download the .csv this way:
The Plugin still prompts me with “not reachable”. Im also getting this in my server logs:PROPFIND /remote.php/dav/files/Bridge/ HTTP/1.1
And this in my nextcloud logs:no app in context NotFoundException thrown: Sabre\DAV\Exception\NotFound Exception thrown: Sabre\DAV\Exception\NotFound-
This reply was modified 4 months, 4 weeks ago by
bazed.
Hi @bazed,
I can’t see the attached image, sorry, but we can understand something from your explanation.
Let’s see if this help: The
CLIENT IDfield of the credential should be the username with which you want to authenticate against Nextcloud, theCLIENT SECRETits password. Based on your last message, you are usingBridgeas the client_id/username. Does this username exists on your Nextcloud? TheSabre\Dav\Exception\NotFoundexception could be explained if no user with this username were found. Maybe you are introducing the username in theNAMEfield of the credential? This field is an internal label to identify the credential, but it is not used in the authorization request.I edited my message so you should be able to see the pictures now, if not those are the URLs:
https://imgur.com/QIBfR3y
https://imgur.com/zIrHGDW
Bridge is entered asclient IDwith a nextcloud user exisiting under the same name. I used the name field just to label the credentials/backend etc.
https://i.imgur.com/YGq2116.png

https://imgur.com/EgQG1hS
(Yes, theres a directory under the user “Bridge” thats also called “Bridge” where the .csv is stored.Hi @bazed,
Thanks for the images, but after all, I can’t realize what the problem is with your backend connection, sorry.
In order to help to debug your problem we’ve released a new version of Forms Bridge with more log coverage, including error logs on the backend ping process. If you upgrade the plugin to version 4.1.2, you may be able to get more context about what’s going on under the hood. We would appreciate it if you could share with us these logs with us. With this information, we may be able to improve the Nextcloud addon and fix the bug, if that is the case.
Kind regards!
There we go:
[ERROR] Nextcloud backend ping error response
[ERROR] {
"errors": {
"http_request_failed": [
"cURL error 60: SSL certificate problem: unable to get local issuer certificate"
]
},
"error_data": {
"http_request_failed": {
"request": {
"url": "https:\/\/xxxBASEURLxxx\/remote.php\/dav\/files\/Bridge",
"args": {
"headers": {
"Authorization": "Basic xxxRANDOM SOMETHINGxxx"
},
"method": "GET"
}
}
}
},
"\u0000*\u0000additional_data": []
}-
This reply was modified 4 months, 3 weeks ago by
bazed.
That’s interesting! This error indicates that you are trying to establish a SSL encrypted connection over HTTP (https://) to a host that does not have a valid SSL certificate, or maybe a self signed certificate, it could be?
You have two approaches to solve this issue. If the host does not have a certificate, update your backend base URL to work with the
http://schema instead thehttps://. If the host has a self signed certificate, you have to skip SSL verification. To do that you can copy this code in your WordPress themefunctions.phpfile, or maybe with a plugin like WPCode:add_filter( 'http_request_args', 'bazed_skip_nc_ssl_verification', 10, 2 );
function bazed_skip_nc_ssl_verification( $args, $url ) {
if ( false !== strpos( $url, 'https://xxxBASEURLxxx' ) ) {
// Skip SSL verification for NC HTTP requests.
$args['sslverify'] = false;
}
return $args;
}Pleas, if you have to copy this code on your theme, do it with care, I don’t want to break nothing on your WordPress site!
Yup, that was it.
If only I had given you more details in my original post, haha.
My web hosting (Nextcloud and WordPress) is currently running in a test environment under an alternative hostname, since my domain hasn’t been transferred yet. The alternative hostname uses a custom SSL certificate, which was the root cause of all these issues.It’s working now for testing and experimentation, and once my domain is transferred, there won’t be any need for custom solutions anymore.
Thank you so much!
I’m glad it’s been resolved!
Thanks you too, at the end of this thread we have an improved version of the plugin than when we started.
We hope you enjoy the plugin.
-
This reply was modified 4 months, 3 weeks ago by
Còdec.
-
This reply was modified 4 months, 4 weeks ago by
You must be logged in to reply to this topic.