How to get logs in Azure emulator mode / Combinator not bundling in Azure emulator mode

Topics: Customizing Orchard, Installing Orchard, Troubleshooting, Writing modules
Oct 17, 2012 at 5:26 PM
Edited Oct 17, 2012 at 5:40 PM

How do i view the logs from blob storage when running in azure compute emulator (Ctrl+F5 from VS)? I go to the storage emulator UI, and File -> Open Azure Drive Folder in Windows Explorer.

This takes me to an explorer window: C:\Users\TheMonarch\AppData\Local\dftmp\wadd\, which has no files or folders. 

I'm trying to debug an issue where Piedone.Combinator is not bundling resources when running in azure emulator mode. The same source tree under the normal (non-Azure) .sln works fine -- bundling takes place. I've updated the Orchard.Azure.Web.csproj with the .csproj files for all my custom modules, including the combinator one, and i see the modules show up in the bin folder. I'm not sure if there are any other changes needed to make this work. 

I know the Combinator module is there and somewhat working because even in Azure mode I can visit the combinator settings page in the Dashboard. All my other custom modules seem to be working fine both in the dashboard and on the front end. Could this have something to do with writing the bundled & minified resources to the storage emulator? 

Oct 17, 2012 at 6:56 PM

you need to use a cloud storage navigator utility, cloud berry is the one I like the most because it has resume capabilities: http://www.cloudberrylab.com/

where the logs will be located I'm not sure, but I suspect they would still be on the local App_Data, but someone else should be able to confirm that.

Oct 18, 2012 at 2:49 AM

I tried the cloudberrylab app. I don't see any orchard error logs anywhere from cloudberry, but I can browse to media/default/combinator/scripts/ and see some 3.2KB bundled scripts being saved there, but all the resources in the HTML of the pages I visit are not being bundled.

The bundled .js in the combinator folder is 3.2KB, which is way too small. It should include jquery plus a couple other scripts so it should be several dozen KB at minimum. I think combinator or my site may be hitting an error, but I have no way of viewing logs to see if this is the case. 

Oct 18, 2012 at 3:54 AM

OK -- found that the logging under Azure goes through Azure Diagnostics, and is done through calls to Trace.WriteLine(), which stores the logging messages in Azure Table storage. My mistake was thinking that the logs would be in Azure blob storage, in the form of files as they are in non-Azure. 

I found that there are a lot of errors being thrown by combinator, I'm not sure if they are expected or not: 

 

2012-10-17 20:55:23,416 [17] Piedone.Combinator.CombinedResourceManager - Error when combining JavaScript files
System.ArgumentException: The relative virtual path 'http:/127.0.0.1:10000/devstoreaccount1/media/Default/Combinator/Scripts/1063579240-1.js' is not allowed here.
   at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
   at System.Web.VirtualPathUtility.ToAppRelative(String virtualPath, String applicationPath)
   at Piedone.Combinator.Models.CombinatorResource.get_RelativeVirtualPath() in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Models\CombinatorResource.cs:line 60
   at Piedone.Combinator.Models.CombinatorResource.get_RelativeUrl() in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Models\CombinatorResource.cs:line 52
   at Piedone.Combinator.Models.CombinatorResource.set_RequiredContext(ResourceRequiredContext value) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Models\CombinatorResource.cs:line 81
   at Piedone.Combinator.Models.CombinatorResource.FillRequiredContext(String name, String url, String culture, String condition, Dictionary`2 attributes) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Models\CombinatorResource.cs:line 133
   at Piedone.Combinator.Services.CacheFileService.<>c__DisplayClass4.b__3(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CacheFileService.cs:line 99
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.Combinator.Services.CacheFileService.GetCombinedResources(Int32 hashCode) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CacheFileService.cs:line 87
   at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClass9.<>c__DisplayClassd.b__7(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CombinatorService.cs:line 105
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.<>c__DisplayClass2`1.b__0(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.HelpfulLibraries\Libraries\Tasks\LockingCacheManager.cs:line 33
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.Get[TResult](String key, Func`2 acquire, Func`1 fallback, Int32 millisecondsTimeout) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.HelpfulLibraries\Libraries\Tasks\LockingCacheManager.cs:line 28
   at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClass9.b__6(ResourceLocation location) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CombinatorService.cs:line 92
   at Piedone.Combinator.Services.CombinatorService.CombineScripts(IList`1 resources, ICombinatorSettings settings) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CombinatorService.cs:line 116
   at Piedone.Combinator.CombinedResourceManager.BuildRequiredResources(String stringResourceType) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\CombinedResourceManager.cs:line 125

and these too: 

2012-10-17 20:55:22,645 [17] Piedone.Combinator.CombinedResourceManager - Error when combining Style files
System.ArgumentException: File Default/Combinator/Styles/-805465878-1.css does not exist
   at Orchard.Azure.CloudBlobContainerExtensions.EnsureBlobExists(CloudBlobContainer container, String path) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Azure\CloudBlobContainerExtensions.cs:line 34
   at Orchard.Azure.AzureFileSystem.GetPublicUrl(String path) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Azure\AzureFileSystem.cs:line 287
   at Piedone.Combinator.Services.CacheFileService.<>c__DisplayClass4.b__3(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CacheFileService.cs:line 99
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.Combinator.Services.CacheFileService.GetCombinedResources(Int32 hashCode) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CacheFileService.cs:line 87
   at Piedone.Combinator.Services.CombinatorService.<>c__DisplayClass2.b__0(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CombinatorService.cs:line 67
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.<>c__DisplayClass2`1.b__0(AcquireContext`1 ctx) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.HelpfulLibraries\Libraries\Tasks\LockingCacheManager.cs:line 33
   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 57
   at Orchard.Caching.Cache`2.AddEntry(TKey k, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 27
   at Orchard.Caching.Cache`2.<>c__DisplayClass2.b__0(TKey k) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 19
   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:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\Cache.cs:line 17
   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard\Caching\DefaultCacheManager.cs:line 33
   at Piedone.HelpfulLibraries.Tasks.LockingCacheManager.Get[TResult](String key, Func`2 acquire, Func`1 fallback, Int32 millisecondsTimeout) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.HelpfulLibraries\Libraries\Tasks\LockingCacheManager.cs:line 28
   at Piedone.Combinator.Services.CombinatorService.CombineStylesheets(IList`1 resources, ICombinatorSettings settings) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\Services\CombinatorService.cs:line 58
   at Piedone.Combinator.CombinedResourceManager.BuildRequiredResources(String stringResourceType) in c:\projects\OrchardEnlistments\orchard-gb\src\Orchard.Web\Modules\Piedone.Combinator\CombinedResourceManager.cs:line 121

Oct 18, 2012 at 4:46 PM

ummm, i suspect combinator does not work on azure?

System.ArgumentException: The relative virtual path 'http:/127.0.0.1:10000/devstoreaccount1/media/Default/Combinator/Scripts/1063579240-1.js' is not allowed here.

that definately is not a relative path!

nice one on digging up where the logs go to.

Oct 18, 2012 at 5:04 PM

I think combinator will work in azure, i think the issue is only happening when you're using azure storage emulator. With actual azure Combinator should take a different code path because it will think the cached bundled resource's public blob url is a CDN resource, since it will have a different host name. I filed a work item for this in the combinator codeplex project.

Oct 18, 2012 at 5:20 PM

cool let us know how you get on