Could not find specified column in results: SiteID

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.
11/8/2011 11:51:56 PM
Gravatar
Total Posts 6

Could not find specified column in results: SiteID

Hi there, yesterday i have updated my mojoportal instance to:

mojoPortal Version 2.3.7.0 MySQL
Operating System Microsoft Windows NT 6.0.6002 Service Pack 2
ASP.NET Info v2.0.50727 Running in full trust

i have followed the upgrade procedure, replaced mysql dlls, the setup script run smoothly. I am hosting several sites on that instance based on folder names, and all the sites were working fine until now. Now if I try to open up these sites, i receive a message, which says: We're sorry but a server error has occurred while trying to process your request.....

in the system log i see: 
2011-11-09 06:37:39,210 ERROR (null) - (null) - (null) - mojoPortal.Web.Global -  Referrer(http://mysite.com/) useragent Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2
System.IndexOutOfRangeException: Could not find specified column in results: SiteID
   at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Is this a mojoportal bug, or an issue on my side? Any ideas how should i proceed further?

 

Thanks in advance for the answer, you really do a great job

Erik 

11/9/2011 6:21:34 AM
Gravatar
Total Posts 18439

Re: Could not find specified column in results: SiteID

Hi Eric,

It sounds like it failed to run at least one of the upgrade scripts.

What version did you upgrade from?

I would try uploading the Data dlls for MySql again.

Best,

Joe

11/9/2011 6:31:55 AM
Gravatar
Total Posts 6

Re: Could not find specified column in results: SiteID

Hmm. good question, Probably i can't tell it now exactly, i would need to contact the hosting company to restore the DB. I believe it was around 2.3.6.2. Are there suggestions what I could do to fix this issue?  The mysql.dll -s I have replaced already once again. I am thinking about making a fresh install on a VM test machine to see the table structure and compare with my one (i wouldnt want to lose the data). and maybe manually create missing coloumns if there are or so. Or if the data structure is backwards compatible, is it possible to switch back or downgrade to a former version?

11/9/2011 6:34:33 AM
Gravatar
Total Posts 6

Re: Could not find specified column in results: SiteID

Forgot in the previous post, I have upgraded from the previous version, because the HTML editor was not visible when i was trying to update HTML content.

11/9/2011 6:55:07 AM
Gravatar
Total Posts 18439

Re: Could not find specified column in results: SiteID

Its not about the MySql dll , make sure you have the mojoPortal.Data.dll and mojoPortal.Features.Data.dll and WebStore.Data.dll updated from the MySql data layer package and it must be the same version as the main mojoPortal package.

I've reviewed all the upgrade scripts from version 2.3.6.2 up to 2.3.7.0 and I don't see any place where SiteID is a new field.

Did you install our official packages or did you make your own build from source code?

11/9/2011 7:07:45 AM
Gravatar
Total Posts 6

Re: Could not find specified column in results: SiteID

I have replaced all dlls from this release: mojoportal-2-3-7-0-mysqldatalayer-GPL.zip. I have created custom builds (i have implemented a simplified settings dialog) but not DB changes, and i have switched to official releases a year ago cca, and yesterday i have uploaded this release: mojoportal-2-3-7-0-mssql-net35-deploymentfiles.zip, except the Data folder. I have also checked the update scripts, i have seen some places where SiteID is used, but only in older builds. I have also checked my DB structure for those older changes with SiteID, but it seems to be Ok - mp_SiteSettingsEx, mp_RedirectList.  Based on the callstack (mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e))  i have checked the source code, but i did not see something relevant for this error message. 

11/9/2011 7:32:37 AM
Gravatar
Total Posts 18439

Re: Could not find specified column in results: SiteID

I recommend redeploy the official package not your custom build and re-implement your custom dialog in your own project and do not fork the mojoPortal code nor compile your own code into the same dlls as mojoPortal.

I would make sure the mp_SiteFolders table has SiteID.

Maybe make a clean new installation and carefully compare the tables columns for each table one by one with your current installation. The error sounds like some table is missing the SiteID column, but it is not a column that has been added to any tables in a long time, maybe new tables have been created over time that include SiteID, but I can't think of any where we added it later after first creating a table without it.

The error stack does not really make it clear where the problem is happening. You could disabled 301 redirects and see if that solves it,  if it doesn't solve it then you can know that was not the problem but it can help by process of elimination

<add key="Disable301Redirector" value="true" />

That's about all the ideas I have. Hope it helps,

Joe

 

11/9/2011 7:39:58 AM
Gravatar
Total Posts 6

Re: Could not find specified column in results: SiteID

Thanks, tomorrow i will try these possibilities, and also debug remotely the app, maybe i can spot the place where it happens, anyhow, if i make progress i will send a post :) Thanks a lot for your time, i really like the portal

Regards

Erik

11/10/2011 3:32:00 PM
Gravatar
Total Posts 6

Re: Could not find specified column in results: SiteID

Hi Joe

I have identified the place where it breaks, it is here: mojoPortal.Data.MySQL/ DBSiteSettings.cs : 2058
 

sqlCommand.Append("SELECT COALESCE(s.SiteID, -1) ");
            sqlCommand.Append("FROM mp_SiteFolders sf ");
            sqlCommand.Append("JOIN mp_Sites s ");
            sqlCommand.Append("ON ");
            sqlCommand.Append("sf.SiteGuid = s.SiteGuid ");
            sqlCommand.Append("WHERE sf.FolderName = ?FolderName ");
            sqlCommand.Append("ORDER BY s.SiteID ");
            sqlCommand.Append(";");

            using (IDataReader reader = MySqlHelper.ExecuteReader(
                GetReadConnectionString(),
                sqlCommand.ToString(),
                arParams))
            {
                if (reader.Read())
                {
                    siteId = Convert.ToInt32(reader["SiteID"]);
                }

 

on the reader["SiteID"] row. unfortunately i am not good at SQL, but i have verified the mp_Sitefolders table, i have there the row for the website with a guid b2f...., in the mp_sites table i have a row with the same guid, the returned siteId should be 2. What is interesting, if i change the call to siteId = Convert.ToInt32(reader[0]);, i get siteId=2 back, which is correct. Do you have a tip what could be wrong?

Thanks

Erik

 

11/11/2011 8:47:09 AM
Gravatar
Total Posts 18439

Re: Could not find specified column in results: SiteID

Hi Erik,

Depending on MySql configuration table names may be changed to all lower case even though the scripts have them as mixed case, but column names should be in the correct case. I would make sure the column name is actually SiteID on the mp_Sites table.

Hope that helps,

Joe

12/17/2011 12:21:34 PM
Gravatar
Total Posts 87

Re: Could not find specified column in results: SiteID

Hi ,

I have similar problem. But my site works ok for first instance - SiteID=1, but when i try to go to Site 2 it gives me next errors

2011-12-17 17:55:30,496 ERROR (null) - (null) - (null) - mojoPortal.Web.Global - Referrer(none) useragent Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
System.IndexOutOfRangeException: Could not find specified column in results: SiteID
at MySql.Data.MySqlClient.ResultSet.GetOrdinal(String name)
at MySql.Data.MySqlClient.MySqlDataReader.GetOrdinal(String name)
at MySql.Data.MySqlClient.MySqlDataReader.get_Item(String name)
at mojoPortal.Data.DBSiteSettings.GetSiteIdByFolder(String folderName)
at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromCache()
at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromContext()
at mojoPortal.Web.SiteUtils.GetDefaultCulture()
at mojoPortal.Web.CultureHelperHttpModule.BeginRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2011-12-17 17:56:02,636 ERROR (null) - (null) - (null) - mojoPortal.Web.Global - Referrer(none) useragent Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
System.IndexOutOfRangeException: Could not find specified column in results: SiteID
at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

I checked mp_Sites and it's there.

I can't say when exactly it stopped working, 2 things happened recently:

1) i moved from one provider to another and this new provider has MySql locally on windows server, before this the Mysql was remotely on Unix version of MySql,

2) i've made upgrade of the portal to 2.3.7.0 MySQL vesrion

but this second subsite was not used and i never checked it after this two changes and can't say if it failed after move or after upgrade.

Any clues?

Regards,

Victor

 

 

12/17/2011 12:34:33 PM
Gravatar
Total Posts 87

Re: Could not find specified column in results: SiteID

one more thing - i tried to create new subsite (it is folder based) and it do not work too.

12/18/2011 10:37:40 AM
Gravatar
Total Posts 18439

Re: Could not find specified column in results: SiteID

Hi Sorvik,

I've just uploaded a patched MySql Data layer for version 2.3.7.5. If you download it again and replace mojoPortal.Data.dll with the new one it should solve it.

The solution was to change from this:

sqlCommand.Append("SELECT COALESCE(s.SiteID, -1) ");

to this:

sqlCommand.Append("SELECT COALESCE(s.SiteID, -1) AS SiteID ");

Thanks,

Joe

12/18/2011 2:02:06 PM
Gravatar
Total Posts 87

Re: Could not find specified column in results: SiteID

Thank you,

Now everything works

Regards,

Victor

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