Skip to content

datacenter.iers.org SSL: CERTIFICATE_VERIFY_FAILED (Column year failed to convert: invalid literal for int() with base 10: '<!') #12998

Description

@pllim

UPDATE: Update to astropy v5.0.4 or later.

This sounds so familiar. Do you recall, @mhvk or @eteq ? This is causing remote data job failure.

urllib.error.URLError: <urlopen error Verification of TLS/SSL certificate at
https://datacenter.iers.org/data/9/finals2000A.all failed:
this can mean either the server is misconfigured or your local root CA certificates
are out-of-date; in the latter case this can usually be addressed by installing
the Python package "certifi" (see the documentation for astropy.utils.data.download_url)
or in both cases you can work around this by passing allow_insecure=True,
but only if you understand the implications; the original error was:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
Hostname mismatch, certificate is not valid for 'datacenter.iers.org'. (_ssl.c:1131)>

Example log: https://github.com/astropy/astropy/runs/5695135215?check_suite_focus=true

Activity

  1. malynda commented on Mar 25, 2022

    @malynda
    Contributor

    Is the familiarity from when maia.usno.navy.mil disappeared?

  2. bjweiner commented on Mar 27, 2022

    @bjweiner

    This is causing astroplan to not work. There really needs to be a way to fall back gracefully to a lower time accuracy mode, rather than raising errors in astropy.iers that the user cannot resolve. I know that the code appears to contain fallbacks, but in practice they are not working. I can post the sequence of error messages if anyone finds it useful (not sure this thread is the right place).

  3. cosmicpudding commented on Mar 27, 2022

    @cosmicpudding

    Have also encountered this as of today, and can't find a workaround either - like @bjweiner noted, there is meant to be an "auto_max_age" that can be set to None to eliminate the timeout of the table (tried both None and a high number):

    from astropy.utils.iers import conf
    conf.auto_max_age = 999
    conf.auto_download = False

    but that parameter isn't doing anything (not sure if it is an astroplan or astropy issue). Is there anything that can be done in the meantime while the host server issues are in limbo? Thanks!

  4. bjweiner commented on Mar 27, 2022

    @bjweiner

    I have an error message to report and a workaround. This is the error message I get:

    File "/home/mmtop/git/QueueScheduler2.0/mmtqueue/constraints.py", line 2851, in get_score
    parang = observer.parallactic_angle(time, target)
    File "/home/mmtop/git/QueueScheduler2.0/mmtqueue/observer.py", line 510, in parallactic_angle
    LST = time.sidereal_time('mean', longitude=self.location.lon)
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 1301, in sidereal_time
    gst = self._erfa_sidereal_time(available_models[model.upper()])
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 1315, in _erfa_sidereal_time
    erfa_parameters = [getattr(getattr(self, scale)._time, jd_part)
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 1315, in
    erfa_parameters = [getattr(getattr(self, scale)._time, jd_part)
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 1679, in getattr
    tm._set_scale(attr)
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 785, in _set_scale
    args.append(get_dt(jd1, jd2))
    File "/usr/lib/python3/dist-packages/astropy/time/core.py", line 1797, in _get_delta_ut1_utc
    delta = iers_table.ut1_utc(jd1, jd2)
    File "/usr/lib/python3/dist-packages/astropy/utils/iers/iers.py", line 270, in ut1_utc
    return self._interpolate(jd1, jd2, ['UT1_UTC'],
    File "/usr/lib/python3/dist-packages/astropy/utils/iers/iers.py", line 400, in _interpolate
    self._check_interpolate_indices(i1, i, np.max(mjd))
    File "/usr/lib/python3/dist-packages/astropy/utils/iers/iers.py", line 343, in _check_interpolate_indices
    raise IERSRangeError('(some) times are outside of range covered '
    astropy.utils.iers.iers.IERSRangeError: (some) times are outside of range covered by IERS table.

    I don't think conf.auto_max_age prevents this error. Next post has the fix.

  5. bjweiner commented on Mar 27, 2022

    @bjweiner

    Of interest to @cosmicpudding if you were getting the IERSRangeError.
    There are two places in astropy/time/core.py where the ut1_utc() method is called, as

    delta = iers_table.ut1_utc(jd1, jd2)

    Change both occurrences of this to

    delta, status = iers_table.ut1_utc(jd1, jd2, return_status = True )

    This will return the out-of-range code as a status rather than raising IERSRangeError and forcing the code to stop. I think this is a bug in astropy.time. (Edit to add: I wrote that at 2 AM, and have changed my opinion. I think this is a design issue with astropy.iers. In my opinion, astropy.iers should take care of all problems associated with failing to get an IERS file internally, and issue warnings to the code calling iers, not default to raising errors that cause the external code to stop.)

    Should I open an issue for that or is this an appropriate place to discuss it? I think we need to develop a more robust testing strategy for dealing with old IERS files. A problem with these issues is that it's state dependent. If you have an in-date IERS file in the cache and simulate failing to download the IERS file, you won't get this IERSRangeError because you won't be out of range until some time later (a month?) when your file is out of date.

  6. cosmicpudding commented on Mar 27, 2022

    @cosmicpudding

    Thanks @bjweiner, I was getting the same out of range error indeed! I can't change the system astropy where we're running the code, but managed to copy the system one to the local folder and made the changes you suggested there, specifically:

    1653: #delta = iers_table.ut1_utc(jd1, jd2)
    1654: delta, status = iers_table.ut1_utc(jd1, jd2, return_status = True)

    and

    1662: #delta = iers_table.ut1_utc(jd1_utc, jd2_utc)
    1663: delta, status = iers_table.ut1_utc(jd1_utc, jd2_utc, return_status = True)

    (It's possible we have an older version of astropy on the system, so I'm not sure the line numbers will completely match, but that's what they are anyway)

    Thanks very much for the suggestion, great to have a workaround while (hopefully) IERS sorts their issues out!

  7. pllim commented on Mar 28, 2022

    @pllim
    MemberAuthor

    https://docs.astropy.org/en/stable/utils/iers.html#working-offline is supposed to work but there are caveats that I do not fully understand myself. If I remember correctly, they were last discussed in #12713 . Maybe @mhvk or @weaverba137 can clarify?

    The logic is in

    def auto_open(cls, files=None):

    There is this note in the docstring FWIW

    To prevent querying internet resources if the available local leap second
    file(s) are out of date, set ``iers.conf.auto_download = False``. This
    must be done prior to performing any ``Time`` scale transformations related
    to UTC (e.g. converting from UTC to TAI).

  8. weaverba137 commented on Mar 28, 2022

    @weaverba137
    Member

    See https://github.com/desihub/desiutil/blob/master/py/desiutil/iers.py for a function freeze_iers() that handles this for the codes I work with.

    The trick is to call that function as early as possible in execution time, before any attempt to use or even import astropy.time.

  9. added a commit that references this issue on Mar 28, 2022
  10. pllim commented on Mar 28, 2022

    @pllim
    MemberAuthor

    To those affected and no able to use offline mode, please see if #13004 works for you. Thanks!

  11. bjweiner commented on Mar 29, 2022

    @bjweiner

    Hi, I really would like to have a conversation about how to design the iers module so this does not keep happening. I found that setting the iers.conf.auto_max_age = None parameter did not work to suppress this out of range error, contrary to the documentation.

    I believe that the high precision IERS A data is needed strictly to track the UT1-UTC difference, which is always less than 1 second. 1 second of time does matter for accurately pointing a telescope, but not so much for making telescope schedules with e.g. astroplan. Every time the iers module fails irrecoverably, multiple people at multiple telescopes go into panic mode in the middle of the night. It is my opinion that iers should fall back to low precision mode by default rather than having to set extra variables to bypass critical errors. I don't know whether the best place to discuss this is here or on the astropy-dev slack workspace, but I would like to address this issue systematically rather than patching it around the edges.

  12. pllim commented on Mar 29, 2022

    @pllim
    MemberAuthor

    @bjweiner , please discuss at #9227 . Thanks!

  13. changed the title [-]datacenter.iers.org SSL: CERTIFICATE_VERIFY_FAILED[/-] [+]datacenter.iers.org SSL: CERTIFICATE_VERIFY_FAILED (Column year failed to convert: invalid literal for int() with base 10: '<!')[/+] on Mar 31, 2022
  14. pinned this issue on Mar 31, 2022
  15. unpinned this issue on Apr 1, 2022
  16. added
    Close?Tell stale bot that this issue/PR is stale
    on Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions