Adding spinnaker webhook in bitbucket giving Cannot get property 'username' on null object exception

10/24/2018

Enabled bitbucket feature and account in Spinnaker using hal but when I try to add a webhook it returns exception on bitbucket

webhook:

http://spinnaker-api.mydomain.com/webhooks/git/bitbucket

Error:

{"body":"{\"timestamp\":1540379308950,\"status\":500,\"error\":\"Internal Server Error\",\"exception\":\"java.lang.NullPointerException\",\"message\":\"Cannot get property 'username' on null object\"}","error":"Internal Server Error","exception":"com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlers$RetrofitErrorWrapper","message":"500 ","status":500,"timestamp":1540379308951,"url":"http://spin-echo.spinnaker:8089/webhooks/git/bitbucket"}

I have enabled OAuth using google and it seems to be working fine. Do I have to do or add anything else? I am not sure what I am missing or doing wrong.

Both spinnaker and bitbucket hosted in private aws subnets.

Endpoint seems to be working when I run this on a browser:

http://spinnaker-api.mydomain.com/webhooks/git/bitbucket

I get a response:

"error": "Method Not Allowed",
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
"message": "Request method 'GET' not supported",
"status": 405,
"timestamp": 1540381859422
}

I assume this means auth is working fine.

-- Ahsan Naseem
bitbucket
java
kubernetes
spinnaker
spinnaker-halyard

1 Answer

5/27/2020

There are 4 problems from Atlassian that directly impact this integration. Atlasian hasnt resolved them completely.

Problems

  1. Atlasia API version 1.0
  2. Format of bitbucket artifact treated as github artifact
  3. Incompatible formats in integration with webhook
  4. Expected artifact by default. Behaviour forces the download of the artifact whether defined or not.

Please ensure you deal with these scenarios. Refer to BitBucket Integration with Spinnaker

-- Andres Leon Rangel
Source: StackOverflow