Service Unavailable when post submit...

Topics: ASP.NET 2.0, Business Logic Layer
Feb 24, 2009 at 10:14 PM
Hello everyone, I have a problem with my blog. Everytime i try to submit a blog post that is kind of long... it gives me the error that the service is unavailable.
I am not sure how to fix this but any help is appreciated....

Here is a blog post that I currently made but it won't submit:

<p>
Tweet Tweet Tweet!! Dave Ryder has come up with a great song
for twitter called &ldquo;Tweetaholic&rdquo; for Chris Pirillo. Not too long ago, around
February 16th. Chris made a video asking everyone to make a music
video for the song. So here it is. Our music video!!
</p>
<p>
You can download the song from here:
</p>
<p>
<a href="http://daveryder.com/" target="_blank" title="http://daveryder.com">http://daveryder.com</a>
</p>
<p>
Music Video:
</p>
<p>
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/5G9_QN50AAo&hl=en&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5G9_QN50AAo&hl=en&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>
</p>

Yet here is one that I had to submit afterward, and it worked fine:


<p>
We are sorry, but our blogging system still isn&#39;t acting correctly. We are using blogengine.net for our main system, yet we are still having problems posting data up to the server by Http protocal. We are hoping to get this fixed durring the next few weeks, if we are not able to we will be switching blogging platforms. Even though this platform has done so well in the past. We are sorry and hope that you hang in there for a few more weeks till we get this dispeakable bug gone for good.
</p>
<p>
&nbsp;&quot;Thank You&quot; CEO
</p>


Any help is appreciated.
The web site URL for the blog is

http://100wpd.com/blog


Coordinator
Feb 24, 2009 at 10:53 PM
Are you submitting your blog post thru the Add Entry tab in the control panel?  Or are you using Windows Live Writer (WLW)?

It looks like you're using BE 1.4.5.  One problem with the WYSIWYG editor in BE 1.4.5 is that it usually will strip out <object> tags.  The latest build of BE is using a newer version of the WYSIWYG editor which doesn't do that.  If you were to use WLW to submit your blog post, WLW won't strip out the <object> tag.

In BE 1.4.5, I was able to copy and paste your first block of HTML with the <object> tag into the WYSIWYG editor.  It strips the <object> tag out when saving it, but the post does get saved (no service unavailable messages).

Can you submit that first block of HTML without the <object> tag and not get any errors?  I wonder if it's because of the <object> or <embed> tags being in there that causes the error.
Coordinator
Feb 24, 2009 at 11:02 PM
There's also a possibility that the Service Unavailable error message could be the result of a temporary problem on the web server you're blog is on.  Here's someone else who was getting Service Unavailable before (not much information, but ...)
Feb 24, 2009 at 11:24 PM
BenAmada: It allowed me to post the blog and very quickly with out the object and embeded code. But is there a way I can submit the blog post with the embeded code? If so how (if you know, all is appreciated)?

Thank you for such a quick reply.

-Taylor Brazelton(Ryanb58)-
http://100wpd.com
Coordinator
Feb 24, 2009 at 11:42 PM
If you used Windows Live Writer, you could do it.  A lot of people here like WLW as an alternative means to do blog posts.

Otherwise, if you want to stick with BE's WYSIWYG interface, here's something you can do (I just tried this and it works) ...

In the tinyMCE.ascx file in your "admin" folder, you'll see the line below.  Your line won't have the bolded part, but if you add the bolded part, then tinyMCE won't strip out the <object>, <embed> or <param> tags.  I don't know if this would eliminate the Service Unavailable error, though.

      extended_valid_elements : "object[width|height],embed[src|type|allowscriptaccess|allowfullscreen|width|height],param[name|value],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],script[charset|defer|language|src|type],code,iframe[src|width|height|frameborder|name|style]",
Feb 25, 2009 at 12:36 AM
It didn't work, I did exactly what you told me but I still got the error Service Unavailable... :(
And when I try to post from WLW i keep getting a error of it not being able to connect :(!!

Bye the way my hosting provider is http://re-invent.net... they set the blogging application up for me... well as a application Im guessing windows server 2008 with IIS 7.0... but Im not for sure...
Coordinator
Feb 25, 2009 at 12:46 AM
There's a few ways to set up an account within WLW.  Here's some instructions just for BE.  You could see if the instructions help in setting up an account within WLW.
Feb 25, 2009 at 6:03 PM
Edited Feb 26, 2009 at 8:22 PM

Ben

I am getting this message now when you click the rss link on blog..

It was working yesterday…

My site RSS

the rss subscribe link at top of site now creates this error message…

 

I don’t understand what happened..? can you help please….

Specified argument was out of the range of valid values.
Parameter name: utcDate

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate

 

From: BenAmada

There's a few ways to set up an account within WLW. Here's some instructions just for BE. You could see if the instructions help in setting up an account within WLW.

Coordinator
Feb 25, 2009 at 6:12 PM
willweb: This happens when the "last modified date" of a post is greater than the current date/time on the server.

Typically this wouldn't happen.  It can happen though if you created/modified a post on a different machine where it's in a different time zone than the other machine.  For instance, if you're using the XML provider, and you create a post on one machine and copy that XML file to another machine.  Or you're using the SQL Server provider, and you're sharing the database between two different machines (like your local machine and the live server).

These types of situations you would want to avoid.  Eventually when the server time passes the last modified date of the post(s) with last modified dates in the future, this error will disappear.  You could also directly modify the last modified date in the data store (xml or sql) and re-start your application to get the error to disappear right away.
Feb 26, 2009 at 2:00 PM
Thank you BenAmada. I figured it out, I am just going to use the extension to post youtube videos, and other videos. Thank you!!:)!!
Feb 26, 2009 at 5:00 PM
Edited Feb 26, 2009 at 8:17 PM

I deleted the last article and the error goes away the RSS feed page works

But if I enter any new add pages the error returns..

I waited over night…and today I entered a new page and error happens again…..you say wwait and soon the time will catch up…but how much time will pass for this…? Years..

I have to post content every few days…

Help…please…

Again after delete and is ok…then I post today error returns for rss link

I have not changed any core files…how can this be happening..Godady server time has been changed..?

Server Error


Specified argument was out of the range of valid values.
Parameter name: utcDate

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate

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.



From: BenAmada

willweb: This happens when the "last modified date" of a post is greater than the current date/time on the server.

Typically this wouldn't happen. It can happen though if you created/modified a post on a different machine where it's in a different time zone than the other machine. For instance, if you're using the XML provider, and you create a post on one machine and copy that XML file to another machine. Or you're using the SQL Server provider, and you're sharing the database between two different machines (like your local machine and the live server).

These types of situations you would want to avoid. Eventually when the server time passes the last modified date of the post(s) with last modified dates in the future, this error will disappear. You could also directly modify the last modified date in the data store (xml or sql) and re-start your application to get the error to disappear right away.

Coordinator
Feb 26, 2009 at 5:28 PM
Edited Mar 17, 2009 at 6:04 PM
willweb: So you're blog is at GoDaddy.  Are you adding new blog posts on the Add Entry tab in the control panel?  And if so, are you adding the blog post at your website?  Are you using Windows Live Writer (which I don't think should make a difference, but you never know).

Are you using SQL Server to store the posts, or XML files?  If you're using SQL Server at GoDaddy, if you go into their Query Analyzer online tool, you can run the query below to see what the most recent "DateModified" value is.

select DateModified, *
from be_Posts
order by 1 desc

If you're using XML files to store the posts, then just open up the most recently modified XML file under App_Data\posts and see what the <lastModified> value is.

GoDaddy's servers are in Arizona, and the last modified date shouldn't be larger than the current date/time of the time in Arizona.  If it is, then this error occurs when viewing the RSS feed.

We want to determine how and why these posts are getting a "future" last modified timestamp.

Yesterday, I just wrote up a code workaround in this issue to stop this error from happening.  The change involves making a small change to a BE core file, then re-compiling the core.  If you're familiar with this process, you're welcome to do that which would eliminate these errors.  Although, it's still probably best to figure out how these posts are getting last modified timestamps in the future.
Feb 26, 2009 at 5:38 PM
Edited Feb 26, 2009 at 8:25 PM

From: BenAmada

Are you adding new blog posts on the Add Entry tab in the control panel? Yes And if so, are you adding the blog post on your website at ? Yes Are you using Windows Live Writer (which I don't think should make a difference, but you never know). NO

Are you using SQL Server Yes to store the posts, or XML files? If you're using SQL Server at GoDaddy, if you go into their Query Analyzer online tool, you can run the query below to see what the most recent "DateModified" value is. OK ill try this

select DateModified, *
from be_Posts
order by 1 desc

If you're using XML files to store the posts, No then just open up the most recently modified XML file under App_Data\posts and see what the <lastModified> value is.

 and the last modified date shouldn't be larger than the current date/time of the time in Arizona. If it is, then this error occurs when viewing the RSS feed.

We want to determine how and why these posts are getting a "future" last modified timestamp. Yea..only changes since was working fine…was two people submitted comments and that’s it…


Yesterday, I just wrote up a code workaround in this issue to stop this error from happening. The change involves making a small change to a BE core file, then re-compiling the core. If you're familiar with this process, you're welcome to do that which would eliminate these errors. Although, it's still probably best to figure out how these posts are getting last modified timestamps in the future.

Feb 26, 2009 at 5:52 PM
Edited Feb 26, 2009 at 8:26 PM

If you're using XML files to store the posts, then just open up the most recently modified XML file under App_Data\posts and see what the <lastModified> value is.

Here is bottom lines of code form this post folder file

I think the xml is not being used..i am using sql to store…

<ispublished>True</ispublished>

<iscommentsenabled>True</iscommentsenabled>

<pubDate>2008-06-29 00:00:00</pubDate>

<lastModified>2008-07-29 19:20:01</lastModified>

<raters>3</raters>

<rating>4.4</rating>

<slug>Welcome-to-BlogEngineNET-1-4</slug>

<tags>

<tag>blog</tag>

<tag>welcome</tag>

</tags>

<comments />

<categories>

<category>19770e74-9ec9-4cde-b2ab-e5051aaaf348</category>

</categories>

<notifications />

</post>

Coordinator
Feb 26, 2009 at 6:04 PM
willweb: Yes, that XML file is the default "Welcome to BlogEngine.NET" post that came with BlogEngine.NET.

I was looking at the BE code and I think I see the problem.  On the Settings tab in the control panel, you probably have a value in the "Server time offset" field, right?

This is causing the problem.  I'm going to write up an issue in the issue tracker for this.  I'll let you know once I've done that.

What I would do for now, if I was you, is modify the BE code to fix it so this doesn't happen again.  Have you done this before?  Do you have Visual Studio?  If you don't have Visual Studio, if you want, I can make the necessary change for you and give you an updated DLL file for your BIN directory.

Let me know what you'd like to do.  If you want to make the change yourself, the change you would want to make is the one I document in this issue.  There's actually going to be another code change I will write up in a new issue ... this change too will prevent this error from happening.
Feb 26, 2009 at 6:12 PM
Edited Feb 26, 2009 at 8:27 PM

I don’t have VB studio…it would be better if you give me updated DLL..

thanks

From: BenAmada

Yes, that XML file is the default "Welcome to BlogEngine.NET" post that came with BlogEngine.NET.

I was looking at the BE code and I think I see the problem. On the Settings tab in the control panel, you probably have a value in the "Server time offset" field, right?

This is causing the problem. I'm going to write up an issue in the issue tracker for this. I'll let you know once I've done that.

What I would do for now, if I was you, is modify the BE code to fix it so this doesn't happen again. Have you done this before? Do you have Visual Studio? If you don't have Visual Studio, if you want, I can make the necessary change for you and give you an updated DLL file for your BIN directory.

Let me know what you'd like to do. If you want to make the change yourself, the change you would want to make is the one I document in this issue. There's actually going to be another code change I will write up in a new issue ... this change too will prevent this error from happening.

Coordinator
Feb 26, 2009 at 6:29 PM
willweb: I'll send you an email with the updated DLL.

Also, for the solutions to this problem, instead of creating a new issue, I added the solutions in the same issue so they're all in one place.
Feb 26, 2009 at 7:06 PM
Edited Feb 26, 2009 at 8:29 PM

Yea I have a value in that box…can I change that, play with that number to see what works …and problem may go away…?

From: BenAmada

 Yes, that XML file is the default "Welcome to BlogEngine.NET" post that came with BlogEngine.NET.

I was looking at the BE code and I think I see the problem. On the Settings tab in the control panel, you probably have a value in the "Server time offset" field, right?

This is causing the problem. I'm going to write up an issue in the issue tracker for this. I'll let you know once I've done that.

What I would do for now, if I was you, is modify the BE code to fix it so this doesn't happen again. Have you done this before? Do you have Visual Studio? If you don't have Visual Studio, if you want, I can make the necessary change for you and give you an updated DLL file for your BIN directory.

Let me know what you'd like to do. If you want to make the change yourself, the change you would want to make is the one I document in this issue. There's actually going to be another code change I will write up in a new issue ... this change too will prevent this error from happening.

Feb 26, 2009 at 7:11 PM
Edited Feb 26, 2009 at 8:29 PM

I set it from 2 to -5 and this fixed it for now…I am going to play with the number little more to be closer to real time…

Thanks for your help…

Coordinator
Feb 26, 2009 at 7:12 PM
You can change the server time offset to 0 which would eliminate these errors from happening again.  The purpose of the server time offset is so the date/time of your posts that people see on your blog is the date/time where you are located (instead of the date/time of where the server is).  So your server is in AZ and if you're in NY, and you put in a server time offset of 2, then your posts will show NY time instead of AZ time.

I just sent you an email with a link to the updated DLL file.  You can either use that DLL file I sent you, or you can change the server time offset to 0.  Either way will work.  But, if you change the server time offset to 0, you might still get this error right at first.  But going forward, the error won't occur again.