mss server raises error once, when asked for available, but previously unknown data

Issue #425 resolved
Joern Ungermann created an issue

The server looks for new data, when the capability document is requested, or when data for an unknown timestep etc is requested for a plot.

In the latter case, the server still balks on the first try and only succeeds on the second.

2019-07-15 13:14:10,900 (mss_plot_driver._set_time:145):    variable 'low_cloud_area_fraction' requires input file '2019-07-13T12:00:00.an.sfc.nc'
2019-07-15 13:14:10,900 (mss_plot_driver._set_time:147): ERROR: file '2019-07-13T12:00:00.an.sfc.nc' does not exist
2019-07-15 13:14:10,900 (wms.produce_plot:428): ERROR: <class 'OSError'> [Errno file '%s' does not exist] 2019-07-13T12:00:00.an.sfc.nc
2019-07-15 13:14:10,901 (wms.produce_plot:429): Traceback (most recent call last):
  File "/home/mss-campaigns2019/miniconda3/envs/stable/lib/python3.7/site-packages/mslib/mswms/wms.py", line 425, in produce_plot
    return_format=return_format)
  File "/home/mss-campaigns2019/miniconda3/envs/stable/lib/python3.7/site-packages/mslib/mswms/mss_plot_driver.py", line 540, in set_plot_parameters
    return_format=return_format)
  File "/home/mss-campaigns2019/miniconda3/envs/stable/lib/python3.7/site-packages/mslib/mswms/mss_plot_driver.py", line 251, in set_plot_parameters
    self._set_time(init_time, valid_time)
  File "/home/mss-campaigns2019/miniconda3/envs/stable/lib/python3.7/site-packages/mslib/mswms/mss_plot_driver.py", line 148, in _set_time
    raise IOError(u"file '%s' does not exist", short_filename)
OSError: [Errno file '%s' does not exist] 2019-07-13T12:00:00.an.sfc.nc

The problem is that the routine stores a list of all known files before retrieving the required files for the requested data. During the request stage, the list of known files may be extended, unbeknownst to the calling routine.

This likely stems from a time, when the filenames were constructed according to a pattern. Current implementations typically do not return not-existing filenames.

Comments (1)

  1. Reimar Bauer

    Remove check if file is part of available_files()

    In previous data access classes, filenames could be returned that were non-existant. Thus a check existet for this.

    However, the current implementations do not do that. Instead, they identify new files on the fly. The current implementation does not take that into account as it compares against a list of known files before the potential update.

    The fix removes the check, as the ValueError will be raised by the DataAccess class in case no file is available.

    The question is only, if we need to check at this point in time, if a file has "vanished" from the disk due to being deleted.

    Fix issue #425

    → <<cset e3d6ff7cd36b>>

  2. Log in to comment