HangfireIO / HangfireIO/Hangfire

Use Azure SQL Edge

Open
#2,134 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

I don't know if theres any plan to support Azure SQL Edge and im not sure why it shouldn't work out of the box, but i would love to have support for it.

Whenever i try to run the Hangfire installer with Azure SQL Edge with the exact same Connection which is working perfectly for my MSSQL instance, it fails with the following error.

Would be happy if anyone had the time to try Hangfire with Azure SQL Edge specifically.

```
2022-11-18 09:47:31 fail: XXXXX.Modules.Installation.Hangfire.Commands.CreateHangfireDatabase[0]
2022-11-18 09:47:31 Failed to update hangfire database, please verify database connection and database permissions
2022-11-18 09:47:31 Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXXXX" requested by the login. The login failed.
2022-11-18 09:47:31 Login failed for user 'XXXXX'.
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
2022-11-18 09:47:31 at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
2022-11-18 09:47:31 at Microsoft.Data.SqlClient.SqlConnection.Open()
2022-11-18 09:47:31 at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader)
2022-11-18 09:47:31 at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command)
2022-11-18 09:47:31 at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType)
2022-11-18 09:47:31 at Hangfire.SqlServer.SqlServerObjectsInstaller.Install(DbConnection connection, String schema, Boolean enableHeavyMigrations)
2022-11-18 09:47:31 at Hangfire.SqlServer.SqlServerObjectsInstaller.Install(DbConnection connection, String schema)
2022-11-18 09:47:31 at XXXXX.Modules.Installation.Hangfire.Services.HangfireDatabaseInstaller.Install(String connectionString, String schema) in /modules/XXXXX.Modules.Installation/src/XXXXX.Modules.Installation.Hangfire/Services/HangfireDatabaseInstaller.cs:line 25
2022-11-18 09:47:31 at XXXXX.Modules.Installation.Hangfire.Commands.CreateHangfireDatabase.RunCommandAsync(CreateHangfireDatabaseOptions options) in /modules/XXXXX.Modules.Installation/src/XXXXX.Modules.Installation.Hangfire/Commands/CreateHangfireDatabase.cs:line 28
2022-11-18 09:47:31 ClientConnectionId:a95d1e46-4761-4e66-a2eb-82091683b725
2022-11-18 09:47:31 Error Number:4060,State:1,Class:11
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Hangfire.SqlServer.SqlServerObjectsInstaller.Install and the caller in HangfireDatabaseInstaller.cs at line 25, then reproduce the installer failure against Azure SQL Edge and compare it with MSSQL. Done means the supported Azure SQL Edge setup is identified and the Hangfire database installation succeeds, or the incompatibility is documented with a clear limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.