Problem with deploying SQL CE on ASPHostPortal

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.
3/2/2014 1:19:57 PM
Gravatar
Total Posts 2

Problem with deploying SQL CE on ASPHostPortal

Hi

My website is keep on moving to the Setup page.

The currentlog.config pointed something that had to do with COM permissions, so I've contacted them and it was fixed.

A couple of days later, the same problem. After few ping-pongs their help desk advised that for some reason the permissions are gone from time to time and perhaps something in the application causes it.

Don't think that matters, but while moving to ASPHostPortal, I have migrated the site from MySQL to the SQL CE version.

 

In my environment it works fine, whenever they give the permissions it works fine, I have double checked the web.config and it seems valid.

 

Thanks,

HW

 

ASPHostPortal's event log

The worker process for application pool {mydomain.com}(domain)(4.0)(pool) encountered an error Configuration file is not well-formed XML

A process serving application pool {mydomain.com}(domain)(4.0)(pool) exceeded time limits during start up. The process id was {#}.

currentlog.config

2014-03-02 12:52:46,570 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Application Started.
2014-03-02 12:52:46,601 ERROR (null) - (null) - (null) - mojoPortal.Web.WebTaskManager - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBTaskQueue.DeleteCompleted()
   at mojoPortal.Web.WebTaskManager.StartOrResumeTasks(Boolean appWasRestarted)
2014-03-02 12:52:46,617 ERROR (null) - (null) - (null) - mojoPortal.Web.BannedIPBlockingHttpModule - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress)
   at mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,632 ERROR (null) - (null) - (null) - mojoPortal.Web.UrlRewriter - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBSiteSettings.GetSiteIdByHostName(String hostName)
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromCache()
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromContext()
   at mojoPortal.Web.UrlRewriter.GetRedirectUrl(String targetUrl)
   at mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app)
   at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,648 ERROR {my host's IP} - en-US - / - mojoPortal.Web.BannedIPBlockingHttpModule - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress)
   at mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,648 ERROR {my host's IP} - en-US - / - mojoPortal.Web.UrlRewriter - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBSiteSettings.GetSiteIdByHostName(String hostName)
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromCache()
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromContext()
   at mojoPortal.Web.UrlRewriter.GetRedirectUrl(String targetUrl)
   at mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app)
   at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,664 ERROR {my host's IP} - en-US - / - mojoPortal.Web.BannedIPBlockingHttpModule - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress)
   at mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,710 INFO {my host's IP} - en-US - / - mojoPortal.Web.mojoBasePage - no sites or no database found in application error so try to redirect to Setup Page
2014-03-02 12:52:46,960 ERROR (null) - (null) - (null) - mojoPortal.Web.BannedIPBlockingHttpModule - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBBannedIP.IsBanned(String ipAddress)
   at mojoPortal.Web.BannedIPBlockingHttpModule.BeginRequest(Object sender, EventArgs e)
2014-03-02 12:52:46,960 ERROR (null) - (null) - (null) - mojoPortal.Web.UrlRewriter - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at mojoPortal.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters)
   at mojoPortal.Data.DBSiteSettings.GetSiteIdByHostName(String hostName)
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromCache()
   at mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromContext()
   at mojoPortal.Web.UrlRewriter.GetRedirectUrl(String targetUrl)
   at mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app)
   at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
2014-03-02 12:58:23,811 INFO (null) - (null) - (null) - mojoPortal.Web.Global - Global.asax.cs Application_End

3/3/2014 8:04:02 AM
Gravatar
Total Posts 18444

Re: Problem with deploying SQL CE on ASPHostPortal

The thing to understand about SLE CE is it is a single file database, the file lives in the /App_Data folder.

The user that is the identity on the application pool in IIS must have full control on this file.

and every single time you upload the SQL CE database file from your local machine to the host it will lose its file system permissions in the hosting environment and when the permissions on the file get messed up you will get access denied errors. 

So it is best not to be copying the site and its database file back and forth very often and you need to fix file system permission for the database file on the host server every time you do that.

3/4/2014 6:10:57 PM
Gravatar
Total Posts 2

Re: Problem with deploying SQL CE on ASPHostPortal

Hi

Thanks so much for the answer.

The DB file hasn't been moved, for sure. In fact, nothing has been changed by the manager, the FTP or the GUI.

I believe that the COM permission is to the user and not to a specific folder, so, going with your line of thought, there should be a process that writes or deletes a new file to the website?

 

Thanks again

HW

3/4/2014 7:26:38 PM
Gravatar
Total Posts 18444

Re: Problem with deploying SQL CE on ASPHostPortal

I believe that the COM permission is to the user and not to a specific folder, so, going with your line of thought, there should be a process that writes or deletes a new file to the website?

correct the web application runs in an IIS worker process and executes in the context of the user that is the identity on the IIS application pool that is configured for the web site in IIS

the error:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 

definitely looks to me like a file system permission error for the sql ce database file that lives in the /App_Data folder beneath the root of the site. So the user that is the identity on the IIS application pool has insufficient permission on the database file, it needs full control of this file

moving the sql ce file form another machine is a common way the file system permissions get messed up but regardless of how it got that way I do believe it is a file system permission problem.

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