Stale Session Exception - after Sandbox refresh

After refreshing our “partial copy” sandbox, we are getting the following error when trying to access Skuid Central, Page Assignments, Themes, etc.:
“Stale Session Exception
The page you submitted was invalid for your session. Please try your action again.”

After investigating further it seems that certain custom settings were not copied during the Sandbox refresh. We found this post that describes a similar issue, so we recreated as many of the settings as possible. However, I got stuck at the “preferences” custom setting. The “Default Organization Level Value” information is missing:

When I try to add it by duplicating what I see in my production org, I notice that the “location” information is missing and that I get an error if I try to save the record:

What is the best way to recover from this issue? Should we re-install the SKUID app in our Sandbox?

What version of Skuid are you running? 

Hi Zach,

We are using SKUID Banzai (7.27).  

I have followed up with Salesforce Premier support as well. The issue seems the same as a previously resolved bug that was addressed with the Winter '13 release.  That is, the issue with the “duplicate value found: SetupOwnerId duplicates value on record with id:XXXXXXXXXXXXXXXXXX” on a custom hierarchy setting is exactly the same as described in this issue.  We did nothing special when refreshing our partial copy Sandbox, simply a standard “refresh” with auto activate from the production org.  I have tried looking for a hidden setting record on the “skuid__Preferences__c” object using SOQL from the Salesforce Developer Console, but none exists, so some inaccessible metadata/setting in our Sandbox org is preventing the creation of the default record.  

That said, I have no idea if the missing “Preferences” custom hierarchy setting default record data is related to the “Stale Session Exception”, but as an obvious difference between our working production org and our non-working sandbox org it seems like a good place to start.

As far as the Salesforce-posted information on the “Stale Session Exception”, the recommended approach of checking network proxy settings does not apply since I experience the same issue on my home, work and public internet connections.  The other notion on the Salesforce post that it is due to a non-working visual component, but I get that error on a visual force page on which I have commented out all of the apex elements, so that seems off too.

If you have any suggestions on how to troubleshoot or remedy, i’d greatly appreciate it.  The only other thing I can think of is to attempt an uninstall/re-install of SKUID, although I’m unsure of how that would be done.

-Matt

UPDATE: we were able to resolve the missing custom hierarchy setting default record after waiting the required minimum 5 day interval to “re-refresh” our affected Sandbox. With a goal of getting a complete copy of custom settings records, we took the step of removing all objects that had zero records from our sandbox template prior to the refresh. I’m not sure if reducing the number of objects referenced in the sandbox template was the direct cause of getting a complete copy of the settings, but it seemed to work.

HOWEVER - the “Stale Session Exception” was encountered again in the refreshed sandbox when trying to access the Skuid Central, Skuid Settings and Themes tabs within the SKUID app. Also, we noted that the Pages and Page Assignments tabs were showing standard Salesforce pages instead of the SKUID visualforce pages. Bummer!

The above observations pointed to missing metadata on the Skuid tabs and custom objects. We determined that the Page and Page Assignment objects were missing the appropriate Visualforce page content source settings, so we were able to manually override them as shown below:
Page:

Page Assignment:

This restored access to the page and page assignment tabs - groovy!

BUT - the custom Skuid Visualforce tabs could not be fixed in a similar way as they are managed and I could not figure out a way to override the tab content to point to the appropriate Visualforce pages:
Skuid Central Tab:

Skuid Settings Tab:

Skuid Themes Tab:

For now, the missing tab content assignments are inconvenient, but we can work around this issue as the Skuid Central, Skuid Settings and Themes Visualforce pages are accessible after navigating to the Pages or Page Assignments tabs.

If anyone knows of a way to manually set the custom tab content Visualforce page references, please let me know!

In the meantime, I will be following up with Salesforce support to see if the missing metadata problems that arose during or partial sandbox refresh can be addressed in a future patch or major release. To me, this seems like a bug in the Spring '16 Salesforce release as my expectation would be that metadata for installed packages should be completely copied during any sandbox refresh whether it be a dev, partial copy or full copy sandbox.

ISSUE RESOLVED:

The Salesforce Partial Copy sandbox refresh process was not copying all of the required metadata.  Although the issue described in the “Known Issues” posting (Reference W-2942356) on the Salesforce site does not describe the issue we encountered, the fix to that issue also addressed our problem.

We were able to confirm the fix by refreshing our partial copy sandbox after the fix to W-2942356 was announced.

Hurray! Thanks for the update Matt.