Quartz.Net failed on server - .net-6.0

I have quartz jobs configured in .Net6 web application. Jobs runs correctly on local computer but site crashes when deployed to server.
both local and server computers have runtime 6.0.10 installed.
I see below error in logs.
System.ArgumentException: cronExpression cannot be null
at Quartz.CronExpression..ctor(String cronExpression)
at Quartz.CronExpression.ValidateExpression(String cronExpression)
at Quartz.CronScheduleBuilder.CronSchedule(String cronExpression)
at Quartz.TriggerExtensions.WithCronSchedule(ITriggerConfigurator triggerBuilder, String cronExpression, Action`1 action)
at Pcc.Preferences.App.Startup.<ConfigureQuartz>b__16_4(ITriggerConfigurator trigger) in /home/vsts/work/1/s/Source/v2/Application/Startup.cs:line 455
at Quartz.ServiceCollectionExtensions.ScheduleJob[T](IServiceCollectionQuartzConfigurator options, Action`1 trigger, Action`1 job)
at Pcc.Preferences.App.Startup.<ConfigureQuartz>b__16_1(IServiceCollectionQuartzConfigurator quartz) in /home/vsts/work/1/s/Source/v2/Application/Startup.cs:line 454
at Quartz.ServiceCollectionExtensions.AddQuartz(IServiceCollection services, NameValueCollection properties, Action`1 configure)
at Quartz.ServiceCollectionExtensions.AddQuartz(IServiceCollection services, Action`1 configure)

Answered here. Sad to see such cross-posting.

Related

Self-contained win-x64 executable AggregateException: Connection actively refused

I am trying to publish a self-contained executable for Windows. When I try to run the executable via a privileged powershell (or cmd) window, I get the following error:
Unhandled exception. System.AggregateException: One or more errors occurred. (No connection could be made because the target machine actively refused it.)
---> System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it.
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at myProgram.Client.postClaim(Claim Claim, Byte[]& var1, Byte[]& var2, Byte[]& var3)
at myProgram.Program.Main(String[] args)
If it's relevant, on that line, I am connecting to a tomcat-hosted server on another machine.
What is strange, is that when I publish a non-standalone app, I don't get the error. The application runs successfully to completion. I also don't get the error when I run the program in debug mode from within visual studio. Additionally, I've built a self-contained executable for linux-x64, and that was able to run successfully from a linux machine.
I've tried disabling Windows Defender firewall, and similar programs. However, since the program runs fine in those other cases, I'm thinking it's not a firewall issue.
Is there a problem with self-contained executables? Is there something I'm missing before running the self-contained executable on windows? I'm at a loss on how to solve this issue.

Websocket SignalR does not start

I just deployed a MVC web app to my windows server 2012. It has Windows 8 and IIS v8 installed. The application uses SignalR, and I would like to use websockets, but it gives errors.
In every browser (chrome ff, ie) the error is the same:
"NetworkError: 500 Internal Server Error - https://domain.com/signalr/connect?transport=webSockets&connectionToken=wiiR333%2BkbKu0Ex2SPZLE9W9X6eAm5lBssbjXbqCvl0QpjAiGtHkn1xiIQHYGi3O4DDLIv7whTahVb8Ll5kfwjnrzaZaDYCApWj5aWm6d1cZzxH89K%2BouHziBH7dCt9I&connectionData=%5B%7B%22name%22%3A%22charthub%22%7D%5D&tid=8"
The detailed error message would be:
Exception information:
Exception type: InvalidOperationException
Exception message: Not a valid web socket request.
at Microsoft.AspNet.SignalR.Transports.WebSocketTransport.AcceptWebSocketRequest(Func`2 callback)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I asked in the SignalR Jabbr chat what the error would be and they told me something is blocking the connections. I checked, and both TCP port 80 and port 443 are listening.
The IIS trust level is Full (internal) and we're not using loadbalancing. The Websockets protocol is installed.
What could be wrong?

Test Rig Azure Controller cannot connect to Visual Studio Client

I am deploying a test rig as per the directions from http://msdn.microsoft.com/en-us/library/windowsazure/hh674491.aspx with the controller and agents hosted on windows azure. I have followed all the directions properly and my VS client is able to see the controller and agents. However when i execute a load test, the test remains in an pending state and I see the below error in the Controller's eventlog. My problem is similar to one found at: http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/4040619f-5667-4445-804a-84f37d823c9f/. Please help!
(QTController.exe, PID 692, Thread 11) ControllerDeployment.DoDeployment: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [xxx:xxx:xxxx:xxx:xxxx:xxxx:xxxx:220]:6915
Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TestTools.Common.FileCopyService.get_DeploymentFlags()
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.b__6(FileCopyService fileCopyService)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer1.InvokeAsRemoteUser(Action1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.DoDeployment()
Based on the error message it looks like the controller is not able to talk to the agent. Have you set up a connect group as mentioned below:
"http://msdn.microsoft.com/en-us/library/windowsazure/hh674497.aspx"
Creating a Connect Group
The Connect feature of Azure allows you to create a Virtual Private Network. Members of the group can include on-premise computers as well as Azure role instances. For the Load Test solution, the Connect group allows communication between the test controller and the agents.
Attempted this as well, and couldn't get it to work. Ended up having to move the Controller into Azure as well.
I followed the documentation as far as what ports the agent needed, and opened those up in the Azure firewall. However, after doing a network capture, IIRC it also used some dynamic ports that weren't going to work to open up.
So I found that I had to move Visual Studio, the Load Agent Controller, and the Load Agents themselves all into Azure to utilize this in the cloud.

Azure AppFabric caching. ErrorCode<ERRCA0017>:SubStatus<ES0006>

there is a very strange thing going on
i have a web site made in MVC 3 deployed in an Azure WebRole
it was running fine and originally was made in VS2010
now i use VS2012
i decided to make some minor changes and it appeared to be working but keeps break down at random intervals
this is what is happening
after random intervals i get this error ErrorCode<ERRCA0017>:SubStatus<ES0006>
after 2-3 minutes of getting this error sites appears to be working fine
i havent changed anything from the previous version of the site related to caching
this error does nt happens when i test it in staging or in local environment
no where in my code im accessing this cache programmatically
i have copy-pasted entire configuration as it is from the azure portal and i know it it correct because these are the same configuration settings that were working before
i just using Azure AppFabric Caching because i need to save sessions some where. so the only place it is ever mentioned is in my websites web config and as i have told all the configuration can be assumed to be correct.
this is the stacktrace if this can be of some help
[DataCacheException: ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)]
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody) +616
Microsoft.ApplicationServer.Caching.DataCache.ExecuteAPI(RequestBody reqMsg, IMonitoringListener listener) +29
Microsoft.ApplicationServer.Caching.DataCache.InternalGetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle, String region, Boolean lockKey, IMonitoringListener listener) +227
Microsoft.ApplicationServer.Caching.<>c__DisplayClass78.<GetAndLock>b__77() +103
Microsoft.ApplicationServer.Caching.DataCache.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +258
Microsoft.Web.DistributedCache.<>c__DisplayClass31`1.<PerformCacheOperation>b__30() +19
Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action) +208
Microsoft.Web.DistributedCache.DataCacheForwarderBase.GetAndLock(String key, TimeSpan timeout, DataCacheLockHandle& lockHandle) +190
Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.GetItem(HttpContextBase context, String id, Boolean acquireWriteLock, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +593
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +125
System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1076
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +115
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375
UPDATE:-
suddenly i discovered a new error which seems to me as one of the inner errors many sites talk about
error description
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [IP-Address]:[PORT]
and this is the new stack trace
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [IP-ADDRESS]:[PORT]]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +162
System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) +774
[EndpointNotFoundException: Could not connect to [SOCKET-ENDPOINT]. The connection attempt lasted for a time span of 00:00:21.0308462. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.221.89.111:22233. ]
System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +518
System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +401
Microsoft.ApplicationServer.Caching.OpenDelegate.EndInvoke(IAsyncResult result) +0
Microsoft.ApplicationServer.Caching.ChannelContainer.Opened(IAsyncResult ar) +122
There was an interesting blog post about this error over a year ago: Azure AppFabric Caching - ErrorCode:SubStatus : What to do?.
Before intializing the DataCacheFactory modify the
DataCacheFactoryConfiguration.ChannelOpenTimeout of the
dataCacheFactoryConfiguration instance that you are using to a larger
value of 2 minutes. (can't use configuration to set the value, since
20 seconds in the allowed limit) . Also, this recommendation is only
for debugging purposes and ideally should not be needed in production
environments. This lets the underlying layer to respond back with the actual error
that occurred. Now, if you check the inner exception, you should see
what caused the request to fail.
Please follow these steps to find the inner exception which will explain why the request fails.
Note: If this is caused by a transient fault, you should consider using the Transient Fault Handling Application Block (which also supports AppFabric Cache) in order to implement a retry policy.

CommunicationObjectFaultedException when debugging Azure

When attempting to start the debugger on an otherwise perfectly functional Azure project, what can cause the following exception to occur?
System.ServiceModel.CommunicationObjectFaultedException
was unhandled Message=The
communication object,
System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication
because it is in the Faulted state.
Source=mscorlib StackTrace:
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan
timeout)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at System.ServiceModel.ICommunicationObject.Close(TimeSpan
timeout)
at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan
timeout)
at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[]
args) InnerException:
For me, the problem was that my startup project for debugging was set to the package project (i.e. the project containing the service definition files) rather than one of my web roles. (This got reset when I changed machines.) Right-clicking on a web role and selecting "Set as StartUp Project" fixed the error.
In case you don't notice the comment above, #smarx also mentions that a common cause for the same error is a read-only web.config file and points to http://msdn.microsoft.com/en-us/library/gg494981.aspx. That same link mentions a couple other related causes too.

Resources