hygieia / hygieia-scm-bitbucket-collector

Hygieia Collector for BitBucket
https://github.com/capitalone/Hygieia/blob/gh-pages/pages/hygieia/collectors/scm/bitbucket.md
Apache License 2.0
1 stars 22 forks source link

Repo widget not loading all bitbucket informations: example no commits,contributors information #13

Closed Rishikeshpal closed 4 years ago

Rishikeshpal commented 5 years ago

After installing Bitbucket plugin to hygeia i created the widget and provided all the informations. But it is not pulling any informations from Bitbucket. steps performed: generated bitbucket key by running " java -jar core-3.1.6-SNAPSHOT.jar com.capitalone.dashboard.util.Encryption"

output is: java -jar core-3.1.6-SNAPSHOT.jar com.capitalone.dashboard.util.Encryption SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Your secret key is: jxCU73CkPRDWq5j+tgLvcA7lzc4CIJLO Sample encrypted string with the above key for 'thisIsMyPassword' is: Codg0PlXtqAJwRNsE6uWQaxTxm03NW0X

I used the secret key to my api.properties file.

api.properties

[root@ip-10-141-2-124 target]# vi ../../hygieia-scm-bitbucket-collector/api.properties [root@ip-10-141-2-124 target]# vi ../../hygieia-scm-bitbucket-collector/api.properties [root@ip-10-141-2-124 target]# cat ../../hygieia-scm-bitbucket-collector/api.properties dbname=dashboarddb dbhost=localhost dbport=27017 dbreplicaset=false dbhostport=localhost:27017 logging.file=./logs/bitbucket.log git.cron=0 0/5 git.host=https://bitbucket.org/ git.username=ripal1 git.password="bash64password" git.api=/rest/api/1.0/ git.commitThresholdDays=15 git.pageSize=25 git.product=server bitbucket.key=jxCU73CkPRDWq5j+tgLvcA7lzc4CIJLO

i also generated bash64 passowrd for id rpal1.

Error what i see in the logs are: 2019-09-20 13:05:00,000 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - Running Collector: Bitbucket 2019-09-20 13:05:00,009 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - ----------------------------------- 2019-09-20 13:05:00,009 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - Starting... 2019-09-20 13:05:00,009 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - ----------------------------------- 2019-09-20 13:05:00,030 [taskScheduler-1] ERROR c.c.d.c.DefaultBitbucketServerClient - Cannot decrypt this message null 2019-09-20 13:05:00,031 [taskScheduler-1] ERROR c.c.d.collector.SCMHttpRestClient - Cannot decrypt this message null 2019-09-20 13:05:00,501 [taskScheduler-1] ERROR c.c.d.c.DefaultBitbucketServerClient - Failed to obtain commits from https://bitbucket.org/rest/api/1.0/projects/xxxxxxxxxxxxxx/commits?until=refs%2Fheads%2Fmaster&limit=25 org.springframework.web.client.HttpClientErrorException: 403 Forbidden at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:493) ~[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at com.capitalone.dashboard.collector.SCMHttpRestClient.makeRestCall(SCMHttpRestClient.java:48) ~[bitbucket-scm-collector-3.1.1-SNAPSHOT.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.collector.DefaultBitbucketServerClient.getCommits(DefaultBitbucketServerClient.java:87) ~[bitbucket-scm-collector-3.1.1-SNAPSHOT.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.collector.GitCollectorTask.collect(GitCollectorTask.java:156) [bitbucket-scm-collector-3.1.1-SNAPSHOT.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.collector.CollectorTask.run(CollectorTask.java:63) [core-3.1.5.jar!/:3.1.1-SNAPSHOT] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_222] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_222] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_222] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_222] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_222] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222] 2019-09-20 13:05:00,502 [taskScheduler-1] INFO c.c.d.collector.GitCollectorTask - {password=xxxxxx, personalAccessToken=, branch=master, userID=ripal1, url=https://bitbucket.org/xxxxxx/is-infra/src/cloudops-develop/}::master::get pulls 2019-09-20 13:05:00,502 [taskScheduler-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task. java.lang.RuntimeException: Unable to decrypt SCM credentials

Sbrenthughes commented 4 years ago

https://github.com/Hygieia/hygieia-scm-bitbucket-collector/pull/15 should resolve this.

Sbrenthughes commented 4 years ago

This is resolved