equinor / fmu-sumo-uploader

Upload to Sumo in the FMU context
https://fmu-sumo-uploader.readthedocs.io/en/latest/
Apache License 2.0
0 stars 2 forks source link

Improve uploader error messages #34

Closed roywilly closed 6 months ago

perolavsvendsen commented 8 months ago

Example, when invalid metadata, this is returned by the uploader:

==================================================
INFO:fmu.sumo.uploader._sumocase:Filepath: /scratch/sumo/rowh/oldDrogon_komodoBleeding/realization-0/iter-0/share/results/tables/drogon--summary.arrow
INFO:fmu.sumo.uploader._sumocase:Metadata: [500] Internal Server Error
INFO:fmu.sumo.uploader._sumocase:Blob: [None] None
INFO:fmu.sumo.uploader._sumocase:

The actual error is that the entire fmu block is missing from the metadata.

A minimum error message here would be "invalid metadata".

Also, there is misleading information in the summary:

INFO:fmu.sumo.uploader._sumocase:Filepath: /scratch/sumo/rowh/oldDrogon_komodoBleeding/realization-0/iter-0/share/results/tables/drogon--rft.arrow
INFO:fmu.sumo.uploader._sumocase:Metadata: [500] Internal Server Error
INFO:fmu.sumo.uploader._sumocase:Blob: [None] None
INFO:fmu.sumo.uploader._sumocase:Summary:
INFO:fmu.sumo.uploader._sumocase:Total files count: 4
INFO:fmu.sumo.uploader._sumocase:OK: 1
INFO:fmu.sumo.uploader._sumocase:Failed: 3
INFO:fmu.sumo.uploader._sumocase:Rejected: 0
INFO:fmu.sumo.uploader._sumocase:Wall time: 0.32750785897951573 sec

It says 3 files have "failed", while the correct should be "rejected". I assume this is domino-effect from Sumo given 500 instead of some other code.

roywilly commented 7 months ago

Uploader PR: https://github.com/equinor/fmu-sumo-uploader/pull/49

Sumo-core PR: https://github.com/equinor/sumo-core-nodejs/pull/327

Decided to not improve the following message since it is from middleware (express.json) and it would get too complicated; { "message": "Unexpected token 'x', \"#\" is not valid JSON" }

roywilly commented 7 months ago

https://github.com/equinor/fmu-sumo-uploader/pull/52