Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ThomasDay
Impactful Individual
Impactful Individual

embedded-expiration/timeout issue?

Hello fellow Embedders,

 

I have a site that is working great...until it sits for 3 minutes or perhaps 5.  Then I get this when I click another tab in the report.Capture.PNG

The token expiration is set for 1 hr, btw, so I'm not sure what's up.  A refresh sets things straight.  What's to be done here..any ideas?

Thanks,

Tom

18 REPLIES 18
wabreza
Employee
Employee

If this does come down to being a timeout issue you can try one of the following:

 

  • In a server generated app you can get around this by generating a token for each render of the page.
  • In a single page app (SPA) - one option is to set a client-side timer on your page/view that is shorter than your token expiration.  At that point you can regenerate the token and reload the report passing in the new access token.
ThomasDay
Impactful Individual
Impactful Individual

@wabreza Here are the tech details of the error.  Let me know what you see as a root cause.....and thanks, Tom

 

Capture.PNG

Its a 403 which is an access issue.  What is the expiration of your generated tokens?  Is the expiration you are setting inline which the timeout you are seeing in the embedded report?

ThomasDay
Impactful Individual
Impactful Individual

@wabreza No the token timeout is set to 1hr.  We've had 403's forever to be honest.  They happen when the site has been sitting and I click on another tab in a report.  Time is 3-7 minutes, but not always.  Sometimes longer...but seldom a non-issue.  We have 4 embedded reports up behind our paywall.  The tabbed ones are the main issue.  There are lots of filters and data...and the app is really useful and fast.  Very good market reception.  Can't say I recall a non-tabbed one giving me trouble but I'll look more carefully going forward.  Now that we're live and have users starting up...we're paying more attention in general.  Tom

You mentioned you have 4 embedded reports.  Are they all embedded within the app at the same time?  Or are they embedded seperatly in different views?

 

If they are all embedded in the page at the same time I'm thinking of some potential issues where their may be some shared state (cookies/local storage) that have the potential to be shared accross the iframes.

ThomasDay
Impactful Individual
Impactful Individual

@wabrezaThey all are called via the same iFrame.  We have a wordpress site where the page behind our paywall has a side menu navbar where you pick the report--and it's retrieved via it's id from the collection/workspace.  There is seldom an issue as it's retrieved...just when it's been sitting and I click a report page tab or sometimes just click a slicer on the idle page and sometimes there are no problems.  

 

  • This morning's picture of problems had a single chrome tab open to our site iframe and the x's appeared when I clicked a powerbi report tab to switch pages.
  • The picture I sent to this topic, had two chrome tabs open to our site--and the second chrome tab iframe presented problems when I clicked a powerbi report tab to switch pages.
  • BTW, the first chrome tab iframe has not shown problems at all and has been sitting for quite some time. 

Is there something I can do to understand any shared state issues?

Tom

OK - So to be clear your app is re-using the same iframe to load multiple reports.  Correct?

 

How are you loading the reports?  Are you manually making the postMessage(...) calls or are you using the JavaScript SDK?  

ThomasDay
Impactful Individual
Impactful Individual

@wabreza  I just called the embed site guy (I'm the powerbi guy) and he says "every time a new menu item is called, I load a new page and a new token."  So, I don't think that's the same iFrame in this sense.  

And using the JavaScript SDK...

Thanks for patience on this...

ThomasDay
Impactful Individual
Impactful Individual

@wabreza Are we out of pursuable options as you think about this?  I'm not sure how we'd pursue/fix conflicts in the shared state.  Do I need to put in a ticket of some sort? Tom

Can you put together a small sample app that reproduces the problem?  I haven't been able to reproduce your issue locally.

ThomasDay
Impactful Individual
Impactful Individual

@wabreza That's a great next step.  It may take awhile as we're in active dev of features etc as we launch, but that seems like a good exercise for a lot of reasons.  Tom

ThomasDay
Impactful Individual
Impactful Individual

@wabreza  In the interim--I thought a short video of the failure would be helpful to the community and perhaps allow you to get further along in deciphering what is happening when our site "fails" when inactive for a short while (3-5 minutes). To recap, each report loaded from a menu gets it's own page and token and the timeout period is set to 1 hour. We are embedding using Javascript in wordpress. Jesse will post the embedding code on git hub to benefit the opensource community that is embedding powerbi models. Here is a link to the video in dropbox which I've set to share for 7 days. Hopefully you'll get a flavor for what's happening and can perhaps direct us to more inquiry or a path to eliminate our issue. Tom

 

PS: there are no report level filters--all slicers/filters are contained on a page.  Not that it matters...the x's appear for report level filtered pages as well.

ThomasDay
Impactful Individual
Impactful Individual

@wabreza  finally, here is the embedding code on github.  The `getEmbedTokens` method makes it look as though maybe we’re reusing tokens--we thought about that as an option at one point, but we don’t save tokens across requests, so in reality the way it works out is that a new token is generated for each request.  We should probably pull that out for the sake of clarity.  You'll most likely want to look at the `includes/powerbi.inc` file

@ThomasDay did you get resolution of this issue. we are facing similar issue with PowerBI webpart in SharePoint site. Reports working fine in PowerBI but erroring out in SharePoint site.

ThomasDay
Impactful Individual
Impactful Individual

@arujindal  Actually I never got an answer from the forum.  I did get to the Microsoft person who built the github code for embedding V1.  (You'll notice this is quite an old post).  The end of this story was that there is a php command in the embedding code we used that sets the timeout period and it's measured in seconds not minutes, so turns out se had set the timeout to 60 instead of 3600 for a one hour timeout period.

 

I really don't know how the sharepoint embedding works, but that's what did it for us.

 

Hope that helps,

Tom

@ThomasDay Did you get a solution for this? We are facing similar issue where we are using Sharepoint PowerBI webpart and embedding the reports inside that webpart. After navigating to another tab in report 403 error pops up.

@ThomasDay Did you get a solution for this? We are facing similar issue where we are using Sharepoint PowerBI webpart and embedding the reports inside that webpart. After navigating to another tab in report 403 error pops up.

wabreza
Employee
Employee

If you click on one of the "See Details" links do you get an activity or request id GUID?  If so please share.  I'll be able to look up the root cause of the issue with this information.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.