Hangfire 1.8 Support
Closed this issue Β· 16 comments
Any plans for hangfire 1.8 support?
I think so, but the lost of breaking changes seems daunting for some solutions we use. Iβll have to look into those.
All in all, the 1.8 version seems to solve a lot of small issues or annoyances, so I suppose itβs a yes without timeline.
Happy to help if there's anything to call out
I've pushed beta packages to nuget:
Hangfire.Tags: 1.9.0-beta.1
Hangfire.Tags.Pro.Redis: 3.0.0-beta.1
Hangfire.Tags.Redis.StackExchange: 1.9.2-beta.1
Hangfire.Tags.SQLite: 1.9.0-beta.1
Hangfire.Tags.SqlServer: 1.9.0-beta.1
Nice! I'll give this a try today and keep you updated. π»
Getting this when naving to the tags page
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n at Hangfire.Tags.SqlServer.SqlTagsMonitoringApi.UseConnection[T](Func`2 action)\n at Hangfire.Tags.SqlServer.SqlTagsServiceStorage.SearchWeightedTags(JobStorage jobStorage, String tag, String setKey)\n at Hangfire.Tags.Storage.TagsStorage.SearchWeightedTags(String tag)\n at Hangfire.Tags.Dashboard.Pages.TagsSearchPage.Execute()\n at Hangfire.Dashboard.RazorPage.TransformText(String body)\n at Hangfire.Dashboard.RazorPage.ToString()\n at Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context)\n at Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext)\n at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)\n at REDACTEDcs in REDACTEDcs:line 25"
Is it possible that you have an old Hangfire.SqlServer package somewhere? I don't have this issue in the samples.
yeah, still seeing it like this π€
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.2" />
<PackageReference Include="Hangfire.SqlServer" Version="1.8.2" />
<PackageReference Include="Hangfire.Tags" Version="1.9.0-beta.1" />
<PackageReference Include="Hangfire.Tags.SqlServer" Version="1.9.0-beta.1"
var tagsOptions = new TagsOptions() { TagsListStyle = TagsListStyle.Dropdown };
services.AddHangfire(hangfireConfig => hangfireConfig
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseColouredConsoleLogProvider()
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage(connection, new SqlServerStorageOptions
{
// my config
})
.UseTagsWithSql(tagsOptions);
services.AddHangfireServer(o =>
{
// my config
});
more details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'HangFire.Set'.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar()
at Dapper.SqlMapper.ExecuteScalarImpl[T](IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 2877
at Dapper.SqlMapper.ExecuteScalar[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 493
at Hangfire.Tags.SqlServer.SqlTagsServiceStorage.<>c__DisplayClass4_0.<SearchWeightedTags>b__0(DbConnection connection)
at Hangfire.SqlServer.SqlServerStorage.UseConnection[T](DbConnection dedicatedConnection, Func`2 func)
at Hangfire.SqlServer.SqlServerMonitoringApi.UseConnection[T](Func`2 action)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Do you happen to have a custom schema name for Hangfire? This exception seems to occur because it can't find the Hangfire.Set table. Since we're escaping table names with square brackets, this exception seems strange.
Also, this method was not changed in this version, so I'm a bit confused that this used to work before 1.8.
Yeah, custom schema name.
We're just adding HF to the app, so weren't on 1.7. Maybe it's an existing problem and I assumed it was a 1.8 issue when I saw it?
In that case, pass the Sql options youβre passing to the storage also to UseTagsWithSql.
that did it π
everything seems to be good so far. i'll report back if i notice anything. thanks again
So, I've also upgraded our projects to this version, and it seems to run stable for quite some time already. What are your findings so far?
No issues so far. Only hang up I noticed was around tag length, but that's separate from this and I just added a guard for it so it's all good
There is a configuration option for that, because it depends on the schema:
TIL π
Thanks!