Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: null exception in GenericResourcesImpl.getById #16

Closed
ondrejmichlicekips opened this issue Feb 4, 2019 · 26 comments · Fixed by #17
Closed

ERROR: null exception in GenericResourcesImpl.getById #16

ondrejmichlicekips opened this issue Feb 4, 2019 · 26 comments · Fixed by #17

Comments

@ondrejmichlicekips
Copy link

Build worked correctly till 31st of January 2019. Then without any modification it started to throw following error:

Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] stage
[Pipeline] { (Test Deploy)
[Pipeline] node
Running on Jenkins in C:\Program Files (x86)\Jenkins\workspace\Test_project\AKS_Test
[Pipeline] {
[Pipeline] acsDeploy
Starting Azure Container Service / Kubernetes Service Deployment
Delete Kubernetes management config file C:\Program Files (x86)\Jenkins\workspace\Test_project\AKS_Test\kubeconfig-4637128700832550368
ERROR: ERROR: null
java.lang.NullPointerException
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:92)
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:28)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand$AKSDeployWorker.prepareKubeconfig(AKSDeploymentCommand.java:62)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:170)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:133)
	at hudson.FilePath.act(FilePath.java:1165)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase.doExecute(KubernetesDeploymentCommandBase.java:79)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:37)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:25)
...
ERROR: Azure Container Service / Kubernetes Service deployment ended with HasError
Finished: FAILURE

By the code inspection it looks like problem with Azure/AKS API.

acsDeploy 0.2.3
Jenkins 2.150.2

@kristianhald
Copy link

We are having the same problem with out AKS setup. ACI is working without problems.
Ours started failing yesterday morning and our AKS is running in Azure WestEurope.

We are using 'Azure Container Agents Plugin' version 0.4.1 and Jenkins is 2.163.
We have not made any changes to our setup prior to the failure.

I believe AKS API might have been updated.
Written a ticket to Microsoft yesterday to determine if this is the case.

@jcme
Copy link

jcme commented Feb 5, 2019

We're experiencing the same issue as well, currently unable to complete any deployments

Azure Container Service Plugin version 0.2.3
Jenkins version 2.150.2

[Pipeline] { (Deploy)
[Pipeline] acsDeploy
Starting Azure Container Service / Kubernetes Service Deployment
ERROR: ERROR: null
java.lang.NullPointerException
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:92)
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:28)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand$AKSDeployWorker.prepareKubeconfig(AKSDeploymentCommand.java:62)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:170)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:133)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:844)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to jenkins-linux-node-nodejs
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.FilePath.act(FilePath.java:1162)
		at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase.doExecute(KubernetesDeploymentCommandBase.java:79)
		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:37)
		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:25)
		at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
		at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
		at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
		at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
		at com.microsoft.jenkins.acs.ACSDeploymentBuilder.perform(ACSDeploymentBuilder.java:56)
		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:141)
		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:125)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at java.lang.Thread.run(Thread.java:748)
[Pipeline] }
[Pipeline] // stage```

@kristianhald
Copy link

I can see that I wrote in a wrong project, as we are not using the ACS plugin, but the ACA.
It seems they are having something that looks like the same issue:
jenkinsci/azure-container-agents-plugin#34

@BartSaelen
Copy link

We are experiencing the same problem, since last friday.

ERROR: ERROR: null
java.lang.NullPointerException
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:92)
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:28)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand$AKSDeployWorker.prepareKubeconfig(AKSDeploymentCommand.java:62)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:170)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:133)
	at hudson.FilePath.act(FilePath.java:1165)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase.doExecute(KubernetesDeploymentCommandBase.java:79)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:37)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:25)
	at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
	at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
	at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
	at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
	at com.microsoft.jenkins.acs.ACSDeploymentBuilder.perform(ACSDeploymentBuilder.java:56)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1810)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
ERROR: Azure Container Service / Kubernetes Service deployment ended with HasError
Finished: FAILURE

Jenkins ver. 2.150.2
Azure Container Service Plugin ver. 0.2.3

@tomaszszlek
Copy link

I am facing the same issue, in K8s logs I can see the following :

Operation name
Get Managed Cluster AccessProfile by List Credential

Could not find role name: clusterAdmin in subscription: xxxx, resourceGroup: MyResourceGroup, managed cluster resource: k8s.

@weinong
Copy link

weinong commented Feb 5, 2019

the accessProfile resource is not versioned as managed cluster resource.. the proper way is to use the POST command instead. Rest API reference: https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials

@widgetpl
Copy link

widgetpl commented Feb 6, 2019

so Jenkins plugin uses Azure libs for Java and it reference to this
GenericResourcesImpl.java
ResourcesInner.java

        @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.Resources getById" })
        @GET("{resourceId}")
        Observable<Response<ResponseBody>> getById(@Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

so GET is used but still the question is what has changed as this used to work

@yangl900
Copy link

yangl900 commented Feb 6, 2019

AKS published a new API version (2018-08-01-preview), and it seems the Jenkins plugin dynamically discovers and uses the latest API version. This caused the problem because the GET /accessProfiles API is intend to be deprecated in newer versions. A hotfix is on the way to mitigate the issue..

@ps-rfriesen
Copy link

@yangl900 Hi,
as we are eagerly waiting for that fix, to get our deployment pipeline running again, could you please indicate where the information the a hotfix is on the way is coming from. I couldn't find any information regarding that except for the comment here.

Thanks in advance

@amitnanaware
Copy link

AKS published a new API version (2018-08-01-preview), and it seems the Jenkins plugin dynamically discovers and uses the latest API version. This caused the problem because the GET /accessProfiles API is intend to be deprecated in newer versions. A hotfix is on the way to mitigate the issue..

We are also facing same issue since last few days? When we can expect fix on this?

@kristianhald
Copy link

@amitnanaware Still having the error?

I believe this error is the same, that we have had with the Azure Container Agents plugin. Azure deployed a hotfix to AKS to mitigate this error.

https://github.com/Azure/AKS/releases/tag/2019-02-07

@jcme
Copy link

jcme commented Feb 12, 2019

Seems to have resolved the issue for us. Thanks all!

@amitnanaware
Copy link

@amitnanaware Still having the error?

I believe this error is the same, that we have had with the Azure Container Agents plugin. Azure deployed a hotfix to AKS to mitigate this error.

https://github.com/Azure/AKS/releases/tag/2019-02-07

The issue is resolved thanks!

@amenon90
Copy link

amenon90 commented Apr 4, 2019

I think this has resurfaced. My deployments were working fine, and today I started getting this:

Starting Azure Container Service / Kubernetes Service Deployment
Delete Kubernetes management config file /home/deploy/workspace/project/kubeconfig-6074144939093463942
ERROR: ERROR: null
java.lang.NullPointerException
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:92)
	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:28)
	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand$AKSDeployWorker.prepareKubeconfig(AKSDeploymentCommand.java:62)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:170)
	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:133)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to dotnetffb800
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.FilePath.act(FilePath.java:1160)
		at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase.doExecute(KubernetesDeploymentCommandBase.java:79)
		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:37)
		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:25)
		at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
		at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
		at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
		at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
		at com.microsoft.jenkins.acs.ACSDeploymentBuilder.perform(ACSDeploymentBuilder.java:56)
		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:141)
		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:125)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
		at hudson.security.ACL.impersonate(ACL.java:290)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		... 4 more

@jcme
Copy link

jcme commented Apr 4, 2019

Yes, seems to be broken for us again as well:

Starting Azure Container Service / Kubernetes Service Deployment

ERROR: ERROR: null

java.lang.NullPointerException

	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:92)

	at com.microsoft.azure.management.resources.implementation.GenericResourcesImpl.getById(GenericResourcesImpl.java:28)

	at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand$AKSDeployWorker.prepareKubeconfig(AKSDeploymentCommand.java:62)

	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:170)

	at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase$KubernetesDeployWorker.call(KubernetesDeploymentCommandBase.java:133)

	at hudson.remoting.UserRequest.perform(UserRequest.java:212)

	at hudson.remoting.UserRequest.perform(UserRequest.java:54)

	at hudson.remoting.Request$2.run(Request.java:369)

	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)

	at java.util.concurrent.FutureTask.run(FutureTask.java:264)

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

	at java.lang.Thread.run(Thread.java:844)

	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to jenkins-linux-node-nodejs

		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)

		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)

		at hudson.remoting.Channel.call(Channel.java:955)

		at hudson.FilePath.act(FilePath.java:1162)

		at com.microsoft.jenkins.acs.commands.KubernetesDeploymentCommandBase.doExecute(KubernetesDeploymentCommandBase.java:79)

		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:37)

		at com.microsoft.jenkins.acs.commands.AKSDeploymentCommand.execute(AKSDeploymentCommand.java:25)

		at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)

		at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)

		at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)

		at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)

		at com.microsoft.jenkins.acs.ACSDeploymentBuilder.perform(ACSDeploymentBuilder.java:56)

		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:141)

		at com.microsoft.jenkins.acs.ACSDeploymentContext$ExecutionImpl.run(ACSDeploymentContext.java:125)

		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)

		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

		at java.util.concurrent.FutureTask.run(FutureTask.java:266)

		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

		at java.lang.Thread.run(Thread.java:748)

@ondrejmichlicekips
Copy link
Author

Confirm, that issue is back. Probably new API rollout :(

@szymon-wlodarczyk
Copy link

Same for me

@ghost
Copy link

ghost commented Apr 4, 2019

Same problems here since this morning Amsterdam time

@sureshselvam01
Copy link

Same issue here too. When could we expect the fix

@szymon-wlodarczyk
Copy link

Hello, issue is still occurring, when we can expect fix for this ?

@gavinfish
Copy link
Member

I am working on fixing this issue. A PR is on the way.

@szymon-wlodarczyk
Copy link

when new plugin version will be released with this fix ?

@gavinfish
Copy link
Member

I am now working on the release process, the new version will be 0.2.4 thanks.

@amenon90
Copy link

amenon90 commented Apr 9, 2019

0.2.4 works. Thank you very much @gavinfish

@szymon-wlodarczyk
Copy link

I can confirm that as well. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.