Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR Scaleout with SQL Server raising Nullable object must have a value

Tags:

signalr

I want my SignalR app to deploy in webfarm environment, so I went with signalR Scaleout with SQL server option.

I tested by pointing to my local DB and it is working fine. But when I pointed to my PROD db all the required DB tables and SignalR schema created. But when the client hits for the first time to create hub proxy it is failing and in next attempt it is connecting.

Below is the fatal exception I am getting from SignalR.SqlServer

Nullable object must have a value.

   at Microsoft.AspNet.SignalR.SqlServer.SqlReceiver.Receive(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
like image 217
user1281780 Avatar asked Oct 21 '22 20:10

user1281780


1 Answers

I just ran into this issue and after looking at the source found that the Messages_0_Id needed to have a row added to it if it was empty.

if((select count(*) from [SignalR].Messages_0_Id) = 0)
begin
    Insert into  [SignalR].Messages_0_Id (PayloadId) values (1)
end
like image 116
Jack Bolding Avatar answered Jan 02 '23 20:01

Jack Bolding