Skip to content

Update the DB schemas to fix the insert errors in reports service #73

@warunawickramasingha

Description

@warunawickramasingha

Log of the production database for the reports service was observed to have errors like below due to insufficient column sizes and unique constraint violations.

ERROR:  value too long for type character varying(32)
2025-07-03 08:41:09.691 UTC [548440] STATEMENT:  INSERT INTO "services_usage" ("uid", "host", "dateTime", "osName", "osArch", "osVersion", "ParaView", "mantidVersion", "mantidSha1", "osReadable", "application", "component", "ip") VALUES ('d79cd06799863224b7324d969c1e2084', 'cebb047d10638bb629af36744cd7ca57', '2025-07-03T08:41:08.591345+00:00'::timestamptz, 'Linux', 'x86_64', '6.5.0-14-generic', '0', '6.12.20250624.0926.dev136+uncommitted', 'ed023189f584f69ca1d605902f14f0f722c49d7b', 'Ubuntu 22.04.3 LTS', 'mantidworkbench', '', '7a26261a3275f92bbac12b1e3814ebc1') RETURNING "services_usage"."id"
 ERROR:  duplicate key value violates unique constraint "services_location_ip_key"
2025-07-03 10:24:49.405 UTC [558065] DETAIL:  Key (ip)=(a9995466ff825c4e1ce6079ea1b08937) already exists.
2025-07-03 10:24:49.405 UTC [558065] STATEMENT:  INSERT INTO "services_location" ("ip", "city", "region", "country", "latitude", "longitude") VALUES ('a9995466ff825c4e1ce6079ea1b08937', '', '', '', '0', '0') RETURNING "services_location"."id"

Because of these errors those inserts have failed and the tables were not updated. This issue is created to make the necessary changes in the DB.

Metadata

Metadata

Labels

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions