Installation problem - EXECUTE permission on object 'mp_SchemaVersion_SelectOne'

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.
8/1/2008 2:00:37 PM
Gravatar
Total Posts 9

Installation problem - EXECUTE permission on object 'mp_SchemaVersion_SelectOne'

This is a new installation on a Hosted Web site with HostDepartment.  I set up a new MS SQL database and created a database login for that database. I added the connection information in web.config and now I get this error when running the intial setup/default.aspx page.  The page shows that the permissions are sufficient, but then I get this permission error.  I used this same user login when creating the database, so it should be the owner.

Any help would be appreciated.

Bernie

--------------

Welcome to mojoPortal Setup
Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.2.4.8 - 00:00:00.0937500

An Error Occurred:EXECUTE permission denied on object 'mp_SchemaVersion_SelectOne', database 'bernlaw_bvo', owner 'dbo'.
Source:.Net SqlClient Data Provider
Stack Trace at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at mojoPortal.Data.SqlHelper.ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters, SqlConnectionOwnership connectionOwnership) at mojoPortal.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.SchemaVersionGetSchemaVersion(Guid applicationId) at mojoPortal.Data.DBPortal.SchemaVersionExists(Guid applicationId) at mojoPortal.Business.DatabaseHelper.UpdateSchemaVersion(Guid applicationId, String applicationName, Int32 major, Int32 minor, Int32 build, Int32 revision) at mojoPortal.Web.UI.Pages.SetupHome.RunScripts(Guid applicationId, String applicationName, String pathToScriptFolder, Version versionToStopAt) at mojoPortal.Web.UI.Pages.SetupHome.CreateInitialSchema(String applicationName) at mojoPortal.Web.UI.Pages.SetupHome.RunSetup() at mojoPortal.Web.UI.Pages.SetupHome.Page_Load(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)

8/1/2008 3:38:06 PM
Gravatar
Total Posts 18439

Re: Installation problem - EXECUTE permission on object 'mp_SchemaVersion_SelectOne'

Hi,

I'm not entirely sure what going on there but one possibility is if your host doesn't let your db user be int the dbo (database owner) server role for your db. At most hosting places your db user will be owner of your database and the prefix [dbo]. is used in all the scripts when creating the db objects. So it seems like your db user was able to create the objects but then can't execture because it (the user) is apparently not dbo of the db.

I only know of one other person who has told me they encountered this issue at their host, and we added something to web.config that was able to solve it for that person. Yuo will see this setting in Web.config:

<add key="MSSQLOwnerPrefix" value="[dbo]." />

When scripts are executed, it will replace [dbo]. in the scripts with whatever is in this Web.config setting. I'm not sure if the other person was able to solve it by just changing it to empty string like this:

<add key="MSSQLOwnerPrefix" value="" />

or whether he put something else there like [yourdbusername]., but that is what I would try next is making it empty string. If possible I would try to delete all the existing tables and stored procs first (as apparently they were created and are owned by dbo), then make this change and try setup again. If empty string doesn't solve it I would delete everything again and try with your db user name

<add key="MSSQLOwnerPrefix" value="[yourdbusername]." />

Hope it helps,

Joe

8/1/2008 4:02:16 PM
Gravatar
Total Posts 9

Installing -System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid...

I changed the key as you suggested to:  <add key="MSSQLOwnerPrefix" value="" /> and dropped and recreated the db.  The install got further this time, but now is getting a different error.

I tried the second option you suggested, adding the username to the value but after recreating the db and going back to setup/default.aspx it said that the database persmissions weren't sufficient.  So I dropped the db, recreated it and changed it back to <add key="MSSQLOwnerPrefix" value="" /> and re-ran the setup.

  Here is the error message it's getting when Running script mojoportal-core - 2.2.6.0 - 00:00:16.0937500  (see below)

Bernie

 

Welcome to mojoPortal Setup
Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.2.4.8 - 00:00:00.4531250
Running script mojoportal-core - 2.2.4.9 - 00:00:15.8750000
Running script mojoportal-core - 2.2.5.0 - 00:00:15.9218750
Running script mojoportal-core - 2.2.5.1 - 00:00:16
Running script mojoportal-core - 2.2.5.2 - 00:00:16
Running script mojoportal-core - 2.2.5.3 - 00:00:16.0468750
Running script mojoportal-core - 2.2.5.4 - 00:00:16.0468750
Running script mojoportal-core - 2.2.5.5 - 00:00:16.0468750
Running script mojoportal-core - 2.2.5.6 - 00:00:16.0625000
Running script mojoportal-core - 2.2.5.7 - 00:00:16.0781250
Running script mojoportal-core - 2.2.5.8 - 00:00:16.0781250
Running script mojoportal-core - 2.2.5.9 - 00:00:16.0781250
Running script mojoportal-core - 2.2.6.0 - 00:00:16.0937500
System.Data.SqlClient.SqlException: The text, ntext, and image data types are invalid in this subquery or aggregate expression. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:16.1718750
Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.
 

8/1/2008 4:08:44 PM
Gravatar
Total Posts 18439

Re: Installation problem - EXECUTE permission on object 'mp_SchemaVersion_SelectOne'

Hi,

I think you must be using MS SQL 2000 rather than 2005. You can get past this error, if you chop this part out of the script:

UPDATE mp_ModuleSettings
SET RegexValidationExpression = (SELECT TOP 1 mds.RegexValidationExpression
                FROM mp_ModuleDefinitionSettings mds
                WHERE mds.ModuleDefId IN (SELECT ModuleDefId
                                        FROM mp_Modules m
                                        WHERE m.ModuleID = mp_ModuleSettings.ModuleID)
                AND mds.SettingName = mp_ModuleSettings.SettingName
                )

It won't hurt anything to chop that out. The script file is located under /Setup/applications/mojoportal-core/SchemaUpgradeScripts/mssql

The file is 2.2.6.0.config, look for the above statement and chop it out. Then visit the setup page again and it should be able to finish.

Hope it helps,

Joe

8/4/2008 9:27:04 AM
Gravatar
Total Posts 9

Re: Installation problem - EXECUTE permission on object 'mp_SchemaVersion_SelectOne'

Joe, that fixed my problem.

  I was able to finish creating the site.  Funny thing happened.., I changed the admin password and then logged back off and tried to get back on with the new password.  It wouldn't work.  After 5 attempts I was locked out.  Not sure what happened, unless I made a typo on changing the password.  Maybe in the future it should have two password input boxes to test for accidental typos.., but that's just a suggestion.  Since this was a new install, I just dropped the database and started over and this time created a second administrator first in case one got locked out again.

Thanks for your help on getting this set up.  I've run into another problem, but I'll start a new thread for that.

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