# Cannot change the number of Concurrent Stages for an Agent

**URL:** <https://www.finalbuilder.com/forums/t/cannot-change-the-number-of-concurrent-stages-for-an-agent/7017>\
**Category:** Bugs\
**Tags:** continua-ci, fixed\
**Created:** [April 8, 2021, 12:32pm UTC](https://www.finalbuilder.com/forums/t/cannot-change-the-number-of-concurrent-stages-for-an-agent/7017 "2021-04-08T12:32:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjdoornink](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/58956e/32.png) [@gjdoornink](https://www.finalbuilder.com/forums/u/gjdoornink)\
**Post date:** [April 8, 2021, 12:32pm UTC](https://www.finalbuilder.com/forums/t/cannot-change-the-number-of-concurrent-stages-for-an-agent/7017/1 "2021-04-08T12:32:21Z")

</div>

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](Action`1 action, Nullable`1 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, IEnumerable`1 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, ICollection`1 validationResults, Boolean validateAllProperties)  
at Continua.Core.EntityValidation.DataAnnotationsValidator.TryValidateObjectRecursive[T](T obj, List`1 results, ISet`1 validatedObjects, IDictionary`2 validationContextItems) at Continua.Core.EntityValidation.DataAnnotationsValidator.TryValidateObjectRecursive[T](T obj, List`1 results, IDictionary`2 validationContextItems) at Continua.Core.EntityValidation.Validation.Validate[T](T instance, List`1& 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

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [April 8, 2021, 1:18pm UTC](https://www.finalbuilder.com/forums/t/cannot-change-the-number-of-concurrent-stages-for-an-agent/7017/2 "2021-04-08T13:18:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gjdoornink](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/g/58956e/32.png) [@gjdoornink](https://www.finalbuilder.com/forums/u/gjdoornink)\
**Post date:** [April 8, 2021, 1:19pm UTC](https://www.finalbuilder.com/forums/t/cannot-change-the-number-of-concurrent-stages-for-an-agent/7017/3 "2021-04-08T13:19:47Z")

</div>

Hello Dave,

Thanks for the quick reply.  
And fix of course 🙂

Kind regards,

Gerrit Jan
