Skip to content

ValueError: could not convert string to float crashes FNV load on XML-style header lines in .fnv files #312

Description

@ksalamy

fnv_points_tolinestring() in scripts/load.py crashes when a .fnv file contains XML-style header lines (e.g. lines containing ). The float(line.split()[7]) call on line 940 raises ValueError and is not caught by the existing exception handlers.

Crash seen:

File "/app/scripts/load.py", line 961, in fnv_points_tolinestring
    lon = float(line.split()[7])
ValueError: could not convert string to float: '<epoch'
Mission: 2025/RVPackardTransitFromVigo/raw/SeamountTest1

This is the same category of issue as PR #311 (which handled # comment lines and blank lines) but for XML-style header lines.

Temporary fix applied: Wrapped float(line.split()[7]) and float(line.split()[8]) in a try/except (ValueError, IndexError) in fnv_points_tolinestring() at line 940 of scripts/load.py. Fix has been manually copied to the running containers on both smdb-dev and production via docker cp. A PR with the proper code change is forthcoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions