<unsolicited praise> I've installed and been using UBlogsy in our Umbraco implementation for our customer. It's super easy and has been working great! </unsolicited praise>
Since we starting using URL rewriting, however, we've been running into errors when we publish a blog post AND when we comment on the blog. Here's the error when we publish from the CMS:
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.ArgumentNullException: Value cannot be null. Parameter name: attribute
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.
Sequence contains no elements 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.InvalidOperationException: Sequence contains no elements
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:
[InvalidOperationException: Sequence contains no elements] System.Linq.Enumerable.Single(IEnumerable`1 source) +379 uBlogsy.Web.usercontrols.uBlogsy.Contact.CreateComment() in D:\_PROJECTS\uBlogsy\Branches\1.32_bugs_search\uBlogsy
\uBlogsy\usercontrols\uBlogsy\Contact.ascx.cs:99 uBlogsy.Web.usercontrols.uBlogsy.Contact.btnSubmit_Click(Object sender, EventArgs e) in D:\_PROJECTS\uBlogsy\Branches
When I first create the post on the admin side, it'll create the page just fine (but no comment folder). As soon as I type content in the rte and publish, it errors out (see above).
If I reload the nodes and go back into the newly created post, it publishes fine - and the comments folder is there when I publish.
If I create a post and SAVE it doesn't error - as soon as I publish it, it throws the error. If I go back to that node and publish it again - it works!
I deleted the examine indexes... still throwing the error.
Hmm... Since it's crashing on re-indexing it sounds like somethign is out of wack with lucene/examine.
Try the following in exact order:
1. Stop your site, then delete your entire app_data/temp folder 2. Bump your config (add a space to the end of the web.config and save) 3. Restart IIS (or casini). 4. Log into umbraco 5. Republish from your root content node (publish all) - not the one that is called Content...the one directly under that
If that doesnt work...pelase answer the following...
What versions of umbraco and examine are you using?
Oh I missed some steps out of the last instructions...
Try the following in exact order:
1. Stop your site, then delete your entire app_data/temp folder 2. Delete /app_data/umbraco.config 4. Make sure that NOTHING in /app_data/ is read-only 5. Bump your config (add a space to the end of the web.config and save) 6. Restart IIS (or casini). 7. Log into umbraco 8. Republish from your root content node (publish all) - not the one that is called Content...the one directly under that
This basically covers all bases for 90% of umbraco publishing problems.
Check your folder permissions, stop isapi rewrite engine, check your urlrewritingnet configSource="config\UrlRewriting.config", choose umbracoUseDirectoryUrls" value="false" to true in your web.config and test this out. if this works than you could assume that it's something related to your rewrite settings.
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.
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:
[HttpException (0x80004005): Request timed out.]
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
The blog was installed and located at: www.example.com/company-blog/blog So posts would look like: www.example.com/company-blog/blog/2012/01/post-name
It was requested to clean/tidy up the url by removing "company-blog" so it would be: www.example.com/blog/2012/01/post-name How this was done (and how to undo it) is not clear. It's not invisible redirects. It's not an ISAPI_Rewrite in .htaccess. As best as it can be remembered it was something in an umbraco.config file.
Now as far as publishing. When you draft something (anything) in Umbraco it'll say "This item is not published" under the properties. When you publish an item it'll create the url written out (/blog/2012/01/post-name) as a link to the live page. In the problem mentioned that started this tread when you attempt to publish a blog post it causes a server error, it does save it so you can reload it, even though it is not published the text "This item is not published" is now a hashtag "#" with a link to www.example.com/umbraco/editContent.aspx?id=1234#
The second attempt to publish will publish the post, however the comment "folder" that is created under that post does not have a url as expected (/blog/2012/01/post-name/comments), it instead has a hashtag with the same link. It will not publish even if you try multiple times.
Additional info: On the RSS feed I noticed that the links it is generating are: www.example.com/company-blog/blog/2012/01/post-name while in the posts Properties and on the live site the url functions as: www.example.com/blog/2012/01/post-name
It is also worth noting that the extensions (.aspx) have been turned off in the config file, and when that broke the Author and Category landing pages, I then turned of the trailing slash for directories. That is why the above urls don't have any extensions or slashes. To troubleshoot this whole matter, I've played around with these with no effect on the publishing problem.
OK! Now that I've got the back story covered, my theory/question/request is this. Can it be assumed the problem is when you go to publish that the url attempted to be written is causing the server error. Since it is showing up differently in two different places both generated by Umbraco. And if so, has anybody got an idea how to either A) fix it as it now, or B) know how to undo what was done so I can see if it'll start working again.
I've looked long and hard at getting it back to the default url structure just to test it out, but with no luck.
Oh yeah, one more thing fwiw, the urls for Authors and Categories are www.example.com/company-blog?category=Blue%20Widgets So it only drops that part of the url with posts. That may help narrow down where the customization was done.
I stumbled on this post after getting the same ysod today - but it involved no packages, and I'm not using uBlogsy.
However, and based on what I've read this is pretty much the same of issue, I am intercepting the document publish event to automatically create year/month folders among other things. Nothing fancy.
This is how it started causing problems:
I'd create a root folder, say 'Category', which allowed a document type 'Voucher'.
Creating the Voucher was intercepted by the Document.New event.
Various tasks are performed, among which the date folders are created. This is extremely similar to nForum as most of the basis for the code for the date folders to do this is from there.
The document gets created fine. I fill in the details, then hit Publish. This is when I get the error about the Examine indexes.
Weirdly though, the document HAS published - reloading the nodes shows this and the document managed to update.
This is where it starts leaving clues. If I create a new Voucher in the same Category now, as the date folders already exist, the error no longer occurs.
These steps can easily be used to reproduce the problem. The only thing I could think of as to why it should error only on creation of a first document with new date folders would be if the document id or the path was wrong, causing it to crash. One of the last things the nforum date code does is call RefreshContent. I also did this, so took out that last statement and as I suspected it stops the error from occurring.
My hunch is that because the content is refreshed somehow the context is missing the update, so when Publish happens the null reference is happening (perhaps it's pointing to the old path before the node is moved?).
I'm almost certain the culprit is RefreshContent() - I've read elsewhere it's viewed as slightly 'evil' - and I had problems with it a few weeks back when deleting nodes using the permanent delete flag.
UBlogsy not playing nice with URL rewriting?
<unsolicited praise> I've installed and been using UBlogsy in our Umbraco implementation for our customer. It's super easy and has been working great! </unsolicited praise>
Since we starting using URL rewriting, however, we've been running into errors when we publish a blog post AND when we comment on the blog. Here's the error when we publish from the CMS:
******************************************************************************************************************************
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.ArgumentNullException: Value cannot be null.
Parameter name: attribute
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:
[ArgumentNullException: Value cannot be null.
Parameter name: attribute]
System.Xml.Linq.XAttribute.op_Explicit(XAttribute attribute) +162326
UmbracoExamine.UmbracoContentIndexer.ReIndexNode(XElement node, String type) +193
Examine.ExamineManager._ReIndexNode(XElement node, String type, IEnumerable`1 providers) +93
umbraco.DocumentCacheEventHandler.Invoke(Document sender, DocumentCacheEventArgs e) +0
umbraco.content.UpdateDocumentCache(Document d) +1112
umbraco.library.UpdateDocumentCache(Int32 DocumentId) +122
uHelpsy.Core.UmbracoAPIHelper.UpdateContentNode(Document doc, Dictionary`2 properties, Boolean publish) +221
uHelpsy.Core.UmbracoAPIHelper.CreateContentNode(String nodeName, String nodeTypeAlias, Dictionary`2 properties, Int32 parentId, Boolean publish) +206
uBlogsy.Web.Extensions.UmbracoExtensions.Document_AfterPublish(Document sender, PublishEventArgs e) in D:\_PROJECTS\uBlogsy\Branches\1.32_bugs_search\uBlogsy\uBlogsy\Extensions\UmbracoExtensions.cs:118
umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) +1578
umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +414
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
*********************************************************************************************************************
And here's the error when we post a comment on the client side:
*********************************************************************************************************************
Sequence contains no elements
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.InvalidOperationException: Sequence contains no elements
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:
[InvalidOperationException: Sequence contains no elements]
System.Linq.Enumerable.Single(IEnumerable`1 source) +379
uBlogsy.Web.usercontrols.uBlogsy.Contact.CreateComment() in D:\_PROJECTS\uBlogsy\Branches\1.32_bugs_search\uBlogsy
\uBlogsy\usercontrols\uBlogsy\Contact.ascx.cs:99
uBlogsy.Web.usercontrols.uBlogsy.Contact.btnSubmit_Click(Object sender, EventArgs e) in D:\_PROJECTS\uBlogsy\Branches
\1.32_bugs_search\uBlogsy\uBlogsy\usercontrols\uBlogsy\Contact.ascx.cs:60
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3691
*********************************************************************************************************************
Any insight would be helpful!
Hey Kevin
I think the problem is with the comments folder.
On publish of a post, a comments folder is created. If this does not exist then a comment will fail.
I don't know what url rewriting would have to do with this though.
What version of uBlogsy are you running?
How many instances of the uBlogsy landing node are there?
What does your content tree look like?
As far as URL rewriting have an affect - you are correct, it has nothing to do with it since I tested that AFTER I posted - sorry! :-)
I have 1.32 - could it be that 1.33 fixes this? If so, what's the best way to update my version without blowing out all of my content, templates, etc.
We're just running one instance of UBlogsy in the site.
Hmmm
Can you confirm that the comments folder is created and that there is only one of them.
Did you install any package that does anything on the before/after publish event?
On second examination of your stack trace it seems that examine indexing is crashing. Try deleting your examine indexes.
As far as upgrading, just copy the dll. Nothing else has changed. I'm not sure if it will fix your problem but give it a try.
I'm likely asking a question with an obvious answer but I'm still helplessly new at Umbraco. Any hint as to where the comments folder is created?
The only other package installed is Full Text Search which I can't imagine is affecting anything...
...and last, where would I look for the examine indexes?
Thanks for your help!
Comments is not an acutal folder.
Under the new blogpost node there should be a node called comments node created when you hit publish.
Your examine indexes are in your app_data folder (on the file system). There are 2 examine folders. One under app_data, one under app_data/temp/.
Delete the one under app_data/temp/
When I first create the post on the admin side, it'll create the page just fine (but no comment folder). As soon as I type content in the rte and publish, it errors out (see above).
If I reload the nodes and go back into the newly created post, it publishes fine - and the comments folder is there when I publish.
If I create a post and SAVE it doesn't error - as soon as I publish it, it throws the error. If I go back to that node and publish it again - it works!
I deleted the examine indexes... still throwing the error.
Hmm... Since it's crashing on re-indexing it sounds like somethign is out of wack with lucene/examine.
Try the following in exact order:
1. Stop your site, then delete your entire app_data/temp folder
2. Bump your config (add a space to the end of the web.config and save)
3. Restart IIS (or casini).
4. Log into umbraco
5. Republish from your root content node (publish all) - not the one that is called Content...the one directly under that
If that doesnt work...pelase answer the following...
What versions of umbraco and examine are you using?
Is this happening on localhost?
Are you running it on IIS or casini?
As far as the comment node being created - it appears to be (after it successfully publishes - see above).
I followed your instructions above and it is still erroring when I publish the first time.
1. Umbraco v4.7
2. Not sure how to determine Examine
3. This is on a staging server: Server 2008 running IIS7, .Net v4
Oh I missed some steps out of the last instructions...
Try the following in exact order:
1. Stop your site, then delete your entire app_data/temp folder
2. Delete /app_data/umbraco.config
4. Make sure that NOTHING in /app_data/ is read-only
5. Bump your config (add a space to the end of the web.config and save)
6. Restart IIS (or casini).
7. Log into umbraco
8. Republish from your root content node (publish all) - not the one that is called Content...the one directly under that
This basically covers all bases for 90% of umbraco publishing problems.
*fingers crossed*
Hmhmhm. Republish should do the trick, if not.
Check your folder permissions, stop isapi rewrite engine, check your urlrewritingnet configSource="config\UrlRewriting.config", choose umbracoUseDirectoryUrls" value="false" to true in your web.config and test this out. if this works than you could assume that it's something related to your rewrite settings.
Thanks Toni, we've already determined that URL re-writing wasn't the culprit here... it happens to be a publishing problem. :-)
Sorry for the misleading title!
I've tried the 8 step program with no success. :-(
Something new is happening, however, when I follow your steps - it's now erroring when I publish the node and sub-pages.
I'll post the error I'm getting next...
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.Web.HttpException: Request timed out.
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:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
hmmm...request timeout. That is something entirely different.
Are you on a load balanced environment?
Single server... no load balancing. Could you give me some guidence on updating the dll? Maybe we could try that?
Hey Kevin did you ever resolve this issue?
Not yet. I've got some more information that may be helpful. I need to pull it together and I'll post it shortly.
Hi, we had the same ysod on our site which my colleague managed to fix.
Posted the solution here http://our.umbraco.org/projects/starter-kits/ublogsy/ublogsy-bugs/23212-Error-when-publishing-posts
New insight on this problem.
The blog was installed and located at: www.example.com/company-blog/blog
So posts would look like: www.example.com/company-blog/blog/2012/01/post-name
It was requested to clean/tidy up the url by removing "company-blog" so it would be: www.example.com/blog/2012/01/post-name
How this was done (and how to undo it) is not clear. It's not invisible redirects. It's not an ISAPI_Rewrite in .htaccess. As best as it can be remembered it was something in an umbraco.config file.
Now as far as publishing. When you draft something (anything) in Umbraco it'll say "This item is not published" under the properties. When you publish an item it'll create the url written out (/blog/2012/01/post-name) as a link to the live page. In the problem mentioned that started this tread when you attempt to publish a blog post it causes a server error, it does save it so you can reload it, even though it is not published the text "This item is not published" is now a hashtag "#" with a link to www.example.com/umbraco/editContent.aspx?id=1234#
The second attempt to publish will publish the post, however the comment "folder" that is created under that post does not have a url as expected (/blog/2012/01/post-name/comments), it instead has a hashtag with the same link. It will not publish even if you try multiple times.
Additional info: On the RSS feed I noticed that the links it is generating are:
www.example.com/company-blog/blog/2012/01/post-name
while in the posts Properties and on the live site the url functions as:
www.example.com/blog/2012/01/post-name
It is also worth noting that the extensions (.aspx) have been turned off in the config file, and when that broke the Author and Category landing pages, I then turned of the trailing slash for directories. That is why the above urls don't have any extensions or slashes. To troubleshoot this whole matter, I've played around with these with no effect on the publishing problem.
OK! Now that I've got the back story covered, my theory/question/request is this. Can it be assumed the problem is when you go to publish that the url attempted to be written is causing the server error. Since it is showing up differently in two different places both generated by Umbraco. And if so, has anybody got an idea how to either A) fix it as it now, or B) know how to undo what was done so I can see if it'll start working again.
I've looked long and hard at getting it back to the default url structure just to test it out, but with no luck.
Oh yeah, one more thing fwiw, the urls for Authors and Categories are www.example.com/company-blog?category=Blue%20Widgets
So it only drops that part of the url with posts. That may help narrow down where the customization was done.
Hi,
I stumbled on this post after getting the same ysod today - but it involved no packages, and I'm not using uBlogsy.
However, and based on what I've read this is pretty much the same of issue, I am intercepting the document publish event to automatically create year/month folders among other things. Nothing fancy.
This is how it started causing problems:
These steps can easily be used to reproduce the problem. The only thing I could think of as to why it should error only on creation of a first document with new date folders would be if the document id or the path was wrong, causing it to crash. One of the last things the nforum date code does is call RefreshContent. I also did this, so took out that last statement and as I suspected it stops the error from occurring.
My hunch is that because the content is refreshed somehow the context is missing the update, so when Publish happens the null reference is happening (perhaps it's pointing to the old path before the node is moved?).
I'm almost certain the culprit is RefreshContent() - I've read elsewhere it's viewed as slightly 'evil' - and I had problems with it a few weeks back when deleting nodes using the permanent delete flag.
Thought this might help if it's at all relevant!!
Tony
Possible that it might be the tags control?
Change the tag control to use the default umbraco tags and see if the crash is still there.
Hi Anthony
thanks for your quick reply. Blogs were working fine untill we moved it from old content Node to new One.
Do u think changing tags will help ?
I mean is there anything specific with Move operation that has resulted in this problem.
Cheers
Ah, I noticed you posted this in the other forum topic.
Moving nodes wont be a problem as long as the landing node is still the root of the uBlogsy tree.
Move it back to where it was to see if it still works.
What versions of Umbraco and uBlogsy are you using?
Hi Anthony
This is fixed now. The render control in the uTagsy Data type was not set somehow.
Once I selected the utagsy.ascx as the render control, its working fine now.
Thanks for all ur help.
is working on a reply...