You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, the database fields create_time and last_update_time are not in lowercase but uppercase. This shouldn't be an issue, since in SQLite field names are case insensitive.
The problem is in WazuhDBQueryTask's _format_data_into_dictionary method, which is the following:
Even though field names are case insensitive, the DBMS will return then as uppercase, like they're in the DB, and the aforementioned method won't work, since create_time != CREATE_TIME and last_update_time != LAST_UPDATE_TIME; and so the timestamp won't be formatted into UTC.
Checks
wazuh/wazuh
Unit tests without failures. Updated and/or expanded if there are new functions/methods/outputs:
I've doing research about _format_data_into_dictionary function and how it's overwritten on each WazuhDB's child class.
Easiest way to fix this error is lower() keys. But I want to do more research before making changes.
Regards,
Alexis.
I've been checking on this again and seems like everything is working properly with _format_data_into_dictionary as is.
More specifically, _format_data_into_dictionary is currently formatting utc as planned.
It appears to be an error related to unit tests. Its fixed at issue #9424 / pr #9733.
Regards,
Alexis
Description
In the
__init__
method of the classWazuhDBQueryTask
, superclass'__init__
method is being called like this:wazuh/framework/wazuh/core/task.py
Lines 33 to 38 in af255be
As of now, the database fields
create_time
andlast_update_time
are not in lowercase but uppercase. This shouldn't be an issue, since in SQLite field names are case insensitive.The problem is in
WazuhDBQueryTask
's_format_data_into_dictionary
method, which is the following:wazuh/framework/wazuh/core/task.py
Lines 55 to 60 in af255be
Even though field names are case insensitive, the DBMS will return then as uppercase, like they're in the DB, and the aforementioned method won't work, since
create_time
!=CREATE_TIME
andlast_update_time
!=LAST_UPDATE_TIME
; and so the timestamp won't be formatted into UTC.Checks
wazuh/wazuh
framework/wazuh/core/cluster/tests/
&framework/wazuh/core/cluster/dapi/tests/
)framework/wazuh/core/tests/
)framework/wazuh/tests/
)framework/wazuh/rbac/tests/
)api/api/tests/
)api/test/integration/
):api/test/integration/mapping/integration_test_api_endpoints.json
)api/api/spec/spec.yaml
)framework/wazuh/core/exception.py
)CHANGELOG.md
)wazuh/wazuh-documentation
source/user-manual/api/equivalence.rst
)source/user-manual/api/rbac/reference.rst
)The text was updated successfully, but these errors were encountered: