+1-888-365-2779
Try Now
More in this section

Forums / Deployment / SQL Permission required in Hosted Enviroment

SQL Permission required in Hosted Enviroment

7 posts, 0 answered
  1. Richard
    Richard avatar
    4 posts
    Registered:
    13 May 2008
    22 Aug 2009
    Link to this post
    Hi,

    I've just deployed a second site based on sitefinity for a customer of mine, it's running in a hosted enviroment, but I'm running into some troubles because of security in this enviroment.

    The SELECT permission was denied on the object 'sql_modules', database 'mssqlsystemresource', schema 'sys'.


    I do not think they'll be changing any security settings, what should i ask for? or are there any walkarounds to avoid this?




    Stack Trace:

    [SqlException (0x80131904): The SELECT permission was denied on the object 'sql_modules', database 'mssqlsystemresource', schema 'sys'.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
       System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
       System.Data.SqlClient.SqlDataReader.get_MetaData() +83
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
       System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
       System.Data.SqlClient.SqlCommand.ExecuteReader() +89
       Nolics.ORMapper.DataProviders.SqlServer2005StmtBuilder.HasProcedure(ObjectName procName) +174
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineCommandProcedure(OdbClassInfo dbclassInfo, SQLCrudOperations operation) +559
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineClass(OdbClassInfo dbClassInfo, EmitPhases phase) +197
       Nolics.ORMapper.DataProviders.SQLDataProvider.GetSchemaChanges(Boolean fRename) +797
       Nolics.ORMapper.Base.OdbDataProvider.Upgrade() +59
       Telerik.Cms.Data.DefaultProvider.Initialize(String name, NameValueCollection config) +396
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +673
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings) +91
       Telerik.ManagerBase`1.SetProvider(String providerName) +203
       Telerik.ManagerBase`1..ctor(String providerName) +89
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Cms.CmsWorkflowService..ctor() +26
       Telerik.Cms.CmsWorkflowService..cctor() +21
    
    [TypeInitializationException: The type initializer for 'Telerik.Cms.CmsWorkflowService' threw an exception.]
       Telerik.Cms.CmsWorkflowService.Initialize() +0
       Telerik.Cms.CmsManager.OnInitialized() +5
       Telerik.ManagerBase`1.Initialize() +505
       Telerik.ManagerBase`1..ctor(String providerName) +21
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Cms.Web.UrlHelper.Initialize(CmsHttpModule cmsModule) +38
       Telerik.Cms.Web.CmsHttpModule.Init(HttpApplication context) +86
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +406
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
       System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231
    
    [HttpException (0x80004005): The type initializer for 'Telerik.Cms.CmsWorkflowService' threw an exception.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
    
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    30 Sep 2016
    23 Aug 2009
    Link to this post
    Hello Richard,

    The user that you are using for connecting to the database  specified in the connectionstring node of project's web.config  is not granted access to the table. You should grant permissions to the user or put him in a SQL Server users collection which has the appropriate permissions.) It is s SQL SERVER side setting that is not controlled by Sitefinity.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Richard
    Richard avatar
    4 posts
    Registered:
    13 May 2008
    23 Aug 2009
    Link to this post
    I understand that this is a security issue, hover it's running in a hosted enviroment, so i do not have access to change user security (roles nor mappings) - is there a way around this? the user is trying to access tables within another sql database then the one i have created in the hosted enviroment, probably a sql server system database.

    What to do? or what security roles/access to ask for?



    Regards,
    Richard
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    20 Sep 2016
    26 Aug 2009
    Link to this post
    Hello Richard,

    From the stack trace, I see that there is an attempt from Sitefinity to upgrade your database:
    Nolics.ORMapper.Base.OdbDataProvider.Upgrade() +59
    This cannot happen in Medium trust and shared hosting. Do you have several projects attached to this database? If this is the case, please upgrade all instances of Sitefinity.

    You can download the project, then run it on your local computer. Once this is done, create a Generic Content item.

    Note that you cannot use Workflow in Medium trust environment - this is not supported. 

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Richard
    Richard avatar
    4 posts
    Registered:
    13 May 2008
    26 Aug 2009
    Link to this post
    this is a shared hosting, that we rent with a database under SQL Server 2005 - so i guess it'll not work at all then? and there is no way around it? or thing to ask the administrator about to configure?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    30 Sep 2016
    27 Aug 2009
    Link to this post
    Hello Richard,

    First you should configure your website on your local host. Then configure the project  in medium trust. Finally FTP the website to the public server.

    Before setting the trust level to medium, make sure you modify the application web.config file as
    described below:
    1. Disable page and module workflow *:

    <add connectionStringName="DefaultConnection" 
    allowPageHistory="false" 
    allowPageWorkflow="false" name="Sitefinity" 
    type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" /> 
    … 
    <add name="Generic_Content" visible="True" defaultMetaField="Name" 
    securityProviderName="" allowLocalization="False" 
    allowVersioning="True" allowWorkflow="false 
    … 
    <add name="News" visible="False" defaultMetaField="Title" 
    securityProviderName="" allowLocalization="true" 
    allowWorkflow="false" 
    … 
    <add name="Blogs" visible="False" defaultMetaField="Title" 
    applicationName="/Blogs" allowVersioning="True" 
    allowLocalization="False" localizationProviderName="" 
    allowWorkflow="false" 
    … 


    2. Disable health monitoring:

    <healthMonitoring enabled="false" heartbeatInterval="0"

    3. Make sure the following lines are commented out:

    <!--add name="SitefinityXml" securityProviderName="" 
    type="Telerik.Lists.Data.XmlProvider, Telerik.Lists.Data" 
    dataFile="~/App_Data/Lists.xml" visible="true" /--> 


    The Sitefinity module providers cannot get their database objects created in medium trust environment
    and you may get errors. To prevent this, you need to enforce database upgrade in full trust environment,
    in your local Web site. Creating at least one content item in each module before uploading the upgraded
    database to the production server and setting the trust level to medium will initialize all modules in the
    database. The Sitefinity Search service does not work in medium trust environment. RadMemoryOptimization requires ReflectionPermission in order to operate correctly. This means that
    in normal circumstances you will have to run your application with Full Trust permissions set, unless
    you create a custom security policy, which allows ReflectionPermission. If you are unable to set Full
    Trust or custom security policy, the solution is to put the Prometheus controls assembly in GAC.
    The Upload Control functionality is not available in medium trust environment. You need to upload the
    controls manually through the application web.config file. The upload of .ZIP files in the Images & Documents module is currently not possible in medium trust
    environment.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Freddy
    Freddy avatar
    3 posts
    Registered:
    18 May 2011
    22 Apr 2012
    Link to this post
    Dear , please help me with the attached issue , when taking a backup from the sitefinity content database , and deploying a new site and changing the dataconfig.config to work with the new database restored we got this issue ..
    Server Error in '/' Application.
     
    The SELECT permission was denied on the object 'DOMAINS', database 'mssqlsystemresource', schema 'INFORMATION_SCHEMA'.
     
    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: Telerik.OpenAccess.RT.sql.SQLException: The SELECT permission was denied on the object 'DOMAINS', database 'mssqlsystemresource', schema 'INFORMATION_SCHEMA'.
     
    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.
     
    Stack Trace:
     
     
    [SQLException: The SELECT permission was denied on the object 'DOMAINS', database 'mssqlsystemresource', schema 'INFORMATION_SCHEMA'.]
       Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql) +410
       OpenAccessRuntime.Relational.sql.MsSqlDriver.GetUDTs(Connection con) +176
       OpenAccessRuntime.Relational.sql.MsSqlDriver._getDBSchema(Connection con, ControlParams controlParams) +1376
       OpenAccessRuntime.Relational.sql.MsSqlDriver.getDBSchema(Connection con, ControlParams controlParams) +475
       OpenAccessRuntime.Relational.sql.SqlDriver.checkDDL(ICollection`1[] tables, Connection con, StreamWriter errors, StreamWriter fix, ControlParams controlParams, StreamWriter messages) +522
       OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase() +567
     
    [OpenAccessException: Telerik.OpenAccess.RT.sql.SQLException: The SELECT permission was denied on the object 'DOMAINS', database 'mssqlsystemresource', schema 'INFORMATION_SCHEMA'.]
       Telerik.Sitefinity.Data.OA.OpenAccessConnection.UpgradeDatabase(Database database) +309
       Telerik.Sitefinity.Data.OA.OpenAccessConnection.UpdateMetadata(MetadataSource metadataSource, String moduleName, List`1 dynamicTypesToRegister, IOpenAccessMetadataProvider provider) +2873
     
    [Exception: Unable to upgrade database schema metadataSource provided by 'Telerik.Sitefinity.Modules.GenericContent.Data.OpenAccessContentProvider': Telerik.OpenAccess.RT.sql.SQLException: The SELECT permission was denied on the object 'DOMAINS', database 'mssqlsystemresource', schema 'INFORMATION_SCHEMA'.]
       DynamicModule.ns.Wrapped_OpenAccessContentProvider_d706076243ff4a8d90457d11cb65f802.Initialize(String providerName, NameValueCollection config, Type managerType) +405
       Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager) +2005
       Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager) +74
       Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +510
       Telerik.Sitefinity.Modules.GenericContent.ContentManager..ctor() +25
     
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       Telerik.Sitefinity.Data.ManagerBase.GetManager(Type managerType, String providerName) +276
       Telerik.Sitefinity.Data.ManagerBase.TryGetMappedManager(Type itemType, String providerName, IManager& manager) +110
       Telerik.Sitefinity.Web.UI.FlatSelector.InitializeControls(GenericContainer container) +835
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +82
       System.Web.UI.Control.EnsureChildControls() +182
       System.Web.UI.Control.PreRenderRecursiveInternal() +60
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Control.PreRenderRecursiveInternal() +222
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4185
     
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Register for webinar
7 posts, 0 answered