2

I am setting everything according to the docs. Why is the app returning the error at the bottom of the dialog below 'Save'? The repo exists!

EDIT

The api server log reports that it's trying to run a query on the options.url on the collector items collection, but the collection item doesn't have this field set up:

2022-11-14 05:11:31,089 [http-nio-8080-exec-6] DEBUG o.s.data.mongodb.core.MongoDbUtils - Getting Mongo Database name=[dashboarddb]
2022-11-14 05:11:31,107 [http-nio-8080-exec-6] INFO  c.c.d.a.t.JwtAuthenticationFilter - correlation_id=NULL application=hygieia, service=api, requester=admin, duration=135, uri=/api/collector/item/type/searchField/scm, request_method=GET, status=200, client_ip=127.0.0.1, x-forwarded-for=null, request_params=search:[https://github.com/githubtraining/hellogitworld.git],searchField:[options.url],size:[20]

enter image description here

John Difool
  • 5,572
  • 5
  • 45
  • 80
  • 2
    You can simply type the error into a post. The huge image is absolutely useless. Images should only be posted when there is no other way to demonstrate an issue, such as a rendering problem in a UI. A short error message which is clearly text does not require an image to demonstrate the issue. See [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551) for a long list of the reasons **not** to post images. – Ken White Nov 12 '22 at 00:29
  • 1
    Did you try to type the URL without `.git`? – Prectron Nov 12 '22 at 00:31
  • I did but no luck. I think it's chocking at the /api query for containers because the colllector item doesn't have a url in the mongodb. Is there a config setting to whitelist git repos? – John Difool Nov 13 '22 at 04:03
  • Are you running the GitHub collector? See https://github.com/Hygieia/Hygieia/blob/gh-pages/pages/hygieia/collectors/scm/github.md. – James Williams Nov 17 '22 at 13:38
  • Also see the source code the root of your issue: https://github.com/hygieia/hygieia/blob/bc9988532ae79b1088caec2b1fc77d39bea764bc/src/app/widget_modules/repo/repo-config-form/repo-config-form.component.ts#L112 – James Williams Nov 17 '22 at 13:38
  • Yes, I am running the github graphql collector. But the collector expects the collector item to have the name of the github repo in the options.url field in mongodb. Which the UI plugin calling the api doesn't set. It seems that initialization is not done somewhere with the name of the github repo. – John Difool Nov 18 '22 at 12:51
  • I read the source code in the UI repo. The submit doesn't pass the first conditional test because the widget passes a string for the repo url not an 'options.url' – John Difool Nov 18 '22 at 12:55

1 Answers1

1

I spent a lot of time investigating. I was able to work around the issue by adding manually the repo url and branch to the collector_items entry for GitHub/SCM in the dashboarddb mongodb. The submit() function in the UI is not working correctly. The field is not in url.options.url because url contains the string. Finally, the dashboardId is set wrongly on the collector_items. It pointed to Product while it should have pointed to SCM collector.

John Difool
  • 5,572
  • 5
  • 45
  • 80