View in PostgreSQL causing couch2pg errors

Hello CHT Community,

We’re experiencing a persistent error with our couch2pg service where the “contactview_clinic” is reportedly not recognized as a view in our PostgreSQL database. This seems to impede the correct functioning of couch2pg synchronization, affecting subsequent data operations in our stack. Below are the details and troubleshooting steps we’ve undertaken so far.

Preformatted text{ error: “contactview_clinic” is not a view at Parser.parseErrorMessage…

Steps Taken

  1. Checked the database logs and PostgreSQL system catalogs to confirm that contactview_clinic is indeed present and it is not a view but rather a materialized view, which the sync process mistakenly identifies as absent.
  2. Ensured that the couch2pg service has the correct permissions and environmental configurations.
  3. Attempted to restart the couch2pg service to refresh connections.
  4. Checked the PostgreSQL logs for any underlying issues not surfaced in the couch2pg logs.

The challenge persists despite confirming that the contactview_clinic view exists and can be queried directly in the database. This suggests a possible disconnect or configuration issue within couch2pg’s interaction with PostgreSQL.

We are looking for insights or suggestions on what might be causing this error and how to resolve it. Any assistance or shared experiences with similar issues would be greatly appreciated.

Hey @Owen_Kasule_Muhereza and welcome to the CHT forum!

The first point of troubleshooting this kind of issue is confirming whether the database object is assigned to the full_access role.

To reassign the object ownership, use:
ALTER MATERIALIZED VIEW contactview_clinic OWNER TO full_access;

Also confirm whether contactview_clinic is in the public schema.