Quantities must match the regular expression

Hi there. I m trying to make my first deployment on Octopus Cloud. But I get this error when in the deployment process. I couldn’t get where am I doing something wrong or do I miss something?

The request is invalid: patch: Invalid value: "map[metadata:map[annotations:map[kubectl.kubernetes.io/last-applied-configuration:{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"Octopus.Action.Id\":\"6ddf76b2-8e6e-4dff-a99b-b37f655e4db9\",\"Octopus.Deployment.Id\":\"deployments-8\",\"Octopus.Deployment.Tenant.Id\":\"untenanted\",\"Octopus.Environment.Id\":\"environments-1\",\"Octopus.Kubernetes.DeploymentName\":\"service-template\",\"Octopus.Kubernetes.SelectionStrategyVersion\":\"SelectionStrategyVersion2\",\"Octopus.Project.Id\":\"projects-1\",\"Octopus.RunbookRun.Id\":\"\",\"Octopus.Step.Id\":\"64e1bd15-cbf2-4464-b4da-e0e556228996\"},\"name\":\"service-template\",\"namespace\":\"default\"},\"spec\":{\"progressDeadlineSeconds\":240,\"replicas\":3,\"selector\":{\"matchLabels\":{\"Octopus.Kubernetes.DeploymentName\":\"service-template\"}},\"strategy\":{\"type\":\"RollingUpdate\"},\"template\":{\"metadata\":{\"labels\":{\"Octopus.Action.Id\":\"6ddf76b2-8e6e-4dff-a99b-b37f655e4db9\",\"Octopus.Deployment.Id\":\"deployments-8\",\"Octopus.Deployment.Tenant.Id\":\"untenanted\",\"Octopus.Environment.Id\":\"environments-1\",\"Octopus.Kubernetes.DeploymentName\":\"service-template\",\"Octopus.Kubernetes.SelectionStrategyVersion\":\"SelectionStrategyVersion2\",\"Octopus.Project.Id\":\"projects-1\",\"Octopus.RunbookRun.Id\":\"\",\"Octopus.Step.Id\":\"64e1bd15-cbf2-4464-b4da-e0e556228996\"}},\"spec\":{\"affinity\":{},\"containers\":[{\"env\":[{\"name\":\"ASPNETCORE_URLS\",\"value\":\"http://+:80\"},{\"name\":\"ASPNETCORE_ENVIRONMENT\",\"value\":\"#{Enviroments}\"}],\"envFrom\":[],\"image\":\"552403543468.dkr.ecr.eu-central-1.amazonaws.com/service-template:2022-02-11-12.sha-23a4d5\",\"imagePullPolicy\":\"Always\",\"name\":\"app-container-image\",\"ports\":[{\"containerPort\":80,\"name\":\"exposed-port\",\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"cpu\":0.1,\"memory\":\"#{Memory Limit}\"}},\"securityContext\":{}}],\"dnsConfig\":{},\"imagePullSecrets\":[{\"name\":\"octopus-feedcred-feeds-1001\"}]}}}}\n] labels:map[Octopus.Action.Id:6ddf76b2-8e6e-4dff-a99b-b37f655e4db9 Octopus.Deployment.Id:deployments-8 Octopus.Deployment.Tenant.Id:untenanted Octopus.Environment.Id:environments-1 Octopus.Kubernetes.DeploymentName:service-template Octopus.Kubernetes.SelectionStrategyVersion:SelectionStrategyVersion2 Octopus.Project.Id:projects-1 Octopus.RunbookRun.Id: Octopus.Step.Id:64e1bd15-cbf2-4464-b4da-e0e556228996]] spec:map[progressDeadlineSeconds:240 selector:map[matchLabels:map[Octopus.Kubernetes.DeploymentName:service-template app:<nil>]] strategy:map[] template:map[metadata:map[labels:map[Octopus.Action.Id:6ddf76b2-8e6e-4dff-a99b-b37f655e4db9 Octopus.Deployment.Id:deployments-8 Octopus.Deployment.Tenant.Id:untenanted Octopus.Environment.Id:environments-1 Octopus.Kubernetes.DeploymentName:service-template Octopus.Kubernetes.SelectionStrategyVersion:SelectionStrategyVersion2 Octopus.Project.Id:projects-1 Octopus.RunbookRun.Id: Octopus.Step.Id:64e1bd15-cbf2-4464-b4da-e0e556228996 app:<nil>]] spec:map[affinity:map[] dnsConfig:map[] imagePullSecrets:[map[name:octopus-feedcred-feeds-1001]]]]]]": quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'

Hi @sercan,

Thanks for reaching out!

Apologies, could you go into more detail about where and how you’re experiencing this error?

Which Octopus Step and which field within it are you entering the value?

Are you able to send some screenshots to show the process page displaying the error and some of the values you’ve entered?

If necessary, I can make this thread private, or you can DM them to me if they contain sensitive data; otherwise, feel free to post them as a reply to the thread.

Hopefully, we can get you sorted out and get your deployment process how you’d like!

Kind Regards,

Hi again Adam

Thank you for your answer again. I will send you the screenshots by DM.

Hi @sercan,

Thanks for sending over the screenshots!

It looks as though the deployment that you’ve configured is using one of our Dynamic Workers as the deployment target.

As this is a deployment to a Kubernetes Cluster, you should first register your Kubernetes Cluster as a target within Octopus, and then use that cluster as the deployment target for the step via Role assignment.

If you haven’t seen it already, we have some documentation on configuring these targets here: Kubernetes Cluster - Deployment Target.

During configuration, you can apply role(s) to the cluster, you would then reference the role(s) in your deployment process step to run on that target.

I hope this helps! Let me know if I’ve missed anything and how it goes trying this out, please!

Kind Regards,

Hi @adam.hollow

Thank your for your kind answers.

Actually, I have a deployment target that has a healthy status that I connected to my EKS cluster.

Do you mean I didn’t define it in my deployment process and did something wrong? Cause I couldn’t see where I used dynamic workers rather than deployment target. If you could explain to me or show any documentation to change it to my deployment target, it would be great for me

As I see my trial deployments made by my deployment target

Hi @sercan,

Thanks for getting back to me!

My apologies, it does appear that you’ve configured everything correctly…

Do you mind if I create a support user on your instance so that I may look around, please?

Kind Regards,

Yes, please. It would be so helpful

Hi @sercan,

I’ve had a further look at your instance. Other than the issue that I DM’ed you about, I think the main problem is that you’ve been re-deploying the initial release instead of creating a new release after making changes to the deployment process.

For Octopus to deploy updated deployment process changes and template parameters, you must create a new release to pull the new process and variables through.

If you’re able to make the change within the Step Template for the #{Environment} variable that I mentioned in my private message, you should be able to Update the Step Template for that project.

Once you’ve done that, create a new release and deploy it; it should deploy successfully with any luck.

The root cause of the issue appeared to be that Octopus couldn’t evaluate two variables, causing syntax errors in the YAML. The two variables I believe were causing the problem are:

  • #{Memory Limit} (this was due to a new release not being created after the process was modified in the project)
  • #{Environment} (this is due to a typo in the step template under the “containers” section, causing Octopus to be unable to assign a value)

I hope this helps! Please let me know if you can resolve the issue with the information above or if you’re still running into errors.

Kind Regards,

Hi Adam

Thank you for your answer and advices. I applied all and we fixed most of the problems. But we still have some problems within the same deployment that I couldn’t solve. I will send you all information by DM. If you need to create a support account to check please feel free

Hey @sercan!

Thanks for getting back to us and sending over that information.

I’ll look into it and see what I can find, then get back to you.

Kind Regards,

Actually - something that would be beneficial and may help diagnose the problem better.

Can you try running a deployment with variable logging enabled?
From the log it looks as though some variables aren’t being correctly evaluated:

08:44:58 Info | The Secret resource description: kubectl describe secret #{Octopus.Action.KubernetesContainers.SecretName}-deployments-23
08:44:58 Error | Error from server (NotFound): secrets “#{Octopus.Action.KubernetesContainers.SecretName}-deployments-23” not found

With variable logging enabled, we can see exactly which variables aren’t being assigned values.

You can see some docs on how to do this here: Variable Logging | Octopus Docs.
You simply need to add a couple of variables to the project, then create a new release and send over the task log.

Let me know if this is okay, please!

Kind Regards,

Hi Adam

Thank your for your response again. Actuall i dont use secrets or config map. I saw it is enabled in my template settings after i sent message to you. But than i remove them and tried again. But still got the same situation

Hey again @sercan,

Thanks for letting me know!

I wonder, did you create a new release before trying again?
Process changes don’t get pushed to already created releases, in order to preserve the deployment process for that particular version.

I still believe that variable logging may help us identify the errors better, would you be able to give that a try anyway?

Thanks and Kind Regards,

Hi Adam

Yes mate every sinle deployment i create new release. I always keep your advice in my mind. Also i enabled the logging parameter in project variables as in the document. But it didt give more details. I still got log. Just without sectret and configmap error.


No worries! Are you able to send over the log for the most recent deployment you’ve tried?

Kind Regards,

Hey @sercan,

I’ve had further look since our last discussion via DMs.

I’ve noticed in your task log the following:
Warning FailedScheduling 20s (x11 over 10m) default-scheduler 0/3 nodes are available: 3 Insufficient cpu.

It seems as though the cluster is either using too many resources to fulfil the deployment or doesn’t contain enough resources to support it.

Are you able to increasing the node size on the cluster or trim any current usage that’s not required to see if the deployment can succeed?

Kind Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.