Weird Error

Topics: General, Troubleshooting
May 24, 2011 at 12:23 PM

Hi guys,

Please help, I am encountering this weird error, we have multiple c1 projects on windows II7 on virtual directories(web application) here's the erro:

Compilation returned error "Error generating Win32 resource: The process cannot access the file because it is being used by another process. ", File: "", Line: "0

If I recycle the application pool and restarted the website it works, but sometimes its not, i have to recycle the application pool many times to make it work again. user for application pool has full access to the folder.

 

Regards,

Arnel Gracela

May 24, 2011 at 12:33 PM

Hi Arnel

Can you post the whole call stack here?

 

// Dmitry

May 24, 2011 at 1:02 PM
Edited May 24, 2011 at 1:03 PM

hi napernik, currently i have this error 

Compilation returned error "Could not write to output file 'c:\inetpub\wwwroot\project\App_Data\Composite\Cache\Assemblies\CMS_2D537A54_1E9B346F_v0002_b5c95bfc-ac22-49ec-bd32-692c61010493.dll' -- 'The process cannot access the file because it is being used by another process. '", File: "", Line: "0"

 

InvalidOperationException: Compilation returned error "Could not write to output file 'c:\inetpub\wwwroot\project\App_Data\Composite\Cache\Assemblies\CMS_2D537A54_1E9B346F_v0002_b5c95bfc-ac22-49ec-bd32-692c61010493.dll' -- 'The process cannot access the file because it is being used by another process. '", File: "", Line: "0"]
   Composite.Core.Types.BuildManagerImpl.Compile(BuildManagerCompileUnit buildManagerCompileUnit) +1903
   Composite.Core.Types.BuildManagerImpl.GetCompiledTypes(BuildManagerCompileUnit buildManagerCompileUnit) +288
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.XmlDataProviderHelperGenerator.GenerateStore(Boolean staticOnly, XmlDataProviderCodeGeneratorResult result, XmlDataProviderCodeGeneratorStore store) +897
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.<>c__DisplayClass5.<Generate>b__2(XmlDataProviderCodeGeneratorStore store) +21
   Composite.Core.Parallelization.ThreadWrapper`1.WrapperAction(TSource source) +253
   System.Threading.Tasks.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30() +1238
   System.Threading.Tasks.Task.InnerInvoke() +38
   System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +14
   System.Threading.Tasks.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object ) +232

[AggregateException: One or more errors occurred.]
   System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3566565
   System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) +88
   System.Threading.Tasks.Parallel.PartitionerForEachWorker(Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) +1243
   System.Threading.Tasks.Parallel.ForEachWorker(IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) +351
   System.Threading.Tasks.Parallel.ForEach(IEnumerable`1 source, Action`1 body) +110
   Composite.Core.Parallelization.ParallelFacade.ForEach(String parallelizationPointName, IEnumerable`1 source, Action`1 body) +620
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.XmlDataProviderHelperGenerator.Generate(Boolean staticOnly) +506
   Composite.Plugins.Data.DataProviders.XmlDataProvider.XmlDataProvider.GenerateResult(IEnumerable`1 storeElementsToGenerated, Boolean staticOnly) +1146
   Composite.Plugins.Data.DataProviders.XmlDataProvider.XmlDataProvider.set_Context(DataProviderContext value) +25
   Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.GetDataProvider(String providerName) +255
   Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.GetSupportedInterfaces(String providerName) +81
   Composite.Data.Foundation.DataProviderRegistryImpl.BuildDictionaries() +130
   Composite.Data.Foundation.DataProviderRegistryImpl.Initialize_StaticTypes() +225
   Composite.Data.Foundation.DataProviderRegistry.Initialize_StaticTypes() +14
   Composite.GlobalInitializerFacade.DoInitialize() +151
   Composite.GlobalInitializerFacade.InitializeTheSystem() +490
   Composite.Data.Foundation.DataProviderRegistry.get_AllInterfaces() +31
   Composite.Data.DataFacadeImpl.GetData(Boolean useCaching, IEnumerable`1 providerNames) +54
   Composite.Data.DataFacade.GetData(Boolean useCaching, IEnumerable`1 providerNames) +66
   Composite.Data.DataFacade.GetData() +38
   Composite.Data.DataLocalizationFacadeImpl.get_DefaultUrlMappingCulture() +92
   Composite.Data.PageUrl.GetCultureInfo(String requestPath, String& requestPathWithoutUrlMappingName) +272
   Composite.Data.PageUrl.ParsePublicUrl(UrlBuilder urlBuilder, NameValueCollection& notUsedQueryParameters) +183
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +96

[InvalidOperationException: Failed to intercept URL 'http://localhost:80/project'.]
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +660
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.context_BeginRequest(Object sender, EventArgs e) +172
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 

 

 

Regards,

Arnel Gracela

May 24, 2011 at 1:09 PM

and now I'm having this error now, a bit different and not specific to any file:

 Compilation returned error "Error generating Win32 resource: The process cannot access the file because it is being used by another process. ", File: "", Line: "0"

[InvalidOperationException: Compilation returned error "Error generating Win32 resource: The process cannot access the file because it is being used by another process. ", File: "", Line: "0"]
   Composite.Core.Types.BuildManagerImpl.Compile(BuildManagerCompileUnit buildManagerCompileUnit) +1903
   Composite.Core.Types.BuildManagerImpl.GetCompiledTypes(BuildManagerCompileUnit buildManagerCompileUnit) +288
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.XmlDataProviderHelperGenerator.GenerateStore(Boolean staticOnly, XmlDataProviderCodeGeneratorResult result, XmlDataProviderCodeGeneratorStore store) +897
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.<>c__DisplayClass5.<Generate>b__2(XmlDataProviderCodeGeneratorStore store) +21
   Composite.Core.Parallelization.ThreadWrapper`1.WrapperAction(TSource source) +253
   System.Threading.Tasks.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30() +1238
   System.Threading.Tasks.Task.InnerInvoke() +38
   System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +14
   System.Threading.Tasks.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object ) +232

[AggregateException: One or more errors occurred.]
   System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3566565
   System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) +88
   System.Threading.Tasks.Parallel.PartitionerForEachWorker(Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) +1243
   System.Threading.Tasks.Parallel.ForEachWorker(IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) +351
   System.Threading.Tasks.Parallel.ForEach(IEnumerable`1 source, Action`1 body) +110
   Composite.Core.Parallelization.ParallelFacade.ForEach(String parallelizationPointName, IEnumerable`1 source, Action`1 body) +620
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.XmlDataProviderHelperGenerator.Generate(Boolean staticOnly) +506
   Composite.Plugins.Data.DataProviders.XmlDataProvider.XmlDataProvider.GenerateResult(IEnumerable`1 storeElementsToGenerated, Boolean staticOnly) +1146
   Composite.Plugins.Data.DataProviders.XmlDataProvider.XmlDataProvider.set_Context(DataProviderContext value) +25
   Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.GetDataProvider(String providerName) +255
   Composite.Data.Foundation.PluginFacades.DataProviderPluginFacade.GetSupportedInterfaces(String providerName) +81
   Composite.Data.Foundation.DataProviderRegistryImpl.BuildDictionaries() +130
   Composite.Data.Foundation.DataProviderRegistryImpl.Initialize_StaticTypes() +225
   Composite.Data.Foundation.DataProviderRegistry.Initialize_StaticTypes() +14
   Composite.GlobalInitializerFacade.DoInitialize() +151
   Composite.GlobalInitializerFacade.InitializeTheSystem() +490
   Composite.Data.Foundation.DataProviderRegistry.get_AllInterfaces() +31
   Composite.Data.DataFacadeImpl.GetData(Boolean useCaching, IEnumerable`1 providerNames) +54
   Composite.Data.DataFacade.GetData(Boolean useCaching, IEnumerable`1 providerNames) +66
   Composite.Data.DataFacade.GetData() +38
   Composite.Data.DataLocalizationFacadeImpl.get_DefaultUrlMappingCulture() +92
   Composite.Data.PageUrl.GetCultureInfo(String requestPath, String& requestPathWithoutUrlMappingName) +272
   Composite.Data.PageUrl.ParsePublicUrl(UrlBuilder urlBuilder, NameValueCollection& notUsedQueryParameters) +183
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +96

[InvalidOperationException: Failed to intercept URL 'http://localhost:80/project'.]
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +660
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.context_BeginRequest(Object sender, EventArgs e) +172
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

May 24, 2011 at 2:05 PM

Could it be that you somehow hosting the same site in 2 locations? F.e. 2 different sites for the same folder, or IIS and in Visual Studio's development server?

May 24, 2011 at 2:14 PM

No, I only host 1 copy for each site; 1 site 1 location, but they are deployed on one website with multiple web applciation

Site1 contains webapp:

project1, project2,...

Regards,

Arnel 

May 24, 2011 at 3:06 PM

Hi Arnel,

could you please try to stop the IIS7 process and start it again?This would be the W3C service.

My best bet is that two processes (AppPool instances) are running side by side, one has at some point generated and loaded the DLL the exceptions mention, and the other one is starting up, needing the same compiled type and in hence trying to also create the same DLL.

This is not something we are used to seeing so if you should happen to experience it again and perhaps see some pattern to this, please let us know.

Marcus

May 24, 2011 at 3:14 PM
Edited May 24, 2011 at 3:15 PM

that's how I'm fixing the error problem once I recycle the app pool or restart the website or restart the whole IIS everything works perfectly, but will surely come back after a couple of hours. btw, many of our projects is using only one application pool, would that be a problem?

May 24, 2011 at 4:05 PM
Edited May 24, 2011 at 4:10 PM

Try giving sites individual AppPool's to see if it fix the problem.

May 26, 2011 at 4:44 PM
Edited May 27, 2011 at 2:11 AM

Hi mawtex, I tried giving each web app its own individual app pool, but still having those errors, additionally, We also experience this error.

The file 'C:\Windows\TEMP\yppaleax.out' already exists.
[IOException: The file 'C:\Windows\TEMP\yppaleax.out' already exists.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +9726585
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +1142
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +83
   System.CodeDom.Compiler.Executor.CreateInheritedFile(String file) +31
   System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +173
   System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +122
   Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs) +261
   Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +474
   Microsoft.CSharp.CSharpCodeGenerator.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) +565
   Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea) +53
   System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit[] compilationUnits) +23
   Composite.Core.Types.BuildManagerImpl.Compile(BuildManagerCompileUnit buildManagerCompileUnit) +1431
   Composite.Core.Types.BuildManagerImpl.GetCompiledTypes(BuildManagerCompileUnit buildManagerCompileUnit) +288
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.XmlDataProviderHelperGenerator.GenerateStore(Boolean staticOnly, XmlDataProviderCodeGeneratorResult result, XmlDataProviderCodeGeneratorStore store) +897
   Composite.Plugins.Data.DataProviders.XmlDataProvider.CodeGeneration.<>c__DisplayClass5.<Generate>b__2(XmlDataProviderCodeGeneratorStore store) +21
   Composite.Core.Parallelization.ThreadWrapper`1.WrapperAction(TSource source) +253
   System.Threading.Tasks.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30() +1238
   System.Threading.Tasks.Task.InnerInvoke() +38
   System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) +14
   System.Threading.Tasks.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object ) +232
[AggregateException: One or more errors occurred.]
   Composite.GlobalInitializerFacade.InitializeTheSystem() +709
   Composite.Data.Foundation.DataProviderRegistry.get_AllInterfaces() +31
   Composite.Data.DataFacadeImpl.GetData(Boolean useCaching, IEnumerable`1 providerNames) +54
   Composite.Data.DataFacade.GetData(Boolean useCaching, IEnumerable`1 providerNames) +66
   Composite.Data.DataLocalizationFacadeImpl.get_DefaultUrlMappingCulture() +96
   Composite.Data.PageUrl.GetCultureInfo(String requestPath, String& requestPathWithoutUrlMappingName) +272
   Composite.Data.PageUrl.ParsePublicUrl(UrlBuilder urlBuilder, NameValueCollection& notUsedQueryParameters) +183
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +96
[InvalidOperationException: Failed to intercept URL 'http://server1:80/project1/Home.aspx'.]
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.HandlePublicPageUrl(HttpContext context) +660
   Composite.Core.WebClient.Renderings.RequestInterceptorHttpModule.context_BeginRequest(Object sender, EventArgs e) +172
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Any input is very welcome.
Regards,
Arnel Gracela

 

May 30, 2011 at 2:51 PM

I fixed the "The file 'C:\Windows\TEMP\yppaleax.out' already exists."  one.

@Arnel is it the only exception you experience while running on individial apps scenario? if yes, I can build some dll-s for you, so we can check if it will solve the issue on your machine. Are you running on 2.1.1?

Jun 1, 2011 at 7:41 AM

Hi napernik, Thank you for responding, yes that's the typical error we keep encountering on composite, but also the two errors above. It will be a great help if we can have the fix for it.

 

Thanks and Regards,

Arnel Gracela

Jun 1, 2011 at 10:01 AM

@Arnel I created a dlls that should fix the problem. Here're the steps for updating the sites

1) If you're ruggin on 2.1, upgate to 2.1.1 http://compositec1.codeplex.com/discussions/255955

2) Create a backup copy of your site

3) Download and unpack  http://docs.composite.net/downloads/temp/Composite_dlls_multipleappfix.zip to site's "/bin" folder, overwrite Composite*.dll

Jun 2, 2011 at 3:45 PM

hi napernik,

I applied your fix but my site keeps going down with this error:

This website is temporarily unavailable, please try again later.

i have 2.1.1 already so i just unpack and copy the zip contents to /bin folder overwriting the composite.dll

Regards,

Arnel Gracela

Jun 3, 2011 at 2:09 AM

guys,

Anybody got an idea how to fix this?

Access to the path 'C:\inetpub\website1\App_Data\Composite\Cache\Assemblies\CMS_7791D994_B45A1CEB_v0001_3d5953ab-7077-4797-b001-ba99c972b1fe.cs' is denied. 

already added the app pool user account to full control over that folder 'website1', also added builtin\iusr as full control over that folder. only fix I can make is to restart the whole IIS system.

Regards,

Arnel Gracela

Jun 3, 2011 at 2:13 AM

I'm also encountering this error on single website:

The file 'C:\Windows\TEMP\cpmdgaza.out' already exists.

@napernik, should your multipleappfix be applicable to a single website as well?

 

Regards,

Arnel Gracela

Jun 3, 2011 at 9:50 AM

>> @napernik, should your multipleappfix be applicable to a single website as well?

>> The file 'C:\Windows\TEMP\cpmdgaza.out' already exists.

Yes, it should

 

>> Anybody got an idea how to fix this?

>> Access to the path 'C:\inetpub\website1\App_Data\Composite\Cache\Assemblies\CMS_7791D994_B45A1CEB_v0001_3d5953ab-7077-4797-b001-ba99c972b1fe.cs' is denied.

To be sure that it is a NTFS security issue, try to add access "C:\inetpub\website1\App_Data\Composite\Cache\Assemblies" to "Everyone" role, if it helps, than you'll just have to find the right accound under which the site is running

 

>> I applied your fix but my site keeps going down with this error:

>> This website is temporarily unavailable, please try again later.

I'll spend some more time trying to reproduce it locally today

Jun 6, 2011 at 12:25 PM

I reproduced the problem and working on a fix

Jun 6, 2011 at 12:56 PM
Edited Jun 6, 2011 at 3:14 PM

Looks like I know what the problem is. 

You do not have the access to some of the files under C:\inetpub\website1\App_Data\Composite\Cache\Assemblies\*

When C1 instance shuts down, it tries to delete files from that folder, it does a lot of retries, and, at the same time prevent new instance to be loaded, therefore you see this message:

This website is temporarily unavailable, please try again later.

 

>> already added the app pool user account to full control over that folder 'website1', also added builtin\iusr as full control over that folder

You edit root folder permissions, but there's a good chance that some of the files haven't inherited them (as I experienced while testing locally).

Try the following: zip all the files, delete files, unzip them again. This way all the specific file permissions will be cleared

Jun 7, 2011 at 5:28 PM

thank you for all the suggestion napernik, i will try them all, another weird problem i'm encountering is that, I have a fresh install of C1 fresh download. i've finished creating template and page types, but when i try createing New Website, it keeps complaining that there isn't any language installed and that I can do it on the 'System' tab, but when i try to add a language on 'System' tab, it complains that all the language possible is already installed. 

 

Regards,

Arnel

Jun 8, 2011 at 3:43 PM

>> when i try createing New Website, it keeps complaining that there isn't any language installed and that I can do it on the 'System' tab, but when i try to add a language on 'System' tab, it complains that all the language possible is already installed.

Some of the "base packages" weren't installed, it could also be security or something like that. Check the log files for exceptions /App_Data/Composite/LogFiles/*.txt

Jun 13, 2011 at 7:44 AM

@napernik, thank you for your post, it enlightened me to reinstall the whole c1 project, and about the errors i'm getting, the fix didn't seem to work. after applying the dll files I'm still getting the erros.

 

Regards,

Arnel