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

New plugin doesn't work with existing credentials

    Details

    • Similar Issues:

      Description

      Upgraded ci.jenkins.io and now we're seeing the previous configuration fail to verify on "Verify Configuration" with:

      "Error: OAuth 2.0 Token Endpoint is malformed"

      The System log is filled with this:

      Invalid virtual machine image
      java.lang.IllegalArgumentException: 'authority' Uri should have at least one segment in the path (i.e. https://<host>/<path>/...)
      	at com.microsoft.aad.adal4j.AuthenticationAuthority.detectAuthorityType(AuthenticationAuthority.java:190)
      	at com.microsoft.aad.adal4j.AuthenticationAuthority.<init>(AuthenticationAuthority.java:73)
      	at com.microsoft.aad.adal4j.AuthenticationContext.<init>(AuthenticationContext.java:108)
      	at com.microsoft.azure.credentials.ApplicationTokenCredentials.acquireAccessToken(ApplicationTokenCredentials.java:209)
      	at com.microsoft.azure.credentials.ApplicationTokenCredentials.getToken(ApplicationTokenCredentials.java:196)
      	at com.microsoft.azure.credentials.AzureTokenCredentialsInterceptor.intercept(AzureTokenCredentialsInterceptor.java:42)
      	at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
      	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
      	at okhttp3.RealCall.execute(RealCall.java:57)
      	at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
      	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
      	at rx.Subscriber.setProducer(Subscriber.java:211)
      	at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
      	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
      	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
      	at rx.Observable.unsafeSubscribe(Observable.java:9861)
      	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      	at rx.Observable.subscribe(Observable.java:9957)
      	at rx.Observable.subscribe(Observable.java:9924)
      	at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:445)
      	at rx.observables.BlockingObservable.single(BlockingObservable.java:342)
      	at com.microsoft.azure.management.compute.implementation.VirtualMachineImagesInner.listPublishers(VirtualMachineImagesInner.java:462)
      	at com.microsoft.azure.management.compute.implementation.VirtualMachinePublishersImpl.listByRegion(VirtualMachinePublishersImpl.java:49)
      	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.verifyVirtualMachineImage(AzureVMManagementServiceDelegate.java:1310)
      	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$4.call(AzureVMManagementServiceDelegate.java:1178)
      	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$4.call(AzureVMManagementServiceDelegate.java:1174)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
      Mar 03, 2017 10:58:37 PM INFO com.microsoft.azure.vmagent.AzureVMCloudVerificationTask execute
      AzureVMCloudVerificationTask: execute: win2012-jenkinsinfra could not be verified:
      Failed to validate the provided image reference: 'authority' Uri should have at least one segment in the path (i.e. https://<host>/<path>/...)
      The storage account name already exists. Use a different name.
      

        Attachments

          Activity

          Hide
          clguiman Claudiu Guiman added a comment -

          Looks like the OAuth token parser returned a bad string. I need the format of the URL to understand better what went wrong.

          Show
          clguiman Claudiu Guiman added a comment - Looks like the OAuth token parser returned a bad string. I need the format of the URL to understand better what went wrong.
          Hide
          clguiman Claudiu Guiman added a comment -

          I think I figured out what went wrong:
          In the new version, Azure Credentials has a new member of type 'Secret'. While testing, that member was intialized to null, but for some reason, now, it started to get initialized to empty string.
          I've fixed that and also made http URLs valid in the new Azure Credentials plugin (https://github.com/jenkinsci/azure-credentials-plugin/commit/f6659252e3d531ea927c76c06f86f80ebe0ae9fd)
          The plugin should be release in a few days and VMAgents will start consuming it very soon after

          Show
          clguiman Claudiu Guiman added a comment - I think I figured out what went wrong: In the new version, Azure Credentials has a new member of type 'Secret'. While testing, that member was intialized to null, but for some reason, now, it started to get initialized to empty string. I've fixed that and also made http URLs valid in the new Azure Credentials plugin ( https://github.com/jenkinsci/azure-credentials-plugin/commit/f6659252e3d531ea927c76c06f86f80ebe0ae9fd) The plugin should be release in a few days and VMAgents will start consuming it very soon after
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Claudiu Guiman
          Path:
          README.md
          pom.xml
          src/main/java/com/microsoft/azure/util/AzureCredentials.java
          src/main/java/com/microsoft/azure/vmagent/AzureVMCloud.java
          src/main/resources/com/microsoft/azure/util/AzureCredentials/credentials.jelly
          src/main/webapp/help-authenticationEndpoint.html
          src/main/webapp/help-azureCredentials.html
          src/main/webapp/help-clientId.html
          src/main/webapp/help-clientSecret.html
          src/main/webapp/help-graphEndpoint.html
          src/main/webapp/help-oauth2TokenEndpoint.html
          src/main/webapp/help-resourceManagerEndpoint.html
          src/main/webapp/help-serviceManagementURL.html
          src/main/webapp/help-subscriptionId.html
          http://jenkins-ci.org/commit/azure-vm-agents-plugin/dd6d66d9a08c6e05b2ab3c85301f302d2471293b
          Log:
          Move AzureCredentials in a separate plugin [FIXED JENKINS-42479]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Claudiu Guiman Path: README.md pom.xml src/main/java/com/microsoft/azure/util/AzureCredentials.java src/main/java/com/microsoft/azure/vmagent/AzureVMCloud.java src/main/resources/com/microsoft/azure/util/AzureCredentials/credentials.jelly src/main/webapp/help-authenticationEndpoint.html src/main/webapp/help-azureCredentials.html src/main/webapp/help-clientId.html src/main/webapp/help-clientSecret.html src/main/webapp/help-graphEndpoint.html src/main/webapp/help-oauth2TokenEndpoint.html src/main/webapp/help-resourceManagerEndpoint.html src/main/webapp/help-serviceManagementURL.html src/main/webapp/help-subscriptionId.html http://jenkins-ci.org/commit/azure-vm-agents-plugin/dd6d66d9a08c6e05b2ab3c85301f302d2471293b Log: Move AzureCredentials in a separate plugin [FIXED JENKINS-42479]
          Hide
          rtyler R. Tyler Croy added a comment -

          Still seeing an issue with 0.4.4, but I'll just reconfigure the damned plugin at this point >_<

           

          
          SEVERE: Error validating configuration
          com.microsoft.azure.vmagent.exceptions.AzureCloudException: java.util.concurrent.ExecutionException: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3
          	at com.microsoft.azure.vmagent.util.ExecutionEngine.executeWithRetry(ExecutionEngine.java:48)
          	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.verifyConfiguration(AzureVMManagementServiceDelegate.java:834)
          	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.verifyConfiguration(AzureVMManagementServiceDelegate.java:810)
          	at com.microsoft.azure.vmagent.AzureVMCloudVerificationTask.verifyConfiguration(AzureVMCloudVerificationTask.java:205)
          	at com.microsoft.azure.vmagent.AzureVMCloudVerificationTask.execute(AzureVMCloudVerificationTask.java:99)
          	at hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:101)
          	at java.lang.Thread.run(Thread.java:745)
          Caused by: java.util.concurrent.ExecutionException: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3
          	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
          	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
          	at com.microsoft.azure.vmagent.util.ExecutionEngine.executeWithRetry(ExecutionEngine.java:41)
          	... 6 more
          Caused by: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3
          	at com.microsoft.azure.vmagent.retry.ExponentialRetryStrategy.canRetry(ExponentialRetryStrategy.java:56)
          	at com.microsoft.azure.vmagent.retry.ExponentialRetryStrategy.handleRetry(ExponentialRetryStrategy.java:44)
          	at com.microsoft.azure.vmagent.retry.RetryTask.call(RetryTask.java:52)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	... 1 more
          Caused by: java.lang.IllegalArgumentException: 'authority' Uri should have at least one segment in the path (i.e. https://<host>/<path>/...)
          	at com.microsoft.aad.adal4j.AuthenticationAuthority.detectAuthorityType(AuthenticationAuthority.java:190)
          	at com.microsoft.aad.adal4j.AuthenticationAuthority.<init>(AuthenticationAuthority.java:73)
          	at com.microsoft.aad.adal4j.AuthenticationContext.<init>(AuthenticationContext.java:108)
          	at com.microsoft.azure.credentials.ApplicationTokenCredentials.acquireAccessToken(ApplicationTokenCredentials.java:209)
          	at com.microsoft.azure.credentials.ApplicationTokenCredentials.getToken(ApplicationTokenCredentials.java:196)
          	at com.microsoft.azure.credentials.AzureTokenCredentialsInterceptor.intercept(AzureTokenCredentialsInterceptor.java:43)
          	at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
          	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
          	at okhttp3.RealCall.execute(RealCall.java:57)
          	at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
          	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
          	at rx.Subscriber.setProducer(Subscriber.java:211)
          	at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
          	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
          	at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
          	at rx.Observable.unsafeSubscribe(Observable.java:10142)
          	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
          	at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
          	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
          	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
          	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
          	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
          	at rx.Observable.subscribe(Observable.java:10238)
          	at rx.Observable.subscribe(Observable.java:10205)
          	at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:444)
          	at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
          	at com.microsoft.azure.management.storage.implementation.StorageAccountsInner.getProperties(StorageAccountsInner.java:427)
          	at com.microsoft.azure.management.storage.implementation.StorageAccountsImpl.getByGroup(StorageAccountsImpl.java:52)
          	at com.microsoft.azure.management.storage.implementation.StorageAccountsImpl.getByGroup(StorageAccountsImpl.java:20)
          	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$1.call(AzureVMManagementServiceDelegate.java:828)
          	at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$1.call(AzureVMManagementServiceDelegate.java:823)
          	at com.microsoft.azure.vmagent.retry.RetryTask.call(RetryTask.java:49)
          	... 4 more
          
          Apr 13, 2017 3:43:31 PM com.microsoft.azure.vmagent.AzureVMCloudVerificationTask verifyConfiguration
          INFO: AzureVMCloudVerificationTask: verifyConfiguration: Failed to validate the Azure profile. Verify the subscription Id, client Id and secret, OAUth 2.0 Token Endpoint and the URL information.
          Show
          rtyler R. Tyler Croy added a comment - Still seeing an issue with 0.4.4, but I'll just reconfigure the damned plugin at this point >_<   SEVERE: Error validating configuration com.microsoft.azure.vmagent.exceptions.AzureCloudException: java.util.concurrent.ExecutionException: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3 at com.microsoft.azure.vmagent.util.ExecutionEngine.executeWithRetry(ExecutionEngine.java:48) at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.verifyConfiguration(AzureVMManagementServiceDelegate.java:834) at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate.verifyConfiguration(AzureVMManagementServiceDelegate.java:810) at com.microsoft.azure.vmagent.AzureVMCloudVerificationTask.verifyConfiguration(AzureVMCloudVerificationTask.java:205) at com.microsoft.azure.vmagent.AzureVMCloudVerificationTask.execute(AzureVMCloudVerificationTask.java:99) at hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:101) at java.lang. Thread .run( Thread .java:745) Caused by: java.util.concurrent.ExecutionException: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3 at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.microsoft.azure.vmagent.util.ExecutionEngine.executeWithRetry(ExecutionEngine.java:41) ... 6 more Caused by: com.microsoft.azure.vmagent.exceptions.AzureCloudException: Exceeded maximum retry count 3 at com.microsoft.azure.vmagent.retry.ExponentialRetryStrategy.canRetry(ExponentialRetryStrategy.java:56) at com.microsoft.azure.vmagent.retry.ExponentialRetryStrategy.handleRetry(ExponentialRetryStrategy.java:44) at com.microsoft.azure.vmagent.retry.RetryTask.call(RetryTask.java:52) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ... 1 more Caused by: java.lang.IllegalArgumentException: 'authority' Uri should have at least one segment in the path (i.e. https: //<host>/<path>/...) at com.microsoft.aad.adal4j.AuthenticationAuthority.detectAuthorityType(AuthenticationAuthority.java:190) at com.microsoft.aad.adal4j.AuthenticationAuthority.<init>(AuthenticationAuthority.java:73) at com.microsoft.aad.adal4j.AuthenticationContext.<init>(AuthenticationContext.java:108) at com.microsoft.azure.credentials.ApplicationTokenCredentials.acquireAccessToken(ApplicationTokenCredentials.java:209) at com.microsoft.azure.credentials.ApplicationTokenCredentials.getToken(ApplicationTokenCredentials.java:196) at com.microsoft.azure.credentials.AzureTokenCredentialsInterceptor.intercept(AzureTokenCredentialsInterceptor.java:43) at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163) at okhttp3.RealCall.execute(RealCall.java:57) at retrofit2.OkHttpCall.execute(OkHttpCall.java:174) at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171) at rx.Subscriber.setProducer(Subscriber.java:211) at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102) at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152) at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138) at rx.Observable.unsafeSubscribe(Observable.java:10142) at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48) at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33) at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) at rx.Observable.subscribe(Observable.java:10238) at rx.Observable.subscribe(Observable.java:10205) at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:444) at rx.observables.BlockingObservable.single(BlockingObservable.java:341) at com.microsoft.azure.management.storage.implementation.StorageAccountsInner.getProperties(StorageAccountsInner.java:427) at com.microsoft.azure.management.storage.implementation.StorageAccountsImpl.getByGroup(StorageAccountsImpl.java:52) at com.microsoft.azure.management.storage.implementation.StorageAccountsImpl.getByGroup(StorageAccountsImpl.java:20) at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$1.call(AzureVMManagementServiceDelegate.java:828) at com.microsoft.azure.vmagent.AzureVMManagementServiceDelegate$1.call(AzureVMManagementServiceDelegate.java:823) at com.microsoft.azure.vmagent.retry.RetryTask.call(RetryTask.java:49) ... 4 more Apr 13, 2017 3:43:31 PM com.microsoft.azure.vmagent.AzureVMCloudVerificationTask verifyConfiguration INFO: AzureVMCloudVerificationTask: verifyConfiguration: Failed to validate the Azure profile. Verify the subscription Id, client Id and secret, OAUth 2.0 Token Endpoint and the URL information.

            People

            • Assignee:
              clguiman Claudiu Guiman
              Reporter:
              rtyler R. Tyler Croy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: