I'm getting an error when copying a root node (to create a multilingual site for translation). I right click on the root site node, click Copy, and the modal window contains;
Server Error in '/' Application.
Object reference not set to an instance of an object.
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: System.NullReferenceException: Object reference not set to an instance of an object.
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:
[NullReferenceException: Object reference not set to an instance of an object.]
However, this is on a site in which initial development was started in SQL CE, and the database later moved to SQL Server using the WebMatrix migration tool. I suspect there's a schema problem therefore.
Right, I've tracked down the CheckPermissions error to an orphaned content node in the database; removing this manually from the umbracoNode table (and associated fk tables) has resolved the problem. I don't know how it got there, presumably something failed when it was created or deleted much earlier in the project. It wasn't rendering in the backoffice, but was clearly causing an internal problem.
Just to add to this, I also had to remove a reference to the node id in the umbracoUser2NodePermission table before I could remove it from the umbracoNode table:
delete from umbracoUser2NodePermission where nodeId = 1234
CheckPermissions error when copying root node
I'm getting an error when copying a root node (to create a multilingual site for translation). I right click on the root site node, click Copy, and the modal window contains;
Server Error in '/' Application.
Object reference not set to an instance of an object.
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: System.NullReferenceException: Object reference not set to an instance of an object.
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:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.dialogs.moveOrCopy.CheckPermissions(CMSNode node, IAction currentAction, Char actionLetter) +193
umbraco.dialogs.moveOrCopy.CheckPermissions(CMSNode node, IAction currentAction, Char actionLetter) +327
umbraco.dialogs.moveOrCopy.CheckPermissions(CMSNode node, IAction currentAction, Char actionLetter) +327
umbraco.dialogs.moveOrCopy.Page_Load(Object sender, EventArgs e) +1634
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
umbraco.BasePages.BasePage.OnLoad(EventArgs e) +18
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3063
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
This is using Umbraco 4.7.1, on Windows Server 2008R2, IIS7.5.
Phil
I've now also found a repeat of "4.6.1 YSOD in Translation section with SQL CE" (http://umbraco.codeplex.com/workitem/29973), albeit now in 4.7.1.
However, this is on a site in which initial development was started in SQL CE, and the database later moved to SQL Server using the WebMatrix migration tool. I suspect there's a schema problem therefore.
Phil
Yep, as I thought; the migration in WebMatrix to full-SQL Server has munged the schema, chaning cmsTask.taskTypeId from tinyint to int;
Right, I've tracked down the CheckPermissions error to an orphaned content node in the database; removing this manually from the umbracoNode table (and associated fk tables) has resolved the problem. I don't know how it got there, presumably something failed when it was created or deleted much earlier in the project. It wasn't rendering in the backoffice, but was clearly causing an internal problem.
Phil
Hey Phil, how were you able to identify the orphaned node in the UmbracoNode table?
Thanks,
Ally
Anyone know how to get the orphaned nodes in the UmbracoNode table please?
I don't know this is the best way to find the orphaned or not but I do this then I can move or copy root node.
1. I find the orphaned nodes by this script
select * from umbracoNode where id not in (select nodeid from cmsContentXml)
2. select only nodes the have the level of "path" more than 2 level. e.g. -1,-92,-1346,-3456
and review all site to make sure that all selected nodes are the real Document Node not data type, template, document type or else
3. delete all orphaned nodes by the script below (you should change the criteria to your nodeid)
delete from cmsPropertyData where contentNodeId in (
1787,
1913
...
)
delete from cmsDocument where nodeId in (
1787,
1913
...
)
delete from cmsContentVersion where ContentId in (
1787,
1913
...
)
delete from cmscontent where nodeId in (
1787,
1913
...
)
delete from umbracoNode where id in (
1787,
1913
...
)
Just to add to this, I also had to remove a reference to the node id in the umbracoUser2NodePermission table before I could remove it from the umbracoNode table:
Thanks Sittichai that worked a treat.
Cheers
Bjørn Fridal
is working on a reply...