Forum Discussion

dbeavon's avatar
dbeavon
Contributor
4 months ago

Unexpected error in REST API: Unable to create database connection. There is no open application

I'm trying to run cubeviews by way of the REST api on Version: 8.2.2.16127

We use PAT tokens for a native onestream user.


Suddenly I started receiving meaningless errors about a day ago like so:


"An error occurred returning data for 'Cube View RPT_SVC_PbopHierarchyBase', Please check the Error Log for more details.

Unable to create database connection. There is no open application"

 

 

 

 

Does anyone know what this means?  Is it a bug?  Any help would be appreciated.

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    If you upgraded from an older release, you might have not noticed that the REST api has changed. Now there is an OpenApplication call that you have to make, in order to get a SI object that you can then pass as context to subsequent calls.

    If you're already doing that, you will have to post your code here, which you might not want to do - in which case, you should probably contact Onestream Support.

    • dbeavon's avatar
      dbeavon
      Contributor

      Hi JackLacava 
      I truly appreciate your time, and knowledge.

      Do you happen to have a link/reference?  I certainly was not aware of this requirement, and in the first round of testing our code was NOT impacted by this change.  (The only impact of the upgrade was the fact that we were unexpectedly required to move our authentication from OIDC to PAT tokens. )

      To make matters more interesting, we already deployed the client-side code all the way to *production*, and it seems to be working as-of now (*without* calling "OpenApplication").  It seems like a concern that our production environment is a ticking bomb that is potentially going to stop working any second.

      I want to point out that in every REST api call we make, there is a json body that specifies the application name and the base onestream url.  Shouldn't that sufficiently indicate that the application would be auto-opened?  What would be the purpose of "opening" an application as an independent step, if we have no need for the services provided in an SI object.

      I should know this by now, but is V8 still a work-in-progress? Are we considered early adopters?  If nothing else, I found that there wasn't any way to get a "breaking changes" document for the V7 -to- V8 upgrade.  I find myself pushing forward by trial-and-error, which is an imperfect experience for software development (... especially when under time constraints, to get things working before the 2025 budgeting season).

  • Based on further discussions with the folks administering the onestream environment, this was something they did wrong.

    Unfortunately, I have no clue what they did wrong since they didn't tell me.  I'm guessing it was something simple, like they forgot to actually grant the user access to this particular application.  Either way, I don't think it was a "normal" authentication failure, or the error from the REST api would have been an HTTP status (401 or whatever).

     

    The error message from the product leaves a lot to be desired.  Assuming the administrator of onestream can misconfigure a user in a simple way, we should then get a simple error message back to tell us about it. The current one ("unable to create database connection") is way too technical; it probably assumes we have access to the underlying source code for the sake of further investigation.