Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-19559

Pip doesn't always download from local cache with Artifactory as package index

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: 2 - Critical
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PyPI
    • Labels:
    • Severity:
      Critical
    • Regression:
      Yes

      Description

      When installing an already cached package and working with Artifactory, the package is not fetched from the local cache whilst working against the client directly (pypi.org), we could see the package is being installed from the local cache.

      For example:

      1.pip install kitchen==1.2.5 --index-url="http://localhost:8081/artifactory/api/pypi/pypi/simple" 

      2.pip install kitchen==1.2.6 --index-url="http://localhost:8081/artifactory/api/pypi/pypi/simple" 

      3.pip install kitchen==1.2.5 --index-url="http://localhost:8081/artifactory/api/pypi/pypi/simple"

       The 3rd step should specify in the client output "Using cached....." however, it will show it is being installed from arti 
      ("Downloading http://localhost:8081/artifactory/api/pypi/pypi/packages/pathTo.whl
        Downloading from URL.....")

      Perhaps it is related to specific packages? 
      A side note, below are the different headers Artifactory returns for stackprinter package vs pypi:

       

      ➜ ~ curl -I "http://localhost:8081/artifactory/api/pypi/pypi/packages/packages/3e/35/996a248820825e1081267d17ea1ca2d089e4f3bbe509c91e8503437c1260/stackprinter-0.2.3-py3-none-any.whl"
      HTTP/1.1 200 OK
      Server: Artifactory/6.10.3
      X-Artifactory-Id: 7a41188b467aab4b:-7fae8d7d:16bb4243ceb:-8000
      Cache-Control: public, max-age=31536000
      Last-Modified: Wed, 29 May 2019 12:40:49 GMT
      ETag: 5a103c68a078b8839366ac685a498aa596d6a449
      X-Checksum-Sha1: 5a103c68a078b8839366ac685a498aa596d6a449
      X-Checksum-Sha256: a21590e1c8fc4aad1e97e89df2bcf86dcaf55f47b1bbb4dfd209361d28fd9d68
      X-Checksum-Md5: c635ee8b023b39f01184654ea984244e
      Accept-Ranges: bytes
      X-Artifactory-Filename: stackprinter-0.2.3-py3-none-any.whl
      Content-Disposition: attachment; filename="stackprinter-0.2.3-py3-none-any.whl"; filename*=UTF-8''stackprinter-0.2.3-py3-none-any.whl
      Content-Type: application/octet-stream
      Content-Length: 27218
      Date: Wed, 03 Jul 2019 11:41:11 GMT

      ➜ ~ curl -I "https://files.pythonhosted.org/packages/3e/35/996a248820825e1081267d17ea1ca2d089e4f3bbe509c91e8503437c1260/stackprinter-0.2.3-py3-none-any.whl"
      HTTP/2 200
      x-amz-id-2: 0u7C1t5UpELElYZTFnEW996BotypwqYdkALfA0PwvrnUBZEotFVNM0znOK2aeMDtvLzApbC1GtQ=
      x-amz-request-id: 7A2DA546E379F46E
      last-modified: Wed, 29 May 2019 12:40:49 GMT
      etag: "c635ee8b023b39f01184654ea984244e"
      x-amz-version-id: sPP.5sNT6aCkMYR4xuqv3GAINtWyekbE
      content-type: binary/octet-stream
      server: AmazonS3
      cache-control: max-age=365000000, immutable, public
      accept-ranges: bytes
      date: Wed, 03 Jul 2019 11:41:55 GMT
      age: 425567
      x-served-by: cache-sea1036-SEA, cache-lcy19229-LCY
      x-cache: HIT, HIT
      x-cache-hits: 1, 1
      x-timer: S1562154116.518862,VS0,VE49
      strict-transport-security: max-age=31536000; includeSubDomains; preload
      x-frame-options: deny
      x-xss-protection: 1; mode=block
      x-content-type-options: nosniff
      x-permitted-cross-domain-policies: none
      x-robots-header: noindex
      content-length: 27218
       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              barakh Barak Hacham
              Reporter:
              Maayana Maayan Amrani
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-19559 -
                  SYNCHRONIZED
                  • Last Sync Date: