I am attempting to query my External Database Collection called lift-workouts and while in preview mode, I am able to successfully retrieve the data that I need. However, on the full site, I am not retrieving information from the database and getting a WD_UNKNOWN_ERROR. I created a separate webpage to isolate the issue and continued to get the same error. Any feedback is much appreciated! My full code is below.
Site code:
import { externalQuery } from 'backend/aModule';
$w.onReady(function () {
externalQuery().then(product => {
console.log(product);
})
.catch(error => {
console.log(error);
});
});
aModule.jsw
import wixData from "wix-data"
export function externalQuery() {
let options = {"suppressAuth": true };
return wixData.query("lift-workout/lift_workouts")
.find(options)
.then((results) => {
return results;
})
.catch((err) => {
let errorMsg = err;
return errorMsg;
});
}
Picture of error from full site:
Edit: As well, my current hypothesis is that the problem is dealing with how permissions are set. I am using Google Cloud Run to run the adapter between the Postgres database and wix. Here is the screenshot of the failed request in Cloud Run: