Error trying to add entry

Topics: ASP.NET 2.0
Apr 8, 2010 at 2:00 PM
Edited Apr 8, 2010 at 7:11 PM

I am no longer able to add a new entry, Be 1.6.0.0, I am receiving this message. I have replaced the add_entry.aspx and made a change in the web.config to restart the blog without success.

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
í½`I–%&/mÊ{JõJ×àt¡€`$Ø�@ìÁˆÍæ’ìiG#)«*�ÊeVe]f@Ìí�¼÷Þ{ï½÷Þ{ï½÷º;�N'÷ßÿ?\fdlöÎJÚÉž!€ªÈ?~|?"~ãä7Nÿ®O¿|øP^ü(-³åÅgåË�Ðü‘ý‹�äÙ,-fŸ}4mË��ßÿÛôçîG骮΋2·p/«
†úî|yww÷££Ç‹¼ÍR|»�ÿ¢uqIïWË6_¶Ûíõ*ÿ(Õ¿>û¨Íßµw�Åa:�gu“·ŸÛóíƒ�Ò» d™-¨£YÞLëbÕÕÒ{ûºZש÷UzQåM:Ïë¼ûþÛüúªªgMçå‘ù|„7G±7³u;¯jï½ß�¾ ï¸eY,ߦ”ŽeÚPu^~öQÓ^—y3Ïóö£t^ççŸ}t·�狼¹›-guž5;ûÛONñÂ8{7û=¸7~ggwüéx‡þc`‹|VdnZçùrD¤ÿé|*t0ÝKw„e;]·i1ÅwÒãx|—þ·*¦ÍÝóìߌéŸ�áb‘]äwßmË-Ú2§iÿ±Óº®jšþ»æ“”žÇŒ]w°ú%ž17Øuüb÷+ž«bÖÎ¥{{{«w‡áW󼸘·�Òû÷‚¯~‰ö|—!ƒ!Ý€uBˆBŒäg×Óyq™[jgò÷8kVïºÄj³ºµ/¾®hŽóz™×Ūe–~»x[,/Ò“r=±Ðº³�Ve1Í0wëÙù'ï I Ìã`Ÿ}yb`xRØdói±<¯Xjš¢š‚6u‘åPÇ/¿x~Sxÿ¦>6 ãÙ—ÇÏnêâ¼ÊÎoì¢i¼.²²%²gm~«©H·^½~}çFb^/gÚËÕyU/²ö³¢´�¼mµø

 I also can not edit any entries.

Update:

I replaced the vista database from backup, lost a few entries, problem still exists, I can login ok but get the same error when trying to view users, profiles, etc., still cannot add or edit entries.

Thanks for your help.

 I believe the database is ok, I think it is the admin pages trying to read the database.  I have also replaced the entire admin folder without success correcting the error.

Help Ben!

Coordinator
Apr 9, 2010 at 12:43 AM

You get this error even just trying to View the profile for a user WITHOUT saving?  Or is it just when you are saving?

To better determine if this is a DB related error or a non-DB related error, you could try temporarily switching to the XmlBlogProvider.  There's 3 small changes to fully switch to XML.  These changes are in the web.config file.

<blogProvider defaultProvider="XmlBlogProvider">
<membership defaultProvider="XmlMembershipProvider">
<roleManager defaultProvider="XmlRoleProvider" ...... other stuff ......>

The top line controls the main blog provider, and then the other 2 lines are for the Membership and Role providers -- which can also be either Xml or Db.  I'm guessing you're using Db for all 3 of these.

Once you switch all 3 of these to XML, then try Adding a new Entry or anything else to see if you still get the error.

Apr 9, 2010 at 5:19 AM
Edited Apr 9, 2010 at 5:28 AM

Hi Ben.

I cannot view users, profiles or add an entry or edit an entry.  I can login ok.

I am now using DB for all.

I will try your suggestion to determine if it is a DB issue and report the findings.

Thank you.

 I switched the blogprovider to xml and the error still exists.

Coordinator
Apr 9, 2010 at 9:57 AM

Hmm... have you made any changes lately to any of the files or website (IIS) settings?  If so, I would be suspect of those changes.

I know you're using a custom blog theme (which is fine), but have you modified any other non-theme files including the BE core?  You might need to make a backup of what you have and then overwrite your files with the original BE 1.6 files ... but only if you've modified any of the non-theme files.

I'm sure your theme is fine since the theme doesn't have any role when you're in the admin area.

If you do overwrite your files with the original BE 1.6 files, the main two things to not overwrite would be the App_Data folder and the web.config file.

Wish I had more helpful information, but this is sort of bizarre.

Apr 9, 2010 at 1:34 PM
Edited Apr 9, 2010 at 3:48 PM

As the webmaster I receive info to post from board members of the club, I would login in as admin enter the info and then would select the board members name from the drop down user list as the member submitting the info.

Would this have anything to do with it.

I did change the themes postvieww file to read submitted by instead of author.

I replaced all the BE 1.6 files except the App_Data folder and the web.config and the error still exists, any ideas on what to try next to fix this?

Apr 9, 2010 at 4:00 PM

I replaced all the BE 1.6 files except the App_Data folder and the web.config and the error still exists, any ideas on what to try next to fix this?

Apr 9, 2010 at 6:39 PM
Edited Apr 9, 2010 at 7:00 PM

Ben,

This is the new error message I am now receiving when trying to view users, I can now view add entry and profiles without a problem, still cannot view users.aspx

http://www.sahcinfo.org/admin/Pages/Users.aspx

Raw Url : /admin/Pages/Users.aspx

Message : Exception of type 'System.Web.HttpUnhandledException' was thrown.

Source : System.Web

StackTrace : at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at ASP.admin_pages_users_aspx.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

TargetSite : Boolean HandleError(System.Exception)

Message : Object reference not set to an instance of an object.

Source : App_Web_v7aa5mkk

StackTrace : at ASP.admin_pages_users_aspx.__DataBind__control13(Object sender, EventArgs e)

at System.Web.UI.Control.OnDataBinding(EventArgs e)

at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)

at System.Web.UI.Control.DataBind()

at System.Web.UI.Control.DataBindChildren()

at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)

at System.Web.UI.Control.DataBind()

at System.Web.UI.Control.DataBindChildren()

at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)

at System.Web.UI.Control.DataBind()

at System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)

at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)

at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)

at System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data)

at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)

at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)

at System.Web.UI.WebControls.DataBoundControl.PerformSelect()

at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()

at System.Web.UI.WebControls.GridView.DataBind()

at admin_newuser.BindGrid()

at admin_newuser.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)

at System.Web.UI.Control.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

TargetSite : Void __DataBind__control13(System.Object, System.EventArgs)

Coordinator
Apr 9, 2010 at 8:03 PM

Did you do anything that now allows you to view Add Entry and view Profiles?  Or did that just start working when you re-installed BE 1.6?

Are you using a customized Users.aspx page?

In Users.aspx.cs, the RowDataBound event gets wired up in Page_Load:

gridUsers.RowDataBound += new GridViewRowEventHandler(gridUsers_RowDataBound);

I would try commenting that out to see if it fixes the error.  You could also try removing the OnLoad event handler in Users.aspx.  It looks like this:

OnLoad="gridUsers_Load"

Try temporarily deleting that.

Apr 9, 2010 at 9:32 PM
Edited Apr 9, 2010 at 9:42 PM

I found some duplicate users that I added in the database, after removing those the Add Entry, Edit Entry and Profile started working again.

I am not using a customized users.aspx page.

I commented your suggestion above, error still exists.

I also deleted OnLoad="gridUsers_Load" still get an error

Coordinator
Apr 9, 2010 at 10:07 PM

Duplicate users ... did those get in there thru the admin Users page?  Or were they entered directly in VistaDB?  I would have though that switching to the XML providers yesterday would have eliminated the errors if the duplicate data in VistaDB was causing some of these problems (since the XML file, users.xml, would presumably not have duplicate data in it)

The error is occurring when the users data is getting bound to the GridView.  I'm wondering now if there is still a problem with the users data.  I would make sure that each user the in DB has a unique UserName.  And make sure each user has a UserName and an Email Address (there are no NULL or empty values).   I can't remember if it's required, but it may be required that you don't have duplicate email addresses for users.

Apr 9, 2010 at 10:13 PM

I  entered directly though VistaDB. their are several null values in the email fields, I will fix those and see what happens.

Coordinator
Apr 9, 2010 at 10:22 PM

The NULL values I'm guessing are the problem.  If you update the data directly in VistaDB, you'll probably need to restart the blog for the updated data to get detected.

Apr 9, 2010 at 10:30 PM

Yes you are correct Ben, I entered the missing email address and all is well again.

I thought that I had reentered users in Vista after the problem first appeared and I had restored the database and had to replace the latest users I had entered though the website.

Do you think that this process that I use below could cause issues?

I login as admin and post info sent to me by board members and choose their username from the drop down list, is it looking for the name that is logged in and not someone elses?

Thank you again for your help.

Coordinator
Apr 9, 2010 at 10:57 PM

Good to hear things are back on track!

The process you have of selecting an 'Author' on the Add Entry tab seems good.  The dropdown list is populated with the Usernames.  It doesn't matter if that User is logged in, or has logged in, or will log in, etc.

Ideally, if you were to use the Users page in the control panel to add users, that would avoid possible data entry errors.  But if you prefer to enter users directly into VistaDB for some reason, then just make sure that the data is good -- no missing or duplicate usernames/email addresses.  And when you do enter data directly into VistaDB, you will probably need to restart the blog so that new data is detected by the blog.

Apr 14, 2010 at 2:35 PM

Ben,

Is there any way I can have this list of usernames appear alphabetically when selecting an Author for an entry?

Thank you.

Coordinator
Apr 15, 2010 at 3:20 AM

Fortunately, yes you can sort (guess you have a lot of users!).  In Add_entry.aspx.cs (in the admin/Pages folder), replace BindUsers() with this version:

private void BindUsers()
{
	System.Collections.Generic.List<MembershipUser> users =
		new System.Collections.Generic.List<MembershipUser>();

	foreach (MembershipUser user in Membership.GetAllUsers())
	{
		users.Add(user);
	}

	users.Sort(delegate(MembershipUser u1, MembershipUser u2)
		{ return u1.UserName.ToLower().CompareTo(u2.UserName.ToLower()); });

	foreach (MembershipUser user in users)
	{
		ddlAuthor.Items.Add(user.UserName);
	}
}

Apr 15, 2010 at 8:02 PM

Thank you Ben,

I hate to be a pest but when I try the above I get a bunch of red lines under a lot of the code, not sure what I am doing wrong.

Coordinator
Apr 15, 2010 at 9:26 PM

Red lines ... that mean's you're making these changes in Visual Studio?  If so, then you should see some error message below, or if you hit F5, it'll try to run and if it cannot compile, you should see an error message.  If you could paste the error message here.  Maybe also paste the code you have for BindUsers(), while including a little bit of code above and below BindUsers().

Apr 15, 2010 at 11:11 PM
Edited Apr 15, 2010 at 11:12 PM

It seems that I replaced the code in the incorrect place, I changed it and it is woriking great, thanks again for your help Ben.

 It sure is nice for non developers like myself to have help available.

Jul 15, 2010 at 9:29 PM

Ben Amada-

Sorry to continue on this post, but it was the closest thing I could find to my needs.

I have a fresh 1.6 install. When I log in with Admin and try to modify a part of the user profile - say just to extend comments to say "I love blogengine.net VERY VERY MUCH"... i get a 500 internal error.

We are running IIS 7.5 with Kerberos... AppData folder is Read, Execute, List, and Write for the identity running the app pool... at the file system level, I have made sure all files and sub folder files are no longer "read only"... not sure what else it might be... the only thing I have changed thus far is i turned off compress webresource.axd on your advanced settings tab as it was causing a "js.axd" error.

Any thoughts?

 

Coordinator
Jul 16, 2010 at 4:24 AM

For an internal 500 error, I would make a couple of changes to try and get real error details.

First, in your web.config file, I would change the custom errors tag so it looks like:

<customErrors mode="Off">

And then see if you get any real error details (by doing the same thing that is leading to an error).  If you still don't have error details, I would then try temporarily removing the Application_Error() code in the Global.asax file in the root folder.  That could possibly be interfering real error details from appearing.