SaaS CMS has officially launched! Learn more now.

EPiServer.Core.EPiServerException: PageReference: Input string was not in a correct format. - EpiServer CMS 7.0.586.1

Vote:
 

I have a custom property which was working fine before i upgraded from CMS 5.2 R2 to CMS 7.0.586.1 . Now whenever i try to edit the property value i get below error. This property has the reference to a page in the episerver same site and on the basis of pagereference i get certain values from that page to the page on which i have defined the custom property. Other than editing the property is working fine.Please find below the exception.Ideally when i try to edit it should give me a popup window with treeview of pages in my site.

UrlReferer

https://www.test.no:123/EPiServer/CMS/edit/pagebrowser.aspx?id=1234&disablecurrentpageoption=False&info=FullRegion_ArticleLink1_ctl00_Display&value=FullRegion_ArticleLink1_ctl00_Value&epslanguage=no&displaywarning=False&requireurlforselectedpage=false
https://www.test.no/EPiServer/CMS/Home

PageReference: Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: EPiServer.Core.EPiServerException: PageReference: Input string was not in a correct format.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[EPiServerException: PageReference: Input string was not in a correct format.]
   EPiServer.Core.PageReference.Parse(String s) +77
   EPiServer.DataAccess.ContentDB.ReadPageReference(DbDataReader reader, PropertyData prop) +316
   EPiServer.DataAccess.ContentDB.ReadPropertyData(PropertyData prop, DbDataReader reader, ContentReference contentLink, CultureInfo language) +148
   EPiServer.DataAccess.ContentListDB.ReadPageList(DbCommand cmd) +1581
   EPiServer.DataAccess.<>c__DisplayClass19.b__18() +401
   EPiServer.Data.Providers.<>c__DisplayClass1`1.b__0() +57
   EPiServer.Data.Providers.SqlDeadlockRetryPolicy.Execute(Boolean isInTransaction, Func`1 method) +72
   EPiServer.Data.Providers.SqlDatabaseHandler.Execute(Func`1 action) +205
   EPiServer.DataAccess.ContentListDB.LoadSpecificContentInstances(Int32[] contentLinks, Int32 languageBranchID) +97
   EPiServer.DataAbstraction.ContentStore.LoadSpecificContentInstances(Int32[] contentLinks, Int32 languageBranchID) +31
   EPiServer.DefaultContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +339
   EPiServer.Core.ContentProvider.GetScatteredContents(IList`1 contentLinks, ILanguageSelector selector) +324
   EPiServer.Core.ContentProvider.LoadChildren(ContentReference contentLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +167
   EPiServer.<>c__DisplayClass3f.b__3e(ContentProvider provider) +106
   EPiServer.Core.ContentProviderMap.Iterate(Action`1 contentProviderHandler) +162
   EPiServer.DataFactory.GetWastebasketContent(ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +125
   EPiServer.DataFactory.GetChildren(ContentReference contentLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +749
   EPiServer.DataFactory.GetChildren(ContentReference contentLink, ILanguageSelector selector) +60
   EPiServer.Web.WebControls.PageDataSource.GetChildrenForLoader(PageReference pageLink) +116
   EPiServer.Web.WebControls.HierarchicalPageLoader.GetFilteredChildren(PageReference pageLink) +45
   EPiServer.Web.WebControls.PageHierarchyData.EnsureChildrenLoaded() +36
   EPiServer.Web.WebControls.PageHierarchyData.get_HasChildren() +26
   EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath) +530
   EPiServer.UI.WebControls.PageTreeView.PopulateChildNodes(IHierarchicalEnumerable enumerable, Int32 depth, Int32 expandDepth, PageTreeNode parentNode, ArrayList populationPath) +629
   EPiServer.UI.WebControls.PageTreeView.PopulateRecursive(String viewPath) +233
   EPiServer.UI.WebControls.PageTreeView.PerformDataBinding() +130
   System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +102
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   EPiServer.UI.Edit.PageExplorer.OnLoad(EventArgs e) +554
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
#121034
Apr 30, 2015 8:35
Vote:
 

Can you see what kind of string you are sending in?

#121039
Apr 30, 2015 10:15
Vote:
 

No, as episerver is handling that. but if there is a way to see it do tell me.

#121040
Apr 30, 2015 10:29
Vote:
 

From the callstack it seems that there is some property defined as a PageReference that has some "unknown" format stored in the database. Could you try to execute the following sql statement 

select LinkGuid, ContentLink, String from tblContentProperty as prop inner join tblPropertyDefinition as def on prop.fkPropertyDefinitionID = def.pkID
where def.fkPropertyDefinitionTypeID = 4

My guess is that you will find some row that have LinkGuid and ContentLink as null but some unknown format for String column.

#121043
Apr 30, 2015 11:28
Vote:
 

I fired the query and got values in ContentLink only .There where no null values in contentlink but other two columns LinkGuid  and String column where completely null.

#121067
Apr 30, 2015 13:47
Vote:
 

So every entry for String is null, there is no entry which is String.Empty or a blank space?

#121069
Edited, Apr 30, 2015 14:13
Vote:
 
<p>After i ran your query i realised that&nbsp;<span>LinkGuid and&nbsp;String column should not be null for the&nbsp;page i am trying to edit &nbsp;the property. so i copied the contentguid from tblContent where pkID =&nbsp;ContentLink &nbsp;pasted it in&nbsp;LinkGuid&nbsp;</span>and also copied&nbsp;ContentLink &nbsp;value into string column . This&nbsp;worked when i ran my site . &nbsp;</p> <p></p> <p>Thanks for the help Johan :-)&nbsp;</p> <p><span></span></p>
#121071
Apr 30, 2015 14:44
Vote:
 
<p>The solution which was working as mentioned by me in the above post has now stopped working again and i am stuck with the same issue</p>
#121363
May 07, 2015 14:13
Vote:
 

I ran below given query on the upgrade database and recieved no values.

SELECT * FROM [dbxyz].[dbo].[tblContent] where pkID = 3

SELECT * FROM [dbxyz].[dbo].[tblContent] where pkID = 4

But when i ran the above queries on a newly created database directly in CMS 7.0.586.1 i got rows

#121365
Edited, May 07, 2015 14:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.