Cultiv.Hangfire does not work after upgrade Umbraco 9 to 10
Hi,
We are using the Cultiv.Hangfire Nuget package in one of our projects. After upgrading this project from Umbraco 9.5.4 to Umbraco 10.3.2 and upgrading the package to Cultiv.Hangfire 2.3.0 we have a problem with hangfire.
When we run the project we get the following error:
An error occurred while starting the application.
InvalidOperationException: JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.
Hangfire.JobStorage.get_Current()
When we run the project with the task commented out, it runs but the Hangfire dashboard under Settings remains empty, showing only the loading-icon.
First Umbraco 10 leaves the connection in appsettings.json empty which causes the JobStorage.Current error.
Secondly Umbraco 10 uses SQLite as default on localhost, which is not supported by the Cultiv.Hangfire package. When I create a local SQL database and connect it using a connectionstring in appsettings.json everything works as expected.
No, I use one connection string, so the Hangfire tables are written to the Umbraco DB. (Our project is hosted on Umbraco Cloud, so the connection string is only used locally.)
There is a SSQLite Storage plugin available for anyone using SQLite, I don't know if it works with Cultiv.Hangfire as I use the standard Hangfire.AspNetCore package in mine.
Cultiv.Hangfire does not work after upgrade Umbraco 9 to 10
Hi,
We are using the Cultiv.Hangfire Nuget package in one of our projects. After upgrading this project from Umbraco 9.5.4 to Umbraco 10.3.2 and upgrading the package to Cultiv.Hangfire 2.3.0 we have a problem with hangfire.
When we run the project we get the following error:
When we run the project with the task commented out, it runs but the Hangfire dashboard under Settings remains empty, showing only the loading-icon.
Does anybody know what to do here?
thanks,
Frans
How are you registering hangfire in your startup.cs?
We don't register it in startup.cs. In Umbraco 9 the package takes care of that, we only needed to add a composer, like:
Up until the upgrade to Umbraco 10 this worked.
not sure I'm fraid, I don't register my jobs using a composer
I found the answer:
First Umbraco 10 leaves the connection in appsettings.json empty which causes the JobStorage.Current error.
Secondly Umbraco 10 uses SQLite as default on localhost, which is not supported by the Cultiv.Hangfire package. When I create a local SQL database and connect it using a connectionstring in appsettings.json everything works as expected.
Hi Frans,
I'm having the same issue, do you use a separate DB for your hangfire for the connection string?
No, I use one connection string, so the Hangfire tables are written to the Umbraco DB. (Our project is hosted on Umbraco Cloud, so the connection string is only used locally.)
Glad you got it sorted
There is a SSQLite Storage plugin available for anyone using SQLite, I don't know if it works with Cultiv.Hangfire as I use the standard Hangfire.AspNetCore package in mine.
https://github.com/raisedapp/Hangfire.Storage.SQLite
is working on a reply...