Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-20867

BaseRestLib._format_http_date doesn't format date correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Candlepin
    • Moderate
    • None

      Description of problem:

      We first noticed on our satellite (and also in rhsm.log) this kind of message:

      RestClient::InternalServerError: 500 Internal Server Error
      Body:

      {"displayMessage":"Erreur d’exécution Text 'Thu, 29 Jun 2023 09:04:10 GMT' could not be parsed at index 0 à java.time.format.DateTimeFormatter.parseResolved0:2 046","requestUuid":"0d738566-5073-4dd9-8aea-501f3d00933c"}

      Version-Release number of selected component (if applicable): candlepin-4.2.15-1

      How reproducible:
      It appear each time rhsm try to contact katello.

      Steps to Reproduce:
      Don't remember anything special just install satellite by following the guide and kickstart a new VM

      Actual results:
      Because the server handler crash machine doesn't get update of accessible content and we need to re-register to update accessible content or do a remote job wth subman repos override.

      Expected results:
      The server give response to rhsm

      Additional info:
      We did the troubleshooting we know exactly which line we need to modify but we prefer to get update via RedHat to not break our licence:

      https://github.com/candlepin/subscription-manager/blob/a45afb704338cb8c940c17f9ca2283d0173c5236/src/rhsm/connection.py#L1868-L1870
      These lines are at fault: They always add English date as we can see here https://github.com/python/cpython/blob/cb1bf89c4066f30c80f7d1193b586a2ff8c40579/Lib/email/utils.py#L114-L150

      On the other end the server use an alternative format:
      https://github.com/candlepin/candlepin/blob/candlepin-4.2.15-1/src/main/java/org/candlepin/resource/ConsumerResource.java#L2135-L2139 'mar., 17 oct. 2023 14:20:05 GMT'

      since we have exactly the format (we can read in candeplin source code) we want to update the python codebase with strfmttime to ensure we get exactly the same string on both side.

              bcourt@redhat.com Barnaby Court
              jira-bugzilla-migration RH Bugzilla Integration
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: