Closed PezCo closed 4 years ago
Hi, so is this stack trace from the dependency handler or where are you getting this stack trace from?
Browser with <customErrors mode="Off"/>
in the web.config when hitting the URL of the missing Client Dependancy file
e.g 'https://example.com/DependencyHandler.axd?s=L2Nzcy9hcHAuY3NzOw&t=Css&cdv=2142871668'
I dont think ive ever had the problem on a local development machine with same code which pushes me to thinking its an azure issue but i have followed all the Umbraco recommended steps for hosting on Azure.
Yep i've never seen the issue either. Umbraco changes the location of CDF files to be in Azure %temp% (local) storage and this error is related to that since it's saying that the %temp% directory it's trying to access doesn't exist. Is this a one-off issue or can you replicate this issue?
I wouldn't say one off, but i cant repeat it. I have 2 identical slots used for green blue deployment with azures swap function. the staging slot is almost permanently throwing the error, which persists after swap so we cant currently deploy using azure swap. other slots like a qa can sometimes get it intermittently but it usually rectifies by wither going to the umbraco admin or redeploying with a new client dependency number.
I dont know how azure slots work but deleting and recreating the slot had no affect.
Very odd and definitely not seen the issue before. This is the code that configures CDF within Umbraco https://github.com/umbraco/Umbraco-CMS/blob/11f28554428390cf1e518c298e9959bd767020b5/src/Umbraco.Web/Runtime/WebInitialComponent.cs#L112 and this is the code that sets the %temp% path https://github.com/umbraco/Umbraco-CMS/blob/11f28554428390cf1e518c298e9959bd767020b5/src/Umbraco.Web/Runtime/WebInitialComponent.cs#L125
Each website regardless of slot swap has it's own %temp% path, they are different appdomains/processes. I wonder if in some zany way there's some timing issue where that folder isn't created before it tries reading/writing to it. In the code above the path is set to: Path.Combine(cachePath, "ClientDependency")
but that code doesn't eagerly ensure that folder which could easily be done with Directory.CreateDirectory(cachePath)
. I'm fairly positive that CDF ensures this path itself else all sites would have this error but like i said maybe there's some unique situation that's preventing that from happening. The error is coming from aspnet's OutputCache so somehow maybe that handler is executing before CDF has ensured the path.
Perhaps you can try this and see if that fixes it?
Path.Combine(cachePath, "ClientDependency")
Directory.CreateDirectory(cachePath)
I think thats Umbraco V8 code you linked? Im in V7 for this bug sorry! 7.15.3 to be specific
Whats strange is that if i go to url using the cdv thats in clientdependancy.config aka the one that gets rendered when using @Html.RenderCssHere()
it doesn't work
<clientDependency version="2142880001" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
example.org/DependencyHandler.axd?s=L2Nzcy9hcHAuY3NzOw&t=Css&cdv=2142880001 - Broken
But i can change the cdv to any number i want in the browser and it returns the correct css
example.org/DependencyHandler.axd?s=L2Nzcy9hcHAuY3NzOw&t=Css&cdv=12345678 - Correct
Sounds like that specific version has a bad state and it's been hard cached to disk. So if you change your config version to some other version you've never used before is everything fine again? You can also clear your temp CDF caches files at App_Data/TEMP/ClientDependency
I'll close this issue since there's not much else I can help with without steps to replicate.
I have an intermittent error were CSS does not load for a site via the dependency handler.
Console on chrome gives a generic: "Refused to apply style from 'https://example.com/DependencyHandler.axd?s=L2Nzcy9hcHAuY3NzOw&t=Css&cdv=2142871668' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."
Hitting the URL directly gives: "Directory 'D:\local\Temp\UmbracoData\13978ceb9b0641fb41b12a5f518548dcc4707dfa\ClientDependency' does not exist. Failed to start monitoring file changes."
This site is on an azure web app, works locally. I have multiple slots with the same code that work fine, have tried deleting and recreating the slot to no avail.
Stack Trace
ClientDependency version: 1.9.7 Umbraco Version: 7.15.3