Hello,
We are using Enterprise EditionVersion 8.6 (build 39681). We have onpremise bitbucket server and we are using “Atlassian Bitbucket v6.8.1” version.
I have a personal account at Bitbucket and have admin privileges. I create a "personal access token “from the” Manage account " Settings…
With the following command, I test the token through the sonarqube server and get a healthy result. So I’m listing out the latest commits… So far, I can see that it works on both my servers and connects with each other.
curl -H “Authorization: Bearer A2edasdkjalk2dA4dakdj21!124c1412+LaaaffW” https://bitbucket.mydomain.com/projects/TST/repos/example/commits/?until=master
I select the “Bitbucket Server” option in the “ALM integrations” section of the web interface. (Administration > General Settings > Alm integrations > Bitbucket Server)
I click “Create configuration” and make the following settings. But it gives an error. “Unable to contact Bitbucket server”, “Pull Request Decoration=fail” and “Import repositories from your ALM=fail”
With these settings (token) I can get a response in the curl command above.
Configuration name: SonarQube
Bitbucket Server Url: https://bitbucket.mydomain.com
Personal Access Token: A2edasdkjalk2dA4dakdj21!124c1412+LaaaffW
I also attached screenshots. Can you help me ?
Additional information;
-
I am using ldaps. I tried these processes by creating a user with ldap or local. I tried it with admin user too.
-
While doing these operations, I set the web log as “trace” and I see the logs below.
When I create a new configuration;
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][o.s.s.p.w.UserSessionFilter] Thread[http-nio-0.0.0.0-9000-exec-4,5,main] serves /api/alm_settings/create_bitbucket
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=0ms | sql=select st.uuid as uuid, st.user_uuid as "userUuid", st.expiration_date as "expirationDate", st.created_at as "createdAt", st.updated_at as "updatedAt" from session_tokens st where st.uuid=? | params=AXcaJxhzy0q4-XpXyjKx
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=1ms | sql=update session_tokens set expiration_date = ?, updated_at = ? where uuid = ? | params=1611316495894, 1611057295895, AXcaJxhzy0q4-XpXyjKx
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=0ms | sql=SELECT u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.scm_accounts as "scmAccounts", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.is_root as "root", u.onboarded as "onboarded", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u WHERE u.uuid=? | params=AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 ACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=1ms | sql=select gr.role from group_roles gr inner join groups_users gu on gr.group_uuid=gu.group_uuid where gr.component_uuid is null and gu.user_uuid=? union select gr.role from group_roles gr where gr.group_uuid is null and gr.component_uuid is null union select ur.role from user_roles ur where ur.user_uuid=? and ur.component_uuid is null | params=AXaV6Tzh4sr7wSvC2UBF, AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=0ms | sql=select a.kee as "key", a.uuid as "uuid", a.alm_id as "rawAlm", a.url as "url", a.app_id as "appId", a.private_key as "privateKey", a.pat as "personalAccessToken", a.client_id as "clientId", a.client_secret as "clientSecret", a.created_at as "createdAt", a.updated_at as "updatedAt" from alm_settings a where a.kee = ? | params=SonarQube
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFV][sql] time=1ms | sql=INSERT INTO alm_settings ( uuid, kee, alm_id, url, app_id, private_key, pat, client_id, client_secret, created_at, updated_at ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) | params=AXcaf3Iby0q4-XpXyjLD, SonarQube, bitbucket, https://bitbucket.mydomain.com/, 12, 12, A2edasdkjalk2dA4dakdj21!124c1412+LaaaffW, 12, 12, 1611057295899, 1611057295899
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFW][o.s.s.p.w.UserSessionFilter] Thread[http-nio-0.0.0.0-9000-exec-5,5,main] serves /api/alm_settings/list_definitions
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFW][sql] time=1ms | sql=select st.uuid as uuid, st.user_uuid as "userUuid", st.expiration_date as "expirationDate", st.created_at as "createdAt", st.updated_at as "updatedAt" from session_tokens st where st.uuid=? | params=AXcaJxhzy0q4-XpXyjKx
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFW][sql] time=0ms | sql=SELECT u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.scm_accounts as "scmAccounts", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.is_root as "root", u.onboarded as "onboarded", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u WHERE u.uuid=? | params=AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFW][sql] time=1ms | sql=select gr.role from group_roles gr inner join groups_users gu on gr.group_uuid=gu.group_uuid where gr.component_uuid is null and gu.user_uuid=? union select gr.role from group_roles gr where gr.group_uuid is null and gr.component_uuid is null union select ur.role from user_roles ur where ur.user_uuid=? and ur.component_uuid is null | params=AXaV6Tzh4sr7wSvC2UBF, AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFW][sql] time=0ms | sql=select a.kee as "key", a.uuid as "uuid", a.alm_id as "rawAlm", a.url as "url", a.app_id as "appId", a.private_key as "privateKey", a.pat as "personalAccessToken", a.client_id as "clientId", a.client_secret as "clientSecret", a.created_at as "createdAt", a.updated_at as "updatedAt" from alm_settings a
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFX][o.s.s.p.w.UserSessionFilter] Thread[http-nio-0.0.0.0-9000-exec-3,5,main] serves /api/alm_settings/validate
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFX][sql] time=0ms | sql=select st.uuid as uuid, st.user_uuid as "userUuid", st.expiration_date as "expirationDate", st.created_at as "createdAt", st.updated_at as "updatedAt" from session_tokens st where st.uuid=? | params=AXcaJxhzy0q4-XpXyjKx
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFX][sql] time=0ms | sql=SELECT u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.scm_accounts as "scmAccounts", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.is_root as "root", u.onboarded as "onboarded", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u WHERE u.uuid=? | params=AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFX][sql] time=0ms | sql=select gr.role from group_roles gr inner join groups_users gu on gr.group_uuid=gu.group_uuid where gr.component_uuid is null and gu.user_uuid=? union select gr.role from group_roles gr where gr.group_uuid is null and gr.component_uuid is null union select ur.role from user_roles ur where ur.user_uuid=? and ur.component_uuid is null | params=AXaV6Tzh4sr7wSvC2UBF, AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:54:55 TRACE web[AXcaJiCGDWNrLEaIAAFX][sql] time=1ms | sql=select a.kee as "key", a.uuid as "uuid", a.alm_id as "rawAlm", a.url as "url", a.app_id as "appId", a.private_key as "privateKey", a.pat as "personalAccessToken", a.client_id as "clientId", a.client_secret as "clientSecret", a.created_at as "createdAt", a.updated_at as "updatedAt" from alm_settings a where a.kee = ? | params=SonarQube
When I click the “check configuration” button;
2021.01.19 14:55:02 TRACE web[AXcaJiCGDWNrLEaIAAFY][o.s.s.p.w.UserSessionFilter] Thread[http-nio-0.0.0.0-9000-exec-2,5,main] serves /api/alm_settings/validate
2021.01.19 14:55:02 TRACE web[AXcaJiCGDWNrLEaIAAFY][sql] time=1ms | sql=select st.uuid as uuid, st.user_uuid as "userUuid", st.expiration_date as "expirationDate", st.created_at as "createdAt", st.updated_at as "updatedAt" from session_tokens st where st.uuid=? | params=AXcaJxhzy0q4-XpXyjKx
2021.01.19 14:55:02 TRACE web[AXcaJiCGDWNrLEaIAAFY][sql] time=1ms | sql=SELECT u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.scm_accounts as "scmAccounts", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.is_root as "root", u.onboarded as "onboarded", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u WHERE u.uuid=? | params=AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:55:02 TRACE web[AXcaJiCGDWNrLEaIAAFY][sql] time=1ms | sql=select gr.role from group_roles gr inner join groups_users gu on gr.group_uuid=gu.group_uuid where gr.component_uuid is null and gu.user_uuid=? union select gr.role from group_roles gr where gr.group_uuid is null and gr.component_uuid is null union select ur.role from user_roles ur where ur.user_uuid=? and ur.component_uuid is null | params=AXaV6Tzh4sr7wSvC2UBF, AXaV6Tzh4sr7wSvC2UBF
2021.01.19 14:55:02 TRACE web[AXcaJiCGDWNrLEaIAAFY][sql] time=0ms | sql=select a.kee as "key", a.uuid as "uuid", a.alm_id as "rawAlm", a.url as "url", a.app_id as "appId", a.private_key as "privateKey", a.pat as "personalAccessToken", a.client_id as "clientId", a.client_secret as "clientSecret", a.created_at as "createdAt", a.updated_at as "updatedAt" from alm_settings a where a.kee = ? | params=SonarQube