No node exists with id '0' when trying to add a document type
Had this issue all morning and cant nail what is causing it.
I have a few document types defined and ive stripped them right back to all that work fine but when I add a new type with just a string property for example i get the error below.
To make it even odder if i remove all the properties and just create the type it adds it. Then if i add a property to the class, rebuild and run it adds ok. If I then delete the entire content type object from umbraco and restart the app pool so it recreates, it then falls over again with the same error! ??? Odd.
Any ideas cos its driving me nuts and im going knowhere, About to ditch uSitebuilder shortly.
Damian, this is issue is not related with the uSiteBuilder. If you try to create the document manually (through browser) you'd get the same error. The problem is that you probably changed the inheritance between document types which Umbraco does not handle very well. Actually you cannot do it through browser at all (change inheritance) but it can be done through uSiteBuilder (but I wouldn't recommend to do it).
I do seem to remember changing the inheritance on one of the document types.
Rather a scary issue if this was done on a mature site. Lucky ive hit this issue right at the start of a fresh site. Phew.
I have been trying to find what the issue was by changing the Name= property on the document type and it worked. Soon as i changed the name it broke again. Completely random!
Whats the solution? Do i have to delete doc types from umbraco and give my types new names? Or is the deployment junked and im better off starting a fresh?
I recreated the doc type in umbraco, rebuilt my doctypes dll, copied in etc... and restarted the app and all ok.
Removed the doc types from umbraco, restarted the app and the doc type was then recreated fine (that wouldnt create before).
Removed the doc type again, restarted and it all came back fine.
So it looks to me like if you need to change anything about a type - its alias, name, inheritance scheme etc.. Make sure you remove it from umbraco manually before putting in the new dll. Then, when it rebuilds it doesnt get confused with the old type.
Will see how i go with this and report back. Want to make sure i dont get this happening in future.
I'll also add the point for those who did this on production. If you change the inheritance between document types and get this error just change the inheritance back as it was and the error disappears.
I've now got some crazy things going on where the AllowedChildNodeTypes are not getting set on the structure so im starting over to see if i still have the error before looking at it any more. Not got a lot done today :(
I've got the same error on Umbraco 6.1.1 and latest uSitebuilder build.
It started to appear after changing inheritance structure in one of doctypes.
I've deleted all content nodes and doctypes, but when attempting to sync - error comes up again.
I've even checked all db tables for any references to deleted doctypes/content - nothing there.
After debugging uSitebuilder source, it seems that newly created doctype is not saved properly before getting it by alias - method throws an exception as there is no doctype for that alias ("No node exists with id '0' "). Tried passing unexisting doctype alias to that function and got same exception. Code causing this:
// refresh document type to load tabs again contentType = ContentType.GetByAlias(contentType.Alias);
Can't think of any relation between changing doctype inheritance and this exception. What's even more weird, is that this exception is being thrown on doctype which wasn't changed.
I think this is uSitebuilder issue and should be fixed.
As much as i loved uSitebuilder ive completely stopped using it because its just not there yet for v6 and thats the version i want to be using.
I know that a code first option is being looked at going forward but that could be a while yet - so im back to using the backend for creating my doc types for now.
Got the same problem whilst adding Alias = "Lorem Ipsum" to a document type. Reverted back to not using Alias and it works again.
Im also working towards a empty DB at them moment, but i got loads of copies of the document type. Deleting them and running the sync again wasn't a problem... For me.
When I just tried this on an Umbraco 6-site I got a lot of these:
[ArgumentException: No node exists with id '0']
I tried lots of stuff but for me it boiled down to having to set the "Alias" (in the attribute) to exactly the same as the name of my class.
It seems like it's sometimes using the "Alias"-property to get the content type name and sometimes the class name.
After making sure that they had exactly the same value/name - it just worked =D
Edit: One more thing, I'm not sure but it also looked like having the backoffice opened (the "logout check" is running) at the same time as reloading the front end could fire two instances of the "sync service" - which also created some interesting errors.
No node exists with id '0' when trying to add a document type
Had this issue all morning and cant nail what is causing it.
I have a few document types defined and ive stripped them right back to all that work fine but when I add a new type with just a string property for example i get the error below.
To make it even odder if i remove all the properties and just create the type it adds it. Then if i add a property to the class, rebuild and run it adds ok. If I then delete the entire content type object from umbraco and restart the app pool so it recreates, it then falls over again with the same error! ??? Odd.
Any ideas cos its driving me nuts and im going knowhere, About to ditch uSitebuilder shortly.
No node exists with id '0'
Damian, this is issue is not related with the uSiteBuilder. If you try to create the document manually (through browser) you'd get the same error. The problem is that you probably changed the inheritance between document types which Umbraco does not handle very well. Actually you cannot do it through browser at all (change inheritance) but it can be done through uSiteBuilder (but I wouldn't recommend to do it).
Thanks for the info Vladan.
I do seem to remember changing the inheritance on one of the document types.
Rather a scary issue if this was done on a mature site. Lucky ive hit this issue right at the start of a fresh site. Phew.
I have been trying to find what the issue was by changing the Name= property on the document type and it worked. Soon as i changed the name it broke again. Completely random!
Whats the solution? Do i have to delete doc types from umbraco and give my types new names? Or is the deployment junked and im better off starting a fresh?
I've gotten it working then removed the offending doc types and then recreated manually in umbraco without an issue.
I recreated the doc type in umbraco, rebuilt my doctypes dll, copied in etc... and restarted the app and all ok.
Removed the doc types from umbraco, restarted the app and the doc type was then recreated fine (that wouldnt create before).
Removed the doc type again, restarted and it all came back fine.
So it looks to me like if you need to change anything about a type - its alias, name, inheritance scheme etc.. Make sure you remove it from umbraco manually before putting in the new dll. Then, when it rebuilds it doesnt get confused with the old type.
Will see how i go with this and report back. Want to make sure i dont get this happening in future.
Of course that's the easiest way out but very often that's not possible as by deleting document types you also delete the content.
Luckily i've no content at this point! :)
I'll also add the point for those who did this on production. If you change the inheritance between document types and get this error just change the inheritance back as it was and the error disappears.
I've now got some crazy things going on where the AllowedChildNodeTypes are not getting set on the structure so im starting over to see if i still have the error before looking at it any more. Not got a lot done today :(
I've got the same error on Umbraco 6.1.1 and latest uSitebuilder build.
It started to appear after changing inheritance structure in one of doctypes.
I've deleted all content nodes and doctypes, but when attempting to sync - error comes up again.
I've even checked all db tables for any references to deleted doctypes/content - nothing there.
After debugging uSitebuilder source, it seems that newly created doctype is not saved properly before getting it by alias - method throws an exception as there is no doctype for that alias ("No node exists with id '0' "). Tried passing unexisting doctype alias to that function and got same exception. Code causing this:
Can't think of any relation between changing doctype inheritance and this exception. What's even more weird, is that this exception is being thrown on doctype which wasn't changed.
I think this is uSitebuilder issue and should be fixed.
Possible reference to related problem: http://allan-laustsen.blogspot.com/2012/03/umbraco-no-node-exists-cmscontentxml.html
As much as i loved uSitebuilder ive completely stopped using it because its just not there yet for v6 and thats the version i want to be using.
I know that a code first option is being looked at going forward but that could be a while yet - so im back to using the backend for creating my doc types for now.
Got the same problem whilst adding Alias = "Lorem Ipsum" to a document type.
Reverted back to not using Alias and it works again.
Im also working towards a empty DB at them moment, but i got loads of copies of the document type. Deleting them and running the sync again wasn't a problem...
For me.
... using Umbraco 6.1.2 and uSiteBuilder 1.2.5
Hi!
When I just tried this on an Umbraco 6-site I got a lot of these:
I tried lots of stuff but for me it boiled down to having to set the "Alias" (in the attribute) to exactly the same as the name of my class.
It seems like it's sometimes using the "Alias"-property to get the content type name and sometimes the class name.
After making sure that they had exactly the same value/name - it just worked =D
Edit: One more thing, I'm not sure but it also looked like having the backoffice opened (the "logout check" is running) at the same time as reloading the front end could fire two instances of the "sync service" - which also created some interesting errors.
is working on a reply...