GUI shows out of sync, but agent is running

It worked for a moment, and after some time it was “out of sync” again. I digged deeper into the postgres-database and found the problem: The 3 hosts with the problem were 2 times in the hosts-table. I deleted the host in the webgui and cleaned up the database. After this it was possible to readd them again:

DELETE FROM fact_values WHERE  host_id='7';
DELETE FROM host_puppet_facets WHERE  host_id='7';
DELETE FROM host_facets_reported_data_facets WHERE  host_id='7';
DELETE FROM nics WHERE  host_id='7';
DELETE FROM reports WHERE  host_id='7';
DELETE FROM host_status WHERE  host_id='7';
DELETE FROM hosts WHERE id='7';

This topic helped me: Reports Processing Failure (AssociationTypeMismatch)