Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR formatter failed #321

Closed
lidiabressan opened this issue Dec 1, 2023 · 8 comments
Closed

ERROR formatter failed #321

lidiabressan opened this issue Dec 1, 2023 · 8 comments
Assignees
Labels

Comments

@lidiabressan
Copy link

ciao !

i got an error in this file (grib2) for level (here the 1st message):
pres.tar.gz

arki-scan --dump --annotate grib:pres.grb

ERROR formatter failed
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/arkimet/formatter/formatter.py", line 39, in format
res = formatter(t)
File "/usr/lib/python3.6/site-packages/arkimet/formatter/level.py", line 48, in format_level
return format_single_level(type1, scale1, value1) + " " + format_single_level(type2, scale2, value2)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

pres.tar.gz

@dcesari
Copy link
Member

dcesari commented Dec 1, 2023

It is probably a duplicate of #317, can we close that issue merging in a new release?

@brancomat brancomat added review and removed bug labels Dec 4, 2023
@brancomat
Copy link
Member

arkimet v1.48-1 has been installed on internal server "rocky8"
please test if this version gives the same error

@brancomat brancomat assigned lidiabressan and unassigned spanezz Dec 4, 2023
@dcesari
Copy link
Member

dcesari commented Dec 6, 2023

My speculation was wrong, the error remains also using the new version, after some debugging, I have the feeling that the formatter opens an old level table /usr/share/eccodes/definitions/grib2/tables/4/4.5.table instead of /usr/share/eccodes/definitions/grib2/tables/15/4.5.table which should be the right table according to the tablesVersion = 15 key.

@dcesari
Copy link
Member

dcesari commented Dec 6, 2023

Actually it seems an unimplemented feature:

# TODO: index centre, table_version, local_table_version

@spanezz
Copy link
Contributor

spanezz commented Dec 6, 2023

A possible quick fix could be to change default_table_version in

default_table_version = 4
to something newer (15?)

A proper fix requires to add a way to give format_level access to centre, table_version, local_table_version, which are currently not stored in the level metadata.

The problem is that those values might not always be available when trying to format a level: for example, trying to format a summary that contains only Level information, without origin and the like.

However, for a proper fix the problem is wider: if the level does require those other information to be interpreted, it may be insufficiently defined. Would a level with a given value with table version 4 mean something else with table version 15? If so, we might have to add the table version to the level information, like we have with products.

If however it's just a case of levels being added without being redefined, the quick fix of updating default_table_version might end up being the proper fix for just adding support for the new levels

@dcesari dcesari assigned edigiacomo, pat1 and brancomat and unassigned lidiabressan Dec 7, 2023
dcesari added a commit that referenced this issue Apr 30, 2024
Could we quickly update the grib2 default table version at least to 15 (4 is 16 years old), as for discussion in #321, waiting for a more stable solution?
@dcesari
Copy link
Member

dcesari commented Apr 30, 2024

I propose a pull request. As far as I know, the new table versions add or deprecate entries, but they should not change the content of existing entries except for cosmetic corrections.

@brancomat
Copy link
Member

The pull request has been merged in arkimet v1.50-1 (already available in copr repos)

@spanezz
Copy link
Contributor

spanezz commented Jul 17, 2024

With 1.51 I get:

$ arki-scan --dump --annotate grib:pres1.grb
Source: BLOB(grib,/home/enrico/lavori/arpa/arkimet/pres1.grb:0+271076)
Origin: GRIB2(00080, 00255, 002, 000, 002)	# GRIB2 from 80, subcentre 255, type Forecast, background process 0, process 2
Product: GRIB2(00080, 000, 003, 000, 015, 001)	# Pressure (Pa)
Level: GRIB2D(150, 000, 0000000014, 150, 000, 0000000015)	# 150 Generalized vertical height coordinate 0 14 150 Generalized vertical height coordinate 0 15
Timerange: Timedef(0s, 254, 0s)	# Analysis or observation, istantaneous value
Reftime: 2023-10-11T00:00:00Z	# 2023-10-11T00:00:00Z
Area: GRIB(Ni=326, Nj=391, latfirst=33500000, latlast=49100000, lonfirst=2700000, lonlast=22200000, tn=0)	# GRIB(Ni=326, Nj=391, latfirst=33500000, latlast=49100000, lonfirst=2700000, lonlast=22200000, tn=0)
Proddef: GRIB(tod=1)	# GRIB(tod=1)
Run: MINUTE(00:00)	# MINUTE(00:00)
Note: [2024-07-17T07:42:40Z]Scanned from pres1.grb:0+271076

I assume this means that this has been fixed

@spanezz spanezz closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants