Bug #26869
openLogs filled with similar errors : SQL : la relation « nodelastcompliance » n'existe pas.
Description
Hello,
The log file /var/log/rudder/core/rudder-webapp.log is looping every two seconds filling with the following error :
May 05 00:00:06 sit-conf-prd01 rudder[report.cache]: [ERROR] Error when updating compliance cache for nodes: [2d402b3a-a970-460d-981c-209ac0ac2a3e]: SystemError: error when saving compliance for nodes; cause was: java.sql.BatchUpdateException: Batch entry 0
INSERT INTO NodeLastCompliance (nodeId, computationDateTime, details) VALUES .....
...a very large query content ...., ending with the error :ON CONFLICT (nodeId) DO UPDATE
SET computationDateTime = excluded.computationDateTime, details = excluded.details was aborted: ERREUR: la relation « nodelastcompliance » n'existe pas
Position: 13 Call getNextException to see other errors in the batch.
I looks like something is wrong with our postgreSQL schema, though I did nothing about it.
My only actions is to upgrade Rudder server using Debian apt packages.
Updated by François ARMAND about 12 hours ago
This is a new table from Rudder 8.2, so if you already had a Rudder 8.2, the table should have been created.
Does that happen after migrating from 8.1 ?
Updated by Nicolas Ecarnot about 12 hours ago
Hello François,
I have no clue at what point this occurred.
Is there a way to ensure our database schema is aligned with our Rudder server version (8.2.5) ?
Updated by François ARMAND about 12 hours ago
It may be due to a migration problem. As a workaround, you can correct the table creation by applying by hand the SQL:
CREATE TABLE NodeLastCompliance ( nodeId text NOT NULL CHECK (nodeId <> '') primary key , computationDateTime timestamp with time zone NOT NULL , details jsonb NOT NULL );
Normally, Rudder ensures that by itself, but it looks that the migration part was removed somewhere in 8.2.x for that table. We are invistigating, an user doesn't have to care about SQL schema.
Updated by Nicolas Ecarnot about 12 hours ago
OK François,
I switched to postgres user, ran psql, connected to rudder database, then ran your command (it went OK).
Now, the error changed to:
ON CONFLICT (nodeId) DO UPDATE
SET computationDateTime = excluded.computationDateTime, details = excluded.details was aborted: ERREUR: droit refusé pour la table nodelastcompliance
Updated by Nicolas Ecarnot about 11 hours ago
Ok, I ran :
ALTER TABLE public.nodelastcompliance OWNER TO rudder;
Updated by Clark ANDRIANASOLO about 8 hours ago
- Related to Bug #26200: Error at rudder start after an upgrade added
Updated by Clark ANDRIANASOLO about 8 hours ago
- Related to Architecture #25396: Persist compliance in base added
Updated by Clark ANDRIANASOLO about 8 hours ago
- Category set to Web - Maintenance
- Assignee set to Clark ANDRIANASOLO
- Severity set to Major - prevents use of part of Rudder | no simple workaround
- User visibility set to Getting started - demo | first install | Technique editor and level 1 Techniques
- Effort required set to Very Small
Updated by Clark ANDRIANASOLO about 8 hours ago
- Status changed from New to In progress
Updated by Clark ANDRIANASOLO about 8 hours ago
- Status changed from In progress to Pending technical review
- Assignee changed from Clark ANDRIANASOLO to François ARMAND
- Pull Request set to https://github.com/Normation/rudder/pull/6356
Updated by Clark ANDRIANASOLO about 6 hours ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|393281416979cbbfddb24c488e84b2028b031f6a.