Error publishing/deleting content from previously working install
Running 4.7.1 on IIS7 we've suddenly started getting an "Object reference not set to an instance of an object" error when publishing (at umbraco.cms.businesslogic.web.Document.ToXml). This site has been working fine until today. The only change has been the addition of a couple of new document types "News List" and "News Item".
The stack trace is below. We've tried deleting the umbraco.config file and that doesn't get recreated which then made us think it was a user permissions error but the permissions on the folder are right. What's really interesting is we can't delete the page either (we get the same object reference not set to an instance of an object).
Does anyone have any ideas on what might be causing it?
Thanks
Tim
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.cms.businesslogic.web.Document.ToXml(XmlDocument xd, Boolean Deep) +205
umbraco.content.PublishNodeDo(Document d, XmlDocument xmlContentCopy, Boolean updateSitemapProvider) +90
umbraco.content.UpdateDocumentCache(Document d) +484
umbraco.library.UpdateDocumentCache(Int32 DocumentId) +121
umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +540
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +186
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +164
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3706
SELECT * FROM umbracoNode, cmsContent --return nodes WHERE nodeObjectType ='C66BA18E-EAF3-4CFF-8A22-41B16D66A972'-- that are of type 'Content' AND umbracoNode.id NOT IN (SELECT nodeId FROM cmsContent)-- but are notin the 'Content' table
All I can think off is that your xml is malformed. Deleting umbraco.config should be first step, then browse /umbraco/dialogs/republish.aspx?xml=true and see what happens?
@Ian: Thanks I thought you might be onto something there but sadly that's not helped. There are properties on the parent doc types so there are input editors.
@Anthony: No ghosts sadly but good shout. We've deleted them and now none of the site publishes so I suspect it's not an issue with the data now...
@Dirk: That just reports success irritatingly, didn't think to hit it directly that's a good shout
In an attempt to resolve this we've spun up another install and oddly it will publish the site -but what's really bizarre is the perms are the same. I think something odd is going on with the permisisons somewhere.
Thanks all, we finally got to the bottom of the issue; it turns out one of the document types had a - in it's alias which broke the XML generation, turns out, relising the error of his ways, the dev renamed the document type's alias so it was hidden.
All good, lesson for today is don't include non-alphanumeric chars in the document type aliases!
Yes, our parent document types have -'s in the name but it was more that the alias had a - in it. Umbraco doesn't stip these when creating the XML and so, breaks.
I solved the problem already!. It turns out that this error was the alias of DocumentTypes. Ex: "Contact Us", the alias would be "ContactUs" worst I had as "Contact-Us", and that fucking script was the problem. What if someday encounter this you know!. Greetings friends!
Error publishing/deleting content from previously working install
Running 4.7.1 on IIS7 we've suddenly started getting an "Object reference not set to an instance of an object" error when publishing (at umbraco.cms.businesslogic.web.Document.ToXml). This site has been working fine until today. The only change has been the addition of a couple of new document types "News List" and "News Item".
The stack trace is below. We've tried deleting the umbraco.config file and that doesn't get recreated which then made us think it was a user permissions error but the permissions on the folder are right. What's really interesting is we can't delete the page either (we get the same object reference not set to an instance of an object).
Does anyone have any ideas on what might be causing it?
Thanks
Tim
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:
Tim,
You tried restarting the app pool?
Regards
Ismail
Sadly we have Ismail yep, even tried creating a new one :(
One other thing that might be worth noting is that there are no properties on the document type (I've seen the naming conventions conflict before).
The deletion is what's really bugging me...
Is it worth adding some properties to the document type?
Something in the back of my mind says I have seen this before, but I can't remember where or when.
I guess otherwise, it's get the umbraco source, and attach the debugger, see if you can step through the stack trace and find what hasn't been set..
Have you looked for ghost nodes?
All I can think off is that your xml is malformed. Deleting umbraco.config should be first step, then browse /umbraco/dialogs/republish.aspx?xml=true and see what happens?
Cheers,
/Dirk
Delete the new doc types or change the aliases and see if the problem remains.
@Ian: Thanks I thought you might be onto something there but sadly that's not helped. There are properties on the parent doc types so there are input editors.
@Anthony: No ghosts sadly but good shout. We've deleted them and now none of the site publishes so I suspect it's not an issue with the data now...
@Dirk: That just reports success irritatingly, didn't think to hit it directly that's a good shout
In an attempt to resolve this we've spun up another install and oddly it will publish the site -but what's really bizarre is the perms are the same. I think something odd is going on with the permisisons somewhere.
I'll update if we get further.
Did you delete or add any templates?
Doc types refer to templates and a missing one can cause a crash.
Thanks all, we finally got to the bottom of the issue; it turns out one of the document types had a - in it's alias which broke the XML generation, turns out, relising the error of his ways, the dev renamed the document type's alias so it was hidden.
All good, lesson for today is don't include non-alphanumeric chars in the document type aliases!
So the doctype was created with a "-", then renamed?
Yes, our parent document types have -'s in the name but it was more that the alias had a - in it. Umbraco doesn't stip these when creating the XML and so, breaks.
Thank you!. In reply I have solved the problem!
I solved the problem already!. It turns out that this error was the alias of DocumentTypes. Ex: "Contact Us", the alias would be "ContactUs" worst I had as "Contact-Us", and that fucking script was the problem. What if someday encounter this you know!. Greetings friends!
is working on a reply...