APIIDA API Gateway Manager

Invalid datetime format: .. incorrect string value

If this error appears in the logs, the charset must be adjusted for the corresponding field. This happens when the gateway response contains invalid characters.

The error message

[2023-04-19T12:38:46.847249+00:00] nostromo.ERROR: d3vf0m/adf9c562c3 - Query could not be executed: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xEF\xBF\xBD\xEF\xBF\xBD...' for column `aagm`.`gatewayresources`.`gr_data` at row 1insert into gatewayresources (gr_node, gr_type, gr_gatewayid, gr_guid, gr_name, gr_folderid, gr_version, gr_seen, gr_url, gr_enabled, gr_hash, gr_data, gr_moduleSha256) values (:gr_node, :gr_type, :gr_gatewayid, :gr_guid, :gr_name, :gr_folderid, :gr_version, :gr_seen, :gr_url, :gr_enabled, :gr_hash, :gr_data, :gr_moduleSha256) [] []

The solution

ALTER TABLE gatewayresources MODIFY gr_data mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

The change can modify existing data in gr_data. Make a backup of the database first!