java.lang.IllegalStateException: retrofit.RetrofitError: 500


#1

When I use ‘text’ as manifest source spinnaker is able to deploy to k8s successfully. I would like to store the manifest in bitbucket so I enabled the artifacts feature and provided an http account in hal:

  artifacts:
    http:
      enabled: true
      accounts:
      - name: bitbucket
        usernamePasswordFile: /home/spinnaker/.hal/password.bitbucket

Under pipeline configuration I provided an expected artifact for bitbucket using default artifact:

https://api.bitbucket.org/1.0/repositories/myproject/myrepo/raw/commit/myfilename.yml

Under the deploy stage I selected artifact as the manifest source and the correct artifact account(http above).

When the pipeline executes the deploy stage fails:

sszabo@tor976568e1 [/home/sszabo/src/exiger/spinnaker] $ cat a | jq -r .stages[0].context.exception.details.stackTrace
java.lang.IllegalStateException: retrofit.RetrofitError: 500 
	at com.netflix.spinnaker.orca.clouddriver.tasks.manifest.DeployManifestTask.lambda$execute$1(DeployManifestTask.java:135)
	at com.netflix.spinnaker.kork.core.RetrySupport.retry(RetrySupport.java:26)
	at com.netflix.spinnaker.orca.clouddriver.tasks.manifest.DeployManifestTask.execute(DeployManifestTask.java:102)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$1.invoke(RunTaskHandler.kt:88)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1$1.invoke(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.AuthenticationAware$sam$java_util_concurrent_Callable$0.call(AuthenticationAware.kt)
	at com.netflix.spinnaker.security.AuthenticatedRequest.lambda$propagate$0(AuthenticatedRequest.java:60)
	at com.netflix.spinnaker.orca.q.handler.AuthenticationAware$DefaultImpls.withAuth(AuthenticationAware.kt:49)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withAuth(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:87)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$handle$1.invoke(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:161)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler$withTask$1.invoke(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:48)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withTask$1.invoke(OrcaMessageHandler.kt:32)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:58)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$withStage$1.invoke(OrcaMessageHandler.kt:32)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withExecution(OrcaMessageHandler.kt:67)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withExecution(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withStage(OrcaMessageHandler.kt:54)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withStage(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.withTask(OrcaMessageHandler.kt:41)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.withTask(RunTaskHandler.kt:154)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:64)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.handle(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.q.MessageHandler$DefaultImpls.invoke(MessageHandler.kt:36)
	at com.netflix.spinnaker.orca.q.handler.OrcaMessageHandler$DefaultImpls.invoke(OrcaMessageHandler.kt)
	at com.netflix.spinnaker.orca.q.handler.RunTaskHandler.invoke(RunTaskHandler.kt:52)
	at com.netflix.spinnaker.orca.q.audit.ExecutionTrackingMessageHandlerPostProcessor$ExecutionTrackingMessageHandlerProxy.invoke(ExecutionTrackingMessageHandlerPostProcessor.kt:47)
	at com.netflix.spinnaker.q.QueueProcessor$pollOnce$1$1.run(QueueProcessor.kt:83)
	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)
Caused by: retrofit.RetrofitError: 500 
	at retrofit.RetrofitError.httpError(RetrofitError.java:40)
	at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:388)
	at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
	at com.sun.proxy.$Proxy96.fetchArtifact(Unknown Source)
	at com.netflix.spinnaker.orca.clouddriver.DelegatingOortService.fetchArtifact(DelegatingOortService.java:99)
	at com.netflix.spinnaker.orca.clouddriver.tasks.manifest.DeployManifestTask.lambda$execute$1(DeployManifestTask.java:104)
	... 33 more

Looks like I can’t use an http account with a bitbucket artifact?

2018-07-31 12:19:37.158 ERROR 1 --- [0.0-7002-exec-2] c.n.s.k.w.e.GenericExceptionHandlers : Internal Server Error

java.lang.IllegalArgumentException: Artifact credentials 'bitbucket.steveszabo' cannot handle artifacts of type 'bitbucket/file'
	at com.netflix.spinnaker.clouddriver.artifacts.ArtifactDownloader.download(ArtifactDownloader.java:59) ~[clouddriver-artifacts-2.54.0-SNAPSHOT.jar:2.54.0-SNAPSHOT]
	at com.netflix.spinnaker.clouddriver.controllers.ArtifactController.lambda$fetch$0(ArtifactController.java:67) ~[clouddriver-web-2.54.0-SNAPSHOT.jar:2.54.0-SNAPSHOT]
	at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:106) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:93) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE]
	at org.springframework.web.context.request.async.WebAsyncManager$5.run(WebAsyncManager.java:327) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_171]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_171]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]

#2

I was able to use a custom http/file artifact with the http credentials. How do I provide credentials for bitbucket?

  artifacts:
    gcs:
      enabled: false
      accounts: []
    github:
      enabled: false
      accounts: []
    http:
      enabled: true
      accounts:
      - name: bitbucket.steveszabo
        usernamePasswordFile: /home/spinnaker/.hal/password.bitbucket
    s3:
      enabled: false
      accounts: []

#3

You want to configure this under the artifacts.bitbucket section – see these halyard commands for pointers: https://www.spinnaker.io/reference/halyard/commands/#hal-config-artifact-bitbucket


#4

After updating halyard bitbucket is now an option under artifacts, thank you