BlueOcean integration for Bitbucket Server does not support special characters in usernames

2 minute readKnowledge base

Issue

  • I cannot use the BlueOcean pipeline editor to view pipelines created from a repo in Bitbucket Server. My attempt to authenticate with email as username and password fails with a 404 error and caused by com.atlassian.bitbucket.user.NoSuchUserException:

"response": { "status": 404, "statusText": "Not Found", "httpVersion": "HTTP/1.1", "headers": [ ... ], "cookies": [], "content": { "size": 215, "mimeType": "application/json", "compression": 0, "text": "{\n \"message\" : \"User <username> does not exist.\",\n \"code\" : 404,\n \"errors\" : [ {\n \"message\" : \"no error details\",\n \"code\" : \"com.atlassian.bitbucket.user.NoSuchUserException\",\n \"field\" : \"\"\n } ]\n}" },

Context

This issue has been reported in the community issues tracker. See JENKINS-50856 - Cannot connect to bitbucket server from Blueocean.

Bitbucket Pipeline for Blue Ocean plugin uses the Bitbucket Server API to authenticate the request. According to the Bitbucket documentation, this authentication should be performed using the user’s slug, not the username. The user’s slug may be different from the actual username if this contains special characters, such as @ when the email address is configured as the username.

Unfortunately, giving the user’s slug as username in BlueOcean does not avoid the issue. Although the Bitbucket Server API interpretes correctly the slug as the argument of the user we are looking up, the request’s authentication header does not get validated.

Workaround

At the moment, the only workaround would be to change the value used as username in Bitbucket Server authentication settings to other than the email address. Please note that the value you choose must not contain any special characters.

Tested product environment