Fresh Installation causing server errors.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

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.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/19/2012 5:41:38 PM
Gravatar
Total Posts 40

Fresh Installation causing server errors.

Hi. I have a fresh installation of mojoportal-2-3-9-3-mssql-net40 installed on a shared 'Medium Trust' server with my webhost Pipeten and a new MSSQL database also hosted by Pipeten. The installation went fine & everything seemed to be running ok. I've just added one test 'Contact' page (which is working fine), changed the default password & edited a bit of text. Apart from that the site is 'as installed'.

After only 24hrs the site has been automatically closed down by Pipeten as it was generating lots of errors. This is the second time that it has happened, each time with a fresh install (although the first was with version 2-3-9-0). The following is a reply from their helpdesk:

A: Hi Craig,

Yes, it looks like it has been generating a lot of errors and causing problems on the server again.

I've attached them below for you.

Regards,

Gavin
---
Gavin Kimpton
Pipe Ten Support Team

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/230/ROOT

Process ID: 7368

Exception: System.Security.SecurityException

Message: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Business.WebHelpers.IndexWriterTask.ProcessIndexingQueue()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTask()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTaskOnNewThread(Object oTask)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/230/ROOT

Process ID: 10672

Exception: System.Security.SecurityException

Message: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Business.WebHelpers.IndexWriterTask.ProcessIndexingQueue()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTask()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTaskOnNewThread(Object oTask)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Does anyone have any idea what might be causing this? I've already checked file permissions with Pipeten & they have informed me that they are already set as 'maximal permissions' for shared hosting.

Regards,

Craig 

10/19/2012 5:47:53 PM
Gravatar
Total Posts 18439

Re: Fresh Installation causing server errors.

The /Data folder and all child folders need to be writable by th euser that is the identity on the application pool.

Its simply a file system permission error, its trying to index content into the search index which is file system based. It doesn't seem able to write to /Data/Sites/[SiteID]/index folder

typically SiteID is 1 in a new installation with only one site.

So you need to solve this file system permission problem by permission configuration. Your hosting control panel should have something for that or your host should be able to help.

Hope that helps,

Joe

10/19/2012 6:02:42 PM
Gravatar
Total Posts 40

Re: Fresh Installation causing server errors.

OK. Thanks for that Joe. Apparently I have no direct control over file permissions in shared hosting, so I've put it back to Pipeten to see if they can help.

Regards,

Craig

10/19/2012 6:13:20 PM
Gravatar
Total Posts 18439

Re: Fresh Installation causing server errors.

This error could also be because the task is using xml serialization which requires the runtime to generate a class in temporary files this comment and linked thread is in your Web.config file and may help you or help your host resolve the problem:

<!-- the below example can be useful if you encounter the error described in this post
http://www.mojoportal.com/Forums/Thread.aspx?thread=6741&mid=34&pageid=5&ItemID=3&pagenumber=1#post27613
-->
<!--
<system.xml.serialization>
<xmlSerializer tempFilesLocation="D:\__projects\mojoportal\__code\joedev\Web\Data"/>
</system.xml.serialization>
-->

So the above can be commented out and adjusted to the actual file path of you /Data folder if your host doesn't allow your app pool user to write to the default location which is down below the Windows folder in a temp folder.

Hope that helps,

Joe

10/19/2012 6:31:53 PM
Gravatar
Total Posts 40

Re: Fresh Installation causing server errors.

Thanks again Joe. Pipeten got back to me about the permissions:

A: Hi Craig,

We use Identity Impersonate on the shared servers and I've double checked for you and your user has writable permissions over all your files and folders.

Regards,

Gavin
---
Gavin Kimpton
Pipe Ten Support Team

It might well be the xml serialization then. I've sent your last comment back to Pipeten, so hopefully this will help. I'll let you know if it works.

Regards,

Craig

10/28/2012 9:34:59 AM
Gravatar
Total Posts 40

Re: Fresh Installation causing server errors.

Hi Joe,

I edited the web.config file in order to overcome the permission errors & it seemed to sort the problem... for a while!

I had two sites (the original running on the main installation domain1.com and the second running on a separate installation at domain2.com, but both having a shared database). I made sure that the web.config's for both sites were modified as instructed in the post you linked to and using the values given by my webhost (H:\hshome\username\domain1.com\Data\ and H:\hshome\username\domain2.com\Data\).

I've subsequently added a third site. This site is an aliased sub-domain of the first one (ie testsite.domain1.com) and I've added the host mapping in the site3 settings. I can access it fine, but it occasionally stalls & I'm getting errors again:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/230/ROOT

Process ID: 5936

Exception: System.UnauthorizedAccessException

Message: Access to the temp directory is denied. Identity 'NT AUTHORITY\NETWORK SERVICE' under which XmlSerializer is running does not have sufficient permission to access the temp directory. CodeDom will use the user account the process is using to do the compilation, so if the user doesn?t have access to system temp directory, you will not be able to compile. Use Path.GetTempPath() API to find out the temp directory location.

StackTrace: at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at mojoPortal.Business.SerializationHelper.SerializeToString(Object obj)
at mojoPortal.Business.WebHelpers.IndexHelper.RebuildIndex(IndexItem indexItem, String indexPath)
at mojoPortal.Business.WebHelpers.IndexHelper.RebuildIndex(IndexItem indexItem)
at mojoPortal.Business.WebHelpers.HtmlContentIndexBuilderProvider.IndexItem(HtmlContent content)
at mojoPortal.Business.WebHelpers.HtmlContentIndexBuilderProvider.IndexItem(Object o)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Could this be because I'm accessing site3 from testsite.domain1.com, which is aliased to domain1.com and I've hardcoded the tempFilesLocation to a folder within domain1.com?

Thanks,

Craig

10/28/2012 9:47:26 AM
Gravatar
Total Posts 18439

Re: Fresh Installation causing server errors.

This error happens because we use xml serialization for task such as the search index builder. By default ASP.NET generates a class for the serialized object under windows temp folder but your hosting does not allow this.

There is a workaround on this thread that may solve it.

Look for this in Web.config, uncomment it and enter the correct file system path to the /Data folder

<!--
<system.xml.serialization>
<xmlSerializer tempFilesLocation="D:\__projects\mojoportal\__code\joedev\Web\Data"/>
</system.xml.serialization>
-->

Then it can generate the class there instead of windows temp folder.

Hope that helps,

Joe

10/28/2012 10:36:01 AM
Gravatar
Total Posts 40

Re: Fresh Installation causing server errors.

Hi Joe,

It was that link that you gave me a couple of posts ago that seemed to solve the problem for a while. It's come back now that I'm using an aliased subdomain to access site3 on my installation.

Site3 is accessed via testsite.domain1.com, which is an alias of domain1.com. I can access site3 fine this way, but I've started getting errors & I'm wondering if hardcoding <xmlSerializer tempFilesLocation="H:\hshome\username\domain1.com\Data"/> causes a problem in a multisite environment?

In other words, I'm accessing the data folder from testsite.domain1.com, but it's hardcoded in the web.config to just domain1.com. Could this be an issue?

Cheers,

Craig

10/28/2012 11:21:27 AM
Gravatar
Total Posts 18439

Re: Fresh Installation causing server errors.

Since it uses a file system path it should not matter what host name is used since the file system path does not change. I'm not sure what you mean by aliasing when I hear people say that I usually interpret it to mean that by some hosting trickery you are trying to run another copy of mojoPortal in a sub folder but make it seem like another root site. If the 3rd site host name resolves to the same physical installation it should work fine but if you are somehow alisaing a sub folder as if it were a root site that is not going to work.

If its really another installation in a sub folder then you may get web.config conflicts and may need to wrap things in location elements to solve that. But mojoPortal cannot run in a sub folder and pretend to be a root site, it can run as a root site or as a sub folder but no hosting trickery can make it work as if it were a root site if its really installed in a sub folder below a root site. The additional host name just needs to resolve the the same IIS web site so it points to the same physical installation.

Hope that helps,

Joe

10/28/2012 11:33:59 AM
Gravatar
Total Posts 40

Re: Fresh Installation causing server errors.

Hi Joe,

Don't worry, it's not another copy of mojoPortal in the sub domain / sub folder! My webhost Control Panel gives me the option to add an alias to the main domain, which I have setup as testsite.domain1.com. ie When I go to testsite.domain1.com (which doesn't actually exist, it is just an alias of the main domain, so it points to the files on domain1.com) then I actually access the main mojoPortal installation, but because I have HostMapping in site3 to include testsite.domain1.com I actually get served the content of site3, which is what I was after! The problem is that I keep on getting the unhandled exceptions!

Cheers,

Craig 

10/28/2012 12:04:31 PM
Gravatar
Total Posts 18439

Re: Fresh Installation causing server errors.

I have no idea why it would only happen for 1 host name and not the other. If it was working before and the error started I would suspect that file system permissions changed on the /Data folder or if the other host name is using a different app pool user then that user would also need write permission on the /Data folder.

Hope that helps,

Joe

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