sanger / labwhere

A tool for tracking uniquely barcoded labware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPL-804 BUG - Labwhere - Strip on nilClass triggers 500 server error on uploading box manifest

andrewsparkes opened this issue · comments

Describe the bug
On upload of a box manifest, it is possible for a strip command to be actioned on a nilClass. This exception triggers a 500 internal server error to the user. Plus ErrorsController then has an error with an undefined local variable 'env'.

RT Ticket Number
708558 was somehow autogenerated after triggering Rich's holiday tripnote. Not much detail there.

To Reproduce
Steps to reproduce the behaviour:

Expected behaviour
Handle the error more gracefully to give the user a clue as to what's wrong in the file so they can fix it and re-try.

Screenshots
na

Additional context
See Kibana in prod at timestamp: December 23rd 2020, 12:06:34.829
Box manifest uploaded filename: "Box manifest_ GSW_216_231220.csv"
NoMethodError (undefined method strip' for nil:NilClass):Followed by 500 internal server error, andError during failsafe response: undefined local variable or method env' for #<ErrorsController:0x00007fd351e23188>
Can't see a line number in Kibana. Multiple strip commands in the uploaded code. Might need the file to replicate the issue.

I have done a thorough investigation and have concluded the following:

  • user do not need to upload labwares into locations with coordinates so this code can be removed.
  • there are detailed SOPs for uploading manifests and a lot of the reason that the errors happen is because they try to upload incorrectly formatted manifests so the error message needs to reflect that.
  • Users check manifests manually for duplicate labwares but this is difficult so sometimes it doesn't get done so it would be better to add an error message for it.