hygieia / hygieia-scm-gitlab-collector

Hygieia Collector for Gitlab SCM
https://github.com/capitalone/Hygieia/blob/gh-pages/pages/hygieia/collectors/scm/gitlab.md
Apache License 2.0
4 stars 13 forks source link

Error occurs when getting Gitlab merge request changes #16

Open emma-qi-qi opened 4 years ago

emma-qi-qi commented 4 years ago

It seems the Gitlab merge request changes URI is buit incorrect.

2020-06-30 16:13:00,558 [taskScheduler-1] INFO c.c.d.gitlab.GitlabUrlUtility - ---> Gitlab merge request changes URI: http://gitlab.it.com/api/v4/projects/xx%2Fxx-service%2F-%2Fmerge_requests%2F1745/merge_requests/1745/changes/ 2020-06-30 16:13:00,593 [taskScheduler-1] ERROR c.c.d.c.GitlabGitCollectorTask - Failed to retrieve data, the repo or collector is most likey misconfigured: http://gitlab.it.com/xx/xx-service org.springframework.web.client.HttpClientErrorException: 404 Not Found 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.gitlab.GitlabRequestsResponseMapper.map(GitlabRequestsResponseMapper.java:108) ~[gitlab-scm-collector.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.gitlab.GitlabRequestsResponseMapper.map(GitlabRequestsResponseMapper.java:64) ~[gitlab-scm-collector.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.gitlab.DefaultGitlabGitClient.getMergeRequests(DefaultGitlabGitClient.java:133) ~[gitlab-scm-collector.jar!/:3.1.1-SNAPSHOT] at com.capitalone.dashboard.collector.GitlabGitCollectorTask.collect(GitlabGitCollectorTask.java:147) ~[gitlab-scm-collector.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_121] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]

emma-qi-qi commented 4 years ago

Can any one help on this issue? It seems the Gitlab merge request changes URI is buit incorrect. "merge_requests/" joint twice. http://gitlab.it.com/api/v4/projects/xx%2Fxx-service%2F-%2Fmerge_requests%2F1745/merge_requests/1745/changes/

aquaraga commented 3 years ago

From looking at the stack trace and the code, it is likely to be a configuration issue at your end. What Repo URL have you configured in the SCM Widget of the Team dashboard?

emma-qi-qi commented 3 years ago

I use the project ID instead of repo name in the repo url, then the data can be collected and show normally. before:http://gitlab.it.com/XXX/XXX-projectname after: http://gitlab.it.com/12345

wufei523 commented 3 years ago

i have a pull request to fix this https://github.com/Hygieia/hygieia-scm-gitlab-collector/pull/28

wufei523 commented 3 years ago

this issue can be closed. https://github.com/Hygieia/hygieia-scm-gitlab-collector/pull/28 should have fixed it