Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1295

Azure ARM Improve "Expires" header handling

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.1
    • None
    • jclouds-compute

    Description

      Each response contains the header

      Expires: Thu Jan 01 02:00:00 EET 1970
      

      which results in the debug message

      Invalid Expires header (-1); should be in RFC-1123 format; treating as already expired: Error parsing data at 0
      

      While in the end it does the right thing, would be nicer if the header is parsed correctly. Couldn't figure out how it goes from the date in the header to "-1".

      Here's a complete request-response pair.

      2017-05-12 12:34:30,102 DEBUG 106 j.headers [ager-NxN8ADpS-22] >> GET https://management.azure.com/subscriptions/<subscription id>/locations?api-version=2015-11-01 HTTP/1.1
      2017-05-12 12:34:30,102 DEBUG 106 j.headers [ager-NxN8ADpS-22] >> Accept: application/json
      2017-05-12 12:34:30,244 DEBUG 106 o.j.i.ContentMetadataCodec$DefaultContentMetadataCodec [ager-NxN8ADpS-22] Invalid Expires header (-1); should be in RFC-1123 format; treating as already expired: Error parsing data at 0
      2017-05-12 12:34:30,245 DEBUG 106 o.j.h.o.OkHttpCommandExecutorService [ager-NxN8ADpS-22] Receiving response -126171253: HTTP/1.1 200 OK
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << HTTP/1.1 200 OK
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Date: Fri, 12 May 2017 09:34:29 GMT
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << OkHttp-Received-Millis: 1494581670244
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << OkHttp-Selected-Protocol: http/1.1
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << OkHttp-Sent-Millis: 1494581670103
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Pragma: no-cache
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Strict-Transport-Security: max-age=31536000; includeSubDomains
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Vary: Accept-Encoding
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << x-ms-correlation-request-id: f1b11eb2-c5bf-4500-9e70-08f0fbea71b8
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << x-ms-ratelimit-remaining-subscription-reads: 14815
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << x-ms-request-id: f1b11eb2-c5bf-4500-9e70-08f0fbea71b8
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << x-ms-routing-request-id: CANADAEAST:20170512T093430Z:f1b11eb2-c5bf-4500-9e70-08f0fbea71b8
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Cache-Control: no-cache
      2017-05-12 12:34:30,245 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Content-Type: application/json; charset=utf-8
      2017-05-12 12:34:30,246 DEBUG 106 j.headers [ager-NxN8ADpS-22] << Expires: Thu Jan 01 02:00:00 EET 1970
      
      

      Attachments

        Activity

          Commit db2f86bcecfe0d68183a166ad07a7f996d332539 in jclouds's branch refs/heads/master from nacx
          [ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=db2f86b ]

          JCLOUDS-1295: Support deprecated date formats in the Expires header

          jira-bot ASF subversion and git services added a comment - Commit db2f86bcecfe0d68183a166ad07a7f996d332539 in jclouds's branch refs/heads/master from nacx [ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=db2f86b ] JCLOUDS-1295 : Support deprecated date formats in the Expires header

          Commit db4f191b5f8a4d2e77e999f3f6824b2e531bb5e8 in jclouds's branch refs/heads/2.0.x from nacx
          [ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=db4f191 ]

          JCLOUDS-1295: Support deprecated date formats in the Expires header

          jira-bot ASF subversion and git services added a comment - Commit db4f191b5f8a4d2e77e999f3f6824b2e531bb5e8 in jclouds's branch refs/heads/2.0.x from nacx [ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=db4f191 ] JCLOUDS-1295 : Support deprecated date formats in the Expires header

          Azure sends invalid Expires value -1 which jclouds correctly interprets as "expired".

          Here's the wireshark capture:

          HTTP/1.1 200 OK
          Cache-Control: no-cache
          Pragma: no-cache
          Content-Type: application/json; charset=utf-8
          Content-Encoding: gzip
          Expires: -1
          Vary: Accept-Encoding
          x-ms-ratelimit-remaining-subscription-reads: 14998
          x-ms-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          x-ms-correlation-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          x-ms-routing-request-id: WESTEUROPE:20170529T124513Z:f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          Strict-Transport-Security: max-age=31536000; includeSubDomains
          Date: Mon, 29 May 2017 12:45:13 GMT
          Content-Length: 1850
          

          And the corresponding headers log, which works with the already parsed data, which explains the different Exipres format.

          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << HTTP/1.1 200 OK
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Date: Mon, 29 May 2017 12:45:13 GMT
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Received-Millis: 1496061913957
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Selected-Protocol: http/1.1
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Sent-Millis: 1496061913849
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Pragma: no-cache
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Strict-Transport-Security: max-age=31536000; includeSubDomains
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Vary: Accept-Encoding
          2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-correlation-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-ratelimit-remaining-subscription-reads: 14998
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-routing-request-id: WESTEUROPE:20170529T124513Z:f6cce7d2-63df-4d29-b03c-c4858e10a8ee
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Cache-Control: no-cache
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Content-Type: application/json; charset=utf-8
          2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Expires: Thu Jan 01 02:00:00 EET 1970
          
          svet Svetoslav Neykov added a comment - Azure sends invalid Expires value -1 which jclouds correctly interprets as "expired". Here's the wireshark capture: HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Type: application/json; charset=utf-8 Content-Encoding: gzip Expires: -1 Vary: Accept-Encoding x-ms-ratelimit-remaining-subscription-reads: 14998 x-ms-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee x-ms-correlation-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee x-ms-routing-request-id: WESTEUROPE:20170529T124513Z:f6cce7d2-63df-4d29-b03c-c4858e10a8ee Strict-Transport-Security: max-age=31536000; includeSubDomains Date: Mon, 29 May 2017 12:45:13 GMT Content-Length: 1850 And the corresponding headers log, which works with the already parsed data, which explains the different Exipres format. 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << HTTP/1.1 200 OK 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Date: Mon, 29 May 2017 12:45:13 GMT 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Received-Millis: 1496061913957 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Selected-Protocol: http/1.1 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << OkHttp-Sent-Millis: 1496061913849 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Pragma: no-cache 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Strict-Transport-Security: max-age=31536000; includeSubDomains 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << Vary: Accept-Encoding 2017-05-29 15:45:13,958 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-correlation-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-ratelimit-remaining-subscription-reads: 14998 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-request-id: f6cce7d2-63df-4d29-b03c-c4858e10a8ee 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << x-ms-routing-request-id: WESTEUROPE:20170529T124513Z:f6cce7d2-63df-4d29-b03c-c4858e10a8ee 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Cache-Control: no-cache 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Content-Type: application/json; charset=utf-8 2017-05-29 15:45:13,959 DEBUG 107 j.headers [ager-DOccEjYP-24] << Expires: Thu Jan 01 02:00:00 EET 1970

          People

            nacx Ignasi Barrera
            svet Svetoslav Neykov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: