Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49150

Azure VM Agentes plugin does not prevent me using reserved domain names

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: azure-vm-agents-plugin
    • Labels:
      None
    • Environment:
      Linux in a Docker Stack:

        jenkins:
          image: jenkinsci/jenkins:lts
    • Similar Issues:

      Description

      I tried the Azure VM agents plugin today. This looks very promising to scale up and down agents for my project.

       

      After starting a job nothing happened in Blue Ocean. I couldn't find any logs in the old UI or console logs of the build job.

       

      After searching through the jenkins stdout ("docker service logs jenkins_jenkins") I found the hint.

       

      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 10:18:12 PM com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate getCloudStorageAccount
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | INFO: AzureVMManagementServiceDelegate: getCloudStorageAccount: the suffix for contruct CloudStorageCloud is core.windows.net/
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 10:18:12 PM com.microsoft.azure.vmagent.AzureVMAgentCleanUpTask$DeploymentRegistrar registerDeployment
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | INFO: AzureVMAgentCleanUpTask: registerDeployment: Registering deployment windowsbuilder0124221810947 in packerbuilder
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 10:18:13 PM com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate createDeployment
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | SEVERE: AzureVMManagementServiceDelegate: deployment: Unable to deploy
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | com.microsoft.azure.CloudException: Status code 400, {"error":{"code":"InvalidTemplateDeployment","message":"The template deployment 'windowsbuilder0124221810947' is not valid according to the validation procedure. The tracking id is 'uuid'. See inner errors for details. Please see https://aka.ms/arm-deploy for usage details.","details":[{"code":"DomainNameLabelReserved","message":"The domain name label windowsbuilder1f1be0 is invalid. The name itself or part of the name is a reserved word such as a trademark. Please use a different name.","details":[]}]}}: The template deployment 'windowsbuilder0124221810947' is not valid according to the validation procedure. The tracking id is 'uuid'. See inner errors for details. Please see https://aka.ms/arm-deploy for usage details.
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at sun.reflect.GeneratedConstructorAccessor321.newInstance(Unknown Source)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.rest.ServiceResponseBuilder.build(ServiceResponseBuilder.java:122)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.AzureResponseBuilder.build(AzureResponseBuilder.java:56)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentsInner.beginCreateOrUpdateDelegate(DeploymentsInner.java:540)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentsInner.access$200(DeploymentsInner.java:46)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentsInner$14.call(DeploymentsInner.java:526)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentsInner$14.call(DeploymentsInner.java:522)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.Subscriber.setProducer(Subscriber.java:211)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.Observable.unsafeSubscribe(Observable.java:10142)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.Observable.subscribe(Observable.java:10238)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.Observable.subscribe(Observable.java:10205)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:444)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentsInner.beginCreateOrUpdate(DeploymentsInner.java:457)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentImpl.beginCreate(DeploymentImpl.java:303)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.management.resources.implementation.DeploymentImpl.beginCreate(DeploymentImpl.java:39)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.createDeployment(AzureVMManagementServiceDelegate.java:369)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.createDeployment(AzureVMManagementServiceDelegate.java:167)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMAgentTemplate.provisionAgents(AzureVMAgentTemplate.java:806)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$3.call(AzureVMCloud.java:790)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$3.call(AzureVMCloud.java:786)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.lang.Thread.run(Thread.java:748)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | 
      

       

      After that I have checked my settings and it seems that 

       

      -> Add Azure Virtual Machine Template

        -> General Configuration

          ->  Name mustn't be something like "windowsbuilder"

       

      Oh, now I can see that my cloud has two 

       

      I've renamed it to "packerbuilderwin" and now it seems it creates a VM in Azure.

      But after over 20 minutes still no progress in Blue Ocean UI.

       

       

      Next log file snippet from Jenkins output

       

      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | com.microsoft.azure.vmagent.exceptions.AzureCloudException: AzureVMCloud: createProvisionedAgent: Deployment Failed: Microsoft.Compute/virtualMachines:packerbuilderwin3e3000 - BadRequest - {error={code=InvalidParameter, target=adminUsername, message=The Admin Username specified is not allowed.}}
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.exceptions.AzureCloudException.create(AzureCloudException.java:37)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud.createProvisionedAgent(AzureVMCloud.java:609)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:833)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:810)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.lang.Thread.run(Thread.java:748)
      jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | 
      
      

       

      During the setup dialogs I entered "admin" and a long password for the Windows and Linux agent

       

      Please add some more checks into the input fields of this plugin to catch such mistakes in the UI.

       

       

        Attachments

          Activity

          Hide
          stefanscherer Stefan Scherer added a comment - - edited

          Next pitfall. The name for windows machines has another constraint that should be checked in the UI. In the Jenkins UI it isn't really visible which field will be part of the hostname.

          I also clicked the "verify template" button, but there was no error in the UI.

          I entered "packerwin02" as Name.

          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 11:24:34 PM okhttp3.internal.platform.Platform log
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 11:24:35 PM com.microsoft.azure.vmagent.AzureVMCloud$4 call
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | SEVERE: Failure creating provisioned agent 'packerwin02-73dd10'
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | com.microsoft.azure.vmagent.exceptions.AzureCloudException: AzureVMCloud: createProvisionedAgent: Deployment Failed: Microsoft.Compute/virtualMachines:packerwin02-73dd10 - BadRequest - {error={code=InvalidParameter, target=computerName, message=Windows computer name cannot be more than 15 characters long, be entirely numeric, or contain the following characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \ | ; : . ' " , < > / ?.}}
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.exceptions.AzureCloudException.create(AzureCloudException.java:37)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud.createProvisionedAgent(AzureVMCloud.java:609)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:833)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:810)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.lang.Thread.run(Thread.java:748)
          jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | 
           
          
          
          Show
          stefanscherer Stefan Scherer added a comment - - edited Next pitfall. The name for windows machines has another constraint that should be checked in the UI. In the Jenkins UI it isn't really visible which field will be part of the hostname. I also clicked the "verify template" button, but there was no error in the UI. I entered "packerwin02" as Name. jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 11:24:34 PM okhttp3.internal.platform.Platform log jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path? jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | Jan 24, 2018 11:24:35 PM com.microsoft.azure.vmagent.AzureVMCloud$4 call jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | SEVERE: Failure creating provisioned agent 'packerwin02-73dd10' jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | com.microsoft.azure.vmagent.exceptions.AzureCloudException: AzureVMCloud: createProvisionedAgent: Deployment Failed: Microsoft.Compute/virtualMachines:packerwin02-73dd10 - BadRequest - {error={code=InvalidParameter, target=computerName, message=Windows computer name cannot be more than 15 characters long , be entirely numeric, or contain the following characters: ` ~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \ | ; : . ' " , < > / ?.}} jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.exceptions.AzureCloudException.create(AzureCloudException.java:37) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud.createProvisionedAgent(AzureVMCloud.java:609) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:833) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at com.microsoft.azure.vmagent.AzureVMCloud$4.call(AzureVMCloud.java:810) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.FutureTask.run(FutureTask.java:266) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | at java.lang. Thread .run( Thread .java:748) jenkins_jenkins.1.ozh3u08dltx9@packerbuilder    | 
          Hide
          azure_devops Azure DevOps added a comment -

          Fixed in 0.7.0

          Show
          azure_devops Azure DevOps added a comment - Fixed in 0.7.0

            People

            • Assignee:
              zackliu Chenyang Liu
              Reporter:
              stefanscherer Stefan Scherer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: