cube
cube copied to clipboard
SQL API: Can't get template Javascript error
Problem
I'm getting the following error when trying to run any query in the SQL API, even select * from information_schema.tables:
ERROR: User: Can't get template: JavaScript Error
Some things to note:
- the SQL API works when using our config in a local docker container, without a separate cubestore and no custom repository factory
- the REST API works without issues
- there is a custom repository factory to pull schemas from a remote location
- there is only one data source configured, no custom driver factory
Not sure if this is a bug or if something is misconfigured, so I'm submitting this as a question. I didn't see anything in this repo or the cube slack related to this question, and nothing searching around either, so this seems like a unique problem to my situation. (I did find where in the source code this error is thrown, but it seems to relate to the SQL generator object, which further confuses me.)
Hi @bshoemanpax8 👋
Do you see anything in the logs of API instances when you receive this error? I believe there should be some error messages there.
Hi Igor! :)
Sadly the logs don't seem any more informative, even with the log level set to trace the logs look like this:
{"message":"Cube SQL Error","apiType":"sql","appName":"NULL","error":"Error during processing PostgreSQL message: User: Can't get template: JavaScript Error","protocol":"postgres"}
{"message":"Cube SQL Error","appName":"NULL","apiType":"sql","protocol":"postgres","error":"Error during processing PostgreSQL message: User: Can't get template: JavaScript Error"}
{"message":"Cube SQL Error","error":"Error during processing PostgreSQL message: User: Can't get template: JavaScript Error","protocol":"postgres","apiType":"sql","appName":"NULL"}
{"message":"Cube SQL Error","apiType":"sql","error":"Error during processing PostgreSQL message: User: Can't get template: JavaScript Error","appName":"NULL","protocol":"postgres"}
It turns out what we had deployed in k8s was an old version of Cube, v0.34.23. Upgrading to the latest gadsme helm charts (at v0.34.56) resolved this issue 🎉