HangfireIO / HangfireIO/Hangfire
System.Globalization.CultureNotFoundException. Culture is not supported.
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I'm using:
- HangFire.Core v1.4.6
- Hangfire.SqlServer v1.4.6
- Windows 10 x64
- IIS 8.5 (not important probably but still)
Suddenly I got failed jobs containing next exception:
```
System.Globalization.CultureNotFoundException
Culture is not supported. Parameter name: name en-SI is an invalid culture identifier.
System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
en-SI is an invalid culture identifier.
at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
at Hangfire.CaptureCultureAttribute.OnPerforming(PerformingContext filterContext)
at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func`1 continuation)
```
Hangfire was using two servers if that makes any difference. After deleting all Hangfire tables it now works, but still don't know why this happened.
But why does CultureNotFoundException occurs? Thread is always running under valid culturename. I found next post: https://stackoverflow.com/questions/38690850/disable-preservecultureattribute-in-hangfire
Contributor guide
Research direction
Start at Hangfire.CaptureCultureAttribute.OnPerforming, the first Hangfire entry in the reported stack trace, and investigate how the en-SI culture value reaches that point. Compare the stored job data before and after deleting the Hangfire tables. Done means identifying why an invalid culture is restored and documenting or correcting that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100