Forum Discussion
Auto refresh fails the credentials are invalid
Hi all,
We have a Power BI Dashboard that reads Cherwell data as a data source. We have it scheduled for auto refresh during the night.
The auto fresh frequently fails with ' (500): Internal Server Error' and we also see "Your data source can't be refreshed because the credentials are invalid. Please update your credentials and try again." message. When we re-authenticate Cherwell credentials, and run auto refresh, it runs fine. Also the auto refresh runs successfully, several times, but eventully, it fails with above mentioned errors. Any ideas why the authentication with Cherwell expires?
Thanks,
Seyed
9 Replies
- FarhanAhmedCommunity Champion
When this error happens it starts continuously failing of data refreshes? or is it a one-off failure?
What is the authentication you are using?
If you are using any access token for authentication, kindly make sure that it is not expiring. Otherwise, this will keep happening.
- AnonymousNot applicable
Hi Farhan,
Once the refresh fails, the auto refresh attempts to run in the next couple of scheduled times resulting in the same error and auto-refresh schedule eventually gets turned off. The error is "Web.Contents failed to get contents from (Cherwell URL)(500): Internal Server Error.
Any help with resolving this issue is greatly appreciated.
- ravalparthRegular Visitor
Hi Seyed,
Did you end up finding a solution for this on?Cheers,
Parth
- IceyCommunity Support
Hi Anonymous ,
I know little about Cherwell but have some thoughts.
Any ideas why the authentication with Cherwell expires?Are you using an access token for authentication, which mentioned here: OAuth2 Authentication Modes (cherwell.com). If so, there will be an expiration datetime.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi Icey,
I believe the answer to your question is yes, we are using OAuth2 to authenticate. I read the information in the link you proided, but the only thing that I see in the settings for the dataset is Data Source Credentials where Cherwell and Web credentials are listed. So, how do we go about making changes so that the authentication would not expire? We are hoping to resolve this so that we wouldn't have to re-authenticate everytime it expires.
Thank you,
Seyed
- IceyCommunity Support
Hi Anonymous ,
I find that, for security reasons, the maximum scheduled refresh token lifespan for Cherwell REST API client IDs in CSM is 1440 minutes (24 hours). This is also the default setting. It may no be changed.
Reference: Using Power BI and the Data Connector
An Access token is needed for all subsequent calls to the REST API to identify the User agent as a valid API user. The life span of the Access token is based on the client ID's settings. Access tokens tend to have a relatively short life span and can be refreshed with a Refresh token.
Refresh tokens are used to periodically refresh the Access token without the need to provide credentials again. Refresh tokens tend to have a longer life span than Access tokens and are also based on the client ID's settings. Once the Refresh token has expired or the user is logged out, a full login must be performed to obtain new tokens. It is not always necessary to use Refresh tokens, which are generally considered safer over non-encrypted transport protocols, such as HTTP. If you use an HTTPS connection, you can increase the Access token life span and use Access tokens for all subsequent connections.
Note: To further secure your system, use SSL.
Reference: OAuth2 Protocol for the REST API (cherwell.com)
In addition, here is a thread which is not exactly the same, but you can refer to:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.