Logon Error : IndexOutOfRangeException : Password

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
9/20/2010 2:01:30 AM
Gravatar
Total Posts 37

Logon Error : IndexOutOfRangeException : Password

Hi All,

One of my clients has a system failure over the weekend and we had to restore the servers (webserver and database). Everything is working perfectly EXCEPT for the login, registration etc page. The error logged is as follows:

2010-09-20 08:57:50,087 ERROR mojoPortal.Web.mojoBasePage - 192.168.51.181-en-GB - /Secure/Login.aspx
System.IndexOutOfRangeException: Password
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at System.Data.SqlClient.SqlDataReader.get_Item(String name)
   at mojoPortal.Business.SiteUser.GetUser(IDataReader reader)
   at mojoPortal.Business.SiteUser.GetUser(String loginInfo)
   at mojoPortal.Business.SiteUser..ctor(SiteSettings settings, String login)
   at mojoPortal.Web.UI.SiteLogin.SiteLogin_LoggingIn(Object sender, LoginCancelEventArgs e)
   at System.Web.UI.WebControls.Login.OnLoggingIn(LoginCancelEventArgs e)
   at System.Web.UI.WebControls.Login.AttemptLogin()
   at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2010-09-20 08:57:50,087 ERROR mojoPortal.Web.Global - 192.168.51.181-en-GB - /Secure/Login.aspx
System.IndexOutOfRangeException: Password
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at System.Data.SqlClient.SqlDataReader.get_Item(String name)
   at mojoPortal.Business.SiteUser.GetUser(IDataReader reader)
   at mojoPortal.Business.SiteUser.GetUser(String loginInfo)
   at mojoPortal.Business.SiteUser..ctor(SiteSettings settings, String login)
   at mojoPortal.Web.UI.SiteLogin.SiteLogin_LoggingIn(Object sender, LoginCancelEventArgs e)
   at System.Web.UI.WebControls.Login.OnLoggingIn(LoginCancelEventArgs e)
   at System.Web.UI.WebControls.Login.AttemptLogin()
   at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 

The message displayed in the browser is simply
We're sorry but a server error has occurred while trying to process your request. The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page. 

It works perfectly on my local development but fails on their server (using the same database). They are running Windows 2003 64 bit.

Any ideas what may be causing this issue? Im leaning to an IIS setting perhaps as everything else is the same on the dev box and their webserver.

Thanks

Adrian

9/20/2010 2:36:46 AM
Gravatar
Total Posts 37

Re: Logon Error : IndexOutOfRangeException : Password

Sorry all, my mistake. I did not actually have it set up to use the same database and ive just noticed that the live database had the password field name set as "Pwd" where as my local database it was "Password". Ive updated the live database accordingly and its working again.

Thanks

Adrian

3/26/2012 6:09:09 PM
Gravatar
Total Posts 3

Re: Logon Error : IndexOutOfRangeException : Password

Thank you so much for your post.  I don't know how it happened, but I too had to change servers and some how it did the same thing to me with the password vrs. Pwd thing.   I changed the Database to use Password and updated the stored procedures and all is good. Thank you for sharing this way back when.

3/26/2012 11:45:28 PM
Gravatar
Total Posts 37

Re: Logon Error : IndexOutOfRangeException : Password

Hi there, glad it helped and you are back up and running.

3/27/2012 7:02:23 AM
Gravatar
Total Posts 18439

Re: Logon Error : IndexOutOfRangeException : Password

I changed the Database to use Password and updated the stored procedures and all is good. Thank you for sharing this way back when.

You got it backwards, pwd is the correct field to use, password is a legacy field, the only reason that worked is because you are using some older version of mojoPortal, newer versions do not try to access the password field, but uses pwd instead. If you upgrade its probably going to be broken since you changed the stored procedures to use password. pwd is a larger field and our newer versions need it because we changed to stronger encryption that requires more space, password field is to small for the encryption we are using.

You must sign in to post in the forums. This thread is closed to new posts.