Cannot change the number of Concurrent Stages for an Agent

Hello,

I have encountered what seems to be a bug in Continua CI 1.9.2.580 (and earlier) when trying to change the number of concurrent stages for an agent.

After confirming a new value for the number of concurrent stages of an Agent by means of the [Edit] link in the Concurrent Stages column of the Home/CI/Administration/Agents view, the entered value is not accepted. Instead the following error message is displayed: Unexpected error reported from server: Unable to cast object of type ‘System.Boolean’ to type ‘System.String’.

What follows is the related event log entry:


Web

The web server reported the following error:
Exception: FaultException`1

Message: Unable to cast object of type ‘System.Boolean’ to type ‘System.String’.

Stack Trace:
Server stack trace:
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.SetConcurrentStages(Guid agentId, Int32 value)
at Continua.Web.Builds.Controllers._AgentsController.<>c__DisplayClass18_0.b__0(IAgentRegistrationService x)
at Continua.Web.ContinuaController.With[TService](Action1 action, Nullable1 operationTimout)
at Continua.Web.Builds.Controllers._AgentsController.SetLimit(Guid agentId, Int32 limit)

Service Exception Details

Exception: InvalidCastException

Message: Unable to cast object of type ‘System.Boolean’ to type ‘System.String’.

Stack Trace: at System.ComponentModel.DataAnnotations.StringLengthAttribute.IsValid(Object value)
at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
at System.ComponentModel.DataAnnotations.ValidationAttribute.GetValidationResult(Object value, ValidationContext validationContext)
at System.ComponentModel.DataAnnotations.Validator.TryValidate(Object value, ValidationContext validationContext, ValidationAttribute attribute, ValidationError& validationError)
at System.ComponentModel.DataAnnotations.Validator.GetValidationErrors(Object value, ValidationContext validationContext, IEnumerable1 attributes, Boolean breakOnFirstError) at System.ComponentModel.DataAnnotations.Validator.GetObjectPropertyValidationErrors(Object instance, ValidationContext validationContext, Boolean validateAllProperties, Boolean breakOnFirstError) at System.ComponentModel.DataAnnotations.Validator.GetObjectValidationErrors(Object instance, ValidationContext validationContext, Boolean validateAllProperties, Boolean breakOnFirstError) at System.ComponentModel.DataAnnotations.Validator.TryValidateObject(Object instance, ValidationContext validationContext, ICollection1 validationResults, Boolean validateAllProperties)
at Continua.Core.EntityValidation.DataAnnotationsValidator.TryValidateObjectRecursive[T](T obj, List1 results, ISet1 validatedObjects, IDictionary2 validationContextItems) at Continua.Core.EntityValidation.DataAnnotationsValidator.TryValidateObjectRecursive[T](T obj, List1 results, IDictionary2 validationContextItems) at Continua.Core.EntityValidation.Validation.Validate[T](T instance, List1& results)
at Continua.Core.EntityValidation.Validation.ValidateOrThrow[T](T instance)
at Continua.Modules.Builds.Agents.ServerAgentManager.UpdateRegisteredAgent(RegisteredAgent agent)
at Continua.Modules.Builds.Services.AgentRegistrationService.SetConcurrentStages(Guid agentId, Int32 value)

This event has been reported 3 times.

N.B.: If you need more information, please let me know.

Kind regards,

Gerrit Jan

Hi Gerrit,

Thank you for reporting this bug. We have reproduced it and implemented a fix. In v1.9.2.554, a property type was modified without changing the associated validation attribute. We’ll release a new version with a fix tomorrow.

Hello Dave,

Thanks for the quick reply.
And fix of course :slight_smile:

Kind regards,

Gerrit Jan