Incorrect error message when BUFR_TABLES environment variable is undefined
Bug #1250947 reported by
Yves Pelletier
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libECBUFR |
Fix Committed
|
High
|
vanh souvanlasy |
Bug Description
Currently, if BUFR_TABLES is undefined, the libecbufr utility bufr_encoder will stop with an error message stating that the template is not defined properly. This is because bufr_encoder cannot find the tables and therefore is unable to read the template. The template is probably just fine. So the message is erroneous and could be considered a bug. The root cause of the issue is that the BUFR_TABLES variable is undefined - this is what needs to be reported to the user in order to take proper action.
Changed in libecbufr: | |
milestone: | none → 0.8.6 |
Changed in libecbufr: | |
assignee: | nobody → vanh souvanlasy (vanh-souvanlasy) |
status: | New → In Progress |
To post a comment you must log in.
Strictly speaking, BUFR_TABLES doesn't *need* to be defined for bufr_encoder to work... one could imagine a template using purely local descriptors and -ltableb/-ltabled arguments (actually, I think that would fail in some situations; I can't decide if it's a bug or just good taste ;)
And (this is the real gotcha) local and master tables can be defined within a template file (LOCAL_TABLEB, MASTER_TABLED, etc), the interpretation of which is buried in the API call bufr_load_ template( ) called by bufr_encoder to handle the -template command-line argument.
In other words, if bufr_encoder has no tables defined via BUFR_TABLES or the command line switches, it's not necessarily a usage error and isn't guaranteed to fail.
The design of the API is such that it turns out that bufr_encoder still can't expect when trying to load a template file that not having tables set/provided will be an error, or the precise nature of the error (i.e. distinguishing between missing tables or templates using descriptors not found in the tables provided/ available) .
In other words, from the perspective of the encoder and API, not having any tables provided is exactly the same situation as a template using descriptors not available in the various provided tables. The real problem, in a sense, is that the error from the API level is actually buried in the various debug messages.
I don't have a solution to propose off hand. I touched on this problem somewhat in bug #697746 , and it's a bit of a can of worms.