-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate error in Agent-info sync
task
#23333
Comments
Issue UpdateThe error was reproduced in a $ curl -k -X DELETE "https://localhost:55555/agents?agents_list=001&status=all&older_than=0s" -H "Authorization: Bearer $TOKEN" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 100 168 0 0 5090 0 --:--:-- --:--:-- --:--:-- 5090
{
"data": {
"affected_items": [
"001"
],
"total_affected_items": 1,
"total_failed_items": 0,
"failed_items": []
},
"message": "All selected agents were deleted",
"error": 0
}
api.log
When the cluster is in the process of completing the Master cluster.log
Given that the test environment has the debug mode enabled, the
Comparing the differences between the previous stage ( diff --git a/src/wazuh_db/schema_global.sql b/src/wazuh_db/schema_global.sql
index 75fcfb7bb8..4fc5331eca 100644
--- a/src/wazuh_db/schema_global.sql
+++ b/src/wazuh_db/schema_global.sql
@@ -49,7 +49,7 @@ CREATE INDEX IF NOT EXISTS agent_group_hash ON agent (group_hash);
INSERT INTO agent (id, ip, register_ip, name, date_add, last_keepalive, `group`, connection_status) VALUES (0, '127.0.0.1', '127.0.0.1', 'localhost', strftime('%s','now'), 253402300799, NULL, 'active');
CREATE TABLE IF NOT EXISTS labels (
- id INTEGER,
+ id INTEGER REFERENCES agent (id) ON DELETE CASCADE,
key TEXT NOT NULL,
value TEXT NOT NULL,
PRIMARY KEY (id,key)
@@ -84,4 +84,4 @@ CREATE TABLE IF NOT EXISTS metadata (
value TEXT
);
-INSERT INTO metadata (key, value) VALUES ('db_version', '5');
+INSERT INTO metadata (key, value) VALUES ('db_version', '6'); This change might generate the error when the agent is deleted and consequently, the associated labels from the table. The ConclusionThe error does not originate in the cluster itself, it might be related to the new constraint added to the |
ReviewThe error was reproduced and the root of the error identified. The failure was caused by a change in the database schema owned by the Core team and whose access from the framework is through wazuh-authd. Opening an issue so that the corresponding team can solve it is the correct thing to do. LGTM! |
Good catch @fdalmaup. This change was included in v4.7.4 and then merged to 4.8.0. |
Based on the conclusions from #23349 (comment), we should add a mechanism to ignore this specific exception from the db. |
Issue UpdateThe mechanism to ignore the exception in the
Nevertheless, it is no longer raised in the
|
Description
During #23268 we detect a recurrent error in the worker node logs:
It is needed to investigate the root cause of the problem before continuing to the next RC.
Checks
The following elements have been updated or reviewed (should also be checked if no modification is required):
api/test/integration/mapping/_test_mapping.py
).The text was updated successfully, but these errors were encountered: