davidhwyllie / findNeighbour4

A server delivering large scale, incrementable, bacterial relatedness monitoring
MIT License
3 stars 2 forks source link

FN4LOCK.sequence_id field is not large enough to handle illumina guids #98

Closed jodugo closed 3 years ago

jodugo commented 3 years ago

From Sentry.io (cx_Oracle.DatabaseError) ORA-12899: value too large for column "FN4"."FN4LOCK"."SEQUENCE_ID" (actual: 41, maximum: 38)

davidhwyllie commented 3 years ago

Apparently Illumina guids are 41 chars long; fn4 data model specifies guids 38 length maximum. Trying to insert these causes errors of database origin.

Reproduced this with a unit tests in test/test_rdbmsstore.py

Altered definitions in the following tables:

Set maximum length to 60. Unit test now passes.

In retrospect, this should probably have been trapped for at insertion and an informative message returned. Implemented check at insertion for sequence_ids which are longer than 60 chars; refuses to insert these, returning 403. Unittests for this eventuality put in place.

Question: should we validate that the sequenceid contains only alphanumerics, and -? (probably), file as separate issue.

davidhwyllie commented 3 years ago

Resolved in version v0.4.1-beta @jodugo , thank you for reporting this