opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
100 stars 84 forks source link

SearchEvent api fails #9255

Closed solomcfly closed 2 months ago

solomcfly commented 3 months ago

Describe the bug After upgrading to 1.6.3, we noticed that the searchEvents API with a location as input encountered a bug; it returned empty. The Registry function uses this API to retrieve printed records. This also applies if you perform an advanced search.

Which feature of OpenCRVS your bug concern?

Search

To Reproduce Steps to reproduce the behaviour:

  1. Login as a registrar user '...'
  2. Go to Advanced Search'
  3. Show 'Registration Details'
  4. Complete the Place of Registration field and Status of record
  5. Click Search and 0 result

Expected behaviour You should see a list of registrations.

Actual behaviour

Image

Screenshots

Image

OpenCRVS Core Version:

Country Configuration Version:

Desktop (please complete the following information):

pankaj-pant commented 3 months ago

This seems like an issue arising from misconfiguration in Madagascar's country config, as we are not able to replicate it using upstream core and countryconfig release-v1.6.3 branches

euanmillar commented 2 months ago

@solomcfly is reporting that this fails when deployed to a QA environment. @bvenceslas @pankaj-pant please arrange a call with Solo so that you can view the issue on the deployed environment. There is no reason why it would work locally but not when deployed unless there is something wrong with the backend configuration. Debugging using Kibana may help. https://documentation.opencrvs.org/setup/7.-monitoring/7.1-application-logs

euanmillar commented 2 months ago

This problem is caused by this code: https://github.com/opencrvs/opencrvs-core/blob/4aa48f2c8ddf7c97d7c6d4659c7eaa12cb75ead1/packages/config/src/handlers/locations/locationTreeSolver.ts#L21

You will notice Advanced Search works locally, but Advanced Search breaks when deployed with this error: Mongo Server Error: command aggregate requires authentication.

Image

Config microservice is directly querying hearth in this change (yet to be cherry-picked to 1.7.1: https://github.com/opencrvs/opencrvs-core/pull/9291) and yet if you look at docker-compose config microservice only has access to the application-config database once deployed.

Image

FYI: @rikukissa @Zangetsu101 @tumbledwyer @pankaj-pant @bvenceslas

rikukissa commented 2 months ago

@Zangetsu101 pointed out that there is a PR to fix this https://github.com/opencrvs/opencrvs-countryconfig/pull/433

euanmillar commented 2 months ago

@Erusha-Raju I am QA-ing this on a Niue environment today