1

Closed

Files not getting combined (maybe related to load)

description

We have an issue with Combinator where it fails to create a file. This then means that pages run slowly (presumably while the error occurs) and then the non-combined resources are served up.

It can affect both our JS and our CSS, but not usually at the same time. Emptying the combinator cache often makes this change from the JS to the CSS.

As it only occurs on our live environment, I suspect that it might be related to load. Even when it was mostly behaving I was able to reproduce the issue by crawling the site.

The error we get in the logs is
2015-09-18 08:17:52,265 [7] Piedone.Combinator.CombinedResourceManager - Default - Error when combining Style files
 https://www.xxx.co.uk/yyy/zzz
Orchard.OrchardException: Processing of resource https://www.xxx.co.uk/Themes/xyz/styles/pages.css failed. ---> System.ArgumentException: File 410226717-1.css already exists
   at Orchard.FileSystems.Media.FileSystemStorageProvider.CreateFile(String path) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\FileSystems\Media\FileSystemStorageProvider.cs:line 280
   at Piedone.Combinator.Services.CacheFileService.Save(Int32 hashCode, CombinatorResource resource)
   at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClass11.<Combine>b__f(CombinatorResource combinedResource, IEnumerable`1 containedResources)
   at Piedone.Combinator.Services.CombinatorService.Combine(IList`1 resources, Int32 hashCode, ResourceType resourceType, ICombinatorSettings settings)
   --- End of inner exception stack trace ---
   at Piedone.Combinator.Services.CombinatorService.Combine(IList`1 resources, Int32 hashCode, ResourceType resourceType, ICombinatorSettings settings)
   at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClass2.<CombineStylesheets>b__0(AcquireContext`1 ctx)
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 27
   at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)
   at Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 17
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.<>c__DisplayClass2`1.<Get>b__0(AcquireContext`1 ctx)
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 27
   at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)
   at Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\Datastore\TeamCity\buildAgent\work\72cc3a1318c631fe\Main\Source\Site\src\Orchard\Caching\Cache.cs:line 17
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.Get[TResult](String key, Func`2 acquire, Func`1 fallback, TimeSpan timeout)
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManageExtensions.Get[TResult](ILockingCacheManager lockingCacheManager, String key, Func`2 acquire, Func`1 fallback)
   at Piedone.Combinator.Services.CombinatorService.CombineStylesheets(IList`1 resources, ICombinatorSettings settings)
   at Piedone.Combinator.CombinedResourceManager.BuildRequiredResources(String stringResourceType)
The combined file 410226717-1.css does indeed exist. We have the same css on every page of our site so I would presume another page simply created it.

This is Orchard v1.8 and Combinator v2.0.
Closed Sep 21, 2015 at 11:46 AM by Piedone

comments

Piedone wrote Sep 18, 2015 at 9:30 PM

This indeed seems like a race condition-type error. I can recall seeing, and also fixing it. Please try with the latest source from the repository here (check the branch names, not all is compatible still with Orchard 1.8).

eddykavanagh wrote Sep 20, 2015 at 8:57 PM

Thanks for the advice.

I saw the updates to the source here after I posted this. I've updated both Combinator and Helpful Libraries to the most recent 1.8 version without issue in dev and I'll try this as part of our next deployment and see if this improves things.

We'll also be looking to update to 1.9.1 as soon as we can.

Out of interest, why does the Orchard Gallery not contain the most recent version?

Eddy

Piedone wrote Sep 20, 2015 at 9:39 PM

Great, awaiting your findings.

Updating the Gallery is a pain and if you maintain 70 Orchard modules/themes it's pain * 70 :-).

eddykavanagh wrote Sep 21, 2015 at 9:29 AM

I've deployed that to our live environment and done some minor load testing and we're not seeing any of those issues anymore so hopefully that has fixed it.

The only reason I mentioned the Orchard Gallery was because that's where all the Orchard documentation and tutorials I've seen point you to get 3rd party modules. The only additional check I did was to look at the home page of the codeplex project, which points to the same version as the gallery so I just assumed the module hadn't been updated in a while.

Thanks for your help (and for such a useful module)

Eddy

Piedone wrote Sep 21, 2015 at 11:45 AM

Great!