Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in ValidateFile #156

Open
Rockerby opened this issue May 26, 2022 · 4 comments
Open

NullReferenceException in ValidateFile #156

Rockerby opened this issue May 26, 2022 · 4 comments

Comments

@Rockerby
Copy link

Rockerby commented May 26, 2022

We had an issue this morning where our site stopped working with a NullReferenceException in the ValidateFile function. It was running yesterday and there have been no code / file changes since then (also no server updates or restarts). The ValidateFile function is pretty small so assuming that the file that it's passing in along the way is null. The bundle in question is a CSS bundle.

My gut is telling me this is something to do with the application pool going idle as a restart fixes the issue. Relevant stack trace extract below:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Smidge.BundleFileSetGenerator.ValidateFile(IWebFile file)
   at Smidge.BundleFileSetGenerator.GetOrderedFileSet(IEnumerable`1 files, PreProcessPipeline pipeline)
   at Smidge.BundleFileSetGenerator.GetOrderedFileSet(Bundle bundle, PreProcessPipeline pipeline)
   at Smidge.SmidgeHelper.GenerateBundleUrlsAsync(String bundleName, String fileExt, Boolean debug)
   at Smidge.TagHelpers.SmidgeLinkTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)

For reference, this is an Umbraco 9.5.0 site (.NET 5), running Smidge 4.0.3 hosted on Windows Server 2019, IIS 10.

@nikro412956
Copy link

I have the same issue with the exact same conditions. It happened to 2 different websites so far. We might also need to report this to the Umbraco git repo so they can also look in to it.

@nikro412956
Copy link

@Rockerby What cache buster are you using? I am using the Timestamp cache buster. So i am curious which one you are using and if using the other cache buster can prevent this problem from occurring.

@Rockerby
Copy link
Author

Hey @nikro412956 - this was using the Version cache buster type. I couldn't replicate this on a dev machine; purely on a live/staging environment.

@madsoulswe
Copy link

Yes, we got the same issue in production.

A couple of days ago the Igloo css-bundle returned 500 with the same exception. It was resoved after a restart.
Now the js-bundle got the same issue.

The site is using Version-cachebuster and I have disabled Smidge MemoryCache for now to se if it helps.

Umbraco 10.5.1 + Smdige 4.5
Windows server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants