1.0.0.472 - Agents cannot connect to Server

Hi,

There appears to be some issues in the latest beta in Agent connections. The agent diagnostics shows the following stack trace when the agent attempts to register to the server:

[Registration] Could not register agent with Continua server, will try again in 1 minute.
Reason: System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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 Continua.Modules.Builds.Common.Services.Contracts.IAgentRegistrationService.Register(String hostname, Int32 port, String version)
   at Continua.Modules.Builds.Agent.RegistrationController.Register()
[Registration] Could not register agent with Continua server, will try again in 1 minute.
Reason: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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 Continua.Modules.Builds.Common.Services.Contracts.IAgentRegistrationService.Register(String hostname, Int32 port, String version)
   at Continua.Modules.Builds.Agent.RegistrationController.Register()

Did you update the agents recently? I think recent builds changed the agent service interfaces to add agent version reporting (the agents view now shows when agents are too old etc).

Posted By Vincent Parrett on 31 May 2012 02:42 AM
Did you update the agents recently? I think recent builds changed the agent service interfaces to add agent version reporting (the agents view now shows when agents are too old etc).

I updated the agents to build 461, and they worked ok. After updating the Server and Agents to 472 this came up.

Might this be somehow related to my failed attempt to create the agent property, as the server stack trace mentions something concerning that property being null?

[Unhandled Service Exception] Exception: PropertyValueException
Message: not-null property references a null or transient value Continua.Modules.Builds.Agents.AgentProperty.Value
Stack Trace:    at NHibernate.Engine.Nullability.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate)
   at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event)
   at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event)
   at NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj)
   at NHibernate.Engine.Cascade.CascadeToOne(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled)
   at NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled)
   at NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, CascadeStyle style, Object anything, CollectionType type)
   at NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything)
   at NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource session, IEntityPersister persister, Object key, Object anything)
   at NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at NHibernate.Transaction.AdoTransaction.Commit()
   at Continua.Data.Hibernate.NHibernateDatabase.CommitTransaction()
   at Continua.Modules.Builds.Agents.AgentManager.UpdatePropertiesForAgent(RegisteredAgent agent)
   at Continua.Modules.Builds.Agents.AgentManager.Register(String address, String hostname, Int32 port, String version)
   at Continua.Modules.Builds.Services.AgentRegistrationService.Register(String hostname, Int32 port, String version)
   at SyncInvokeRegister(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)


Checking the Diagnostics more thoroughly I noted that in addition to the one in previous message the Server also logs this:

[Unhandled Service Exception] Exception: CommunicationException
Message: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘00:00:10’.
Stack Trace:    at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
   at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)
   at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)
   at System.ServiceModel.Channels.FramingDuplexSessionChannel.Receive(TimeSpan timeout)
   at System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
   at System.ServiceModel.Channels.InputChannelWrapper.TryReceive(TimeSpan timeout, Message& message)
   at System.ServiceModel.Channels.ServerReliableChannelBinder1.DuplexServerReliableChannelBinder1.OnTryReceive(TDuplexChannel channel, TimeSpan timeout, RequestContext& requestContext)
   at System.ServiceModel.Channels.ReliableChannelBinder`1.TryReceive(TimeSpan timeout, RequestContext& requestContext, MaskingMode maskingMode)
   at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecuritySessionChannel.TryReceiveRequest(TimeSpan timeout, RequestContext& requestContext)
   at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecuritySessionChannel.TryReceive(TimeSpan timeout, Message& message)
   at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecurityDuplexSessionChannel.WaitForInputSessionClose(TimeSpan timeout, Boolean& wasAborted)
   at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecurityDuplexSessionChannel.OnClose(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnClose(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.MessageRpc.CloseChannel()

Exception: SocketException
Message: An existing connection was forcibly closed by the remote host
Stack Trace:    at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

Both the server and the agents are at the most recent build.

Hi Olli,

We’ve just checked in a fix to prevent that error with agent properties, it’ll be in the next build which we’ll hopefully get out today. That should resolve the issue you’re seeing with agents.

Regards,
Paul.

I can confirm that the most recent beta resolved these issues for us.