Search code examples
pythonartifactoryconda

Artifactory Conda packages returns MD5mismatch error


I am using Artifactory Pro version 6.8.1.

I have created a conda virtual repository with conda remote setup.

Initially it was fine, but lately i have this error where i run

conda install -y <package_name>

it returns

MD5MismatchError: Conda detected a mismatch between the expected content and downloaded content

User conda info as below :

(base) C:\Users\user>conda info

     active environment : base
    active env location : C:\Users\user\AppData\Local\Continuum\miniconda3
            shell level : 1
       user config file : C:\Users\user\.condarc
 populated config files : C:\Users\user\.condarc
          conda version : 4.6.8
    conda-build version : not installed
         python version : 3.6.0.final.0
       base environment : C:\Users\user\AppData\Local\Continuum\miniconda3  (writable)
           channel URLs : https://user:token@artifactory/api/conda/conda/win-64
                          https://user:token@artifactory/api/conda/conda/noarch
          package cache : C:\Users\user\AppData\Local\Continuum\miniconda3\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\user\AppData\Local\Continuum\miniconda3\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.6.8 requests/2.21.0 CPython/3.6.0 Windows/10 Windows/10.0.14393
          administrator : False
             netrc file : None
           offline mode : False

Running conda install :

Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\user\AppData\Local\Continuum\miniconda3

  added / updated specs:
    - python=3.6.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2019.3.9           |           py36_0         149 KB  /
    conda-4.6.8                |           py36_0         892 KB  /
    ------------------------------------------------------------
                                           Total:         1.0 MB

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates                           api/conda/conda --> /
  certifi                                   api/conda/conda --> /
  conda                                     api/conda/conda --> /
  openssl                                   api/conda/conda --> /
  python                                    api/conda/conda --> /



Downloading and Extracting Packages
conda-4.6.8          | 892 KB    | #############################################################################################                                |  75%
certifi-2019.3.9     | 149 KB    | #############################################################################################                                |  75%

MD5MismatchError: Conda detected a mismatch between the expected content and downloaded content
for url 'https://user:token@artifactory/api/conda/conda/win-64/conda-4.6.8-py36_0.tar.bz2'.
  download saved to: C:\Users\user\AppData\Local\Continuum\miniconda3\pkgs\conda-4.6.8-py36_0.tar.bz2
  expected md5 sum: 31068a3770bb220225b7d7d766b6c0ac
  actual md5 sum: 558ed226130cc8c978f80b8061d1c831

MD5MismatchError: Conda detected a mismatch between the expected content and downloaded content
for url 'https://user:token@artifactory/api/conda/conda/win-64/certifi-2019.3.9-py36_0.tar.bz2'.
  download saved to: C:\Users\user\AppData\Local\Continuum\miniconda3\pkgs\certifi-2019.3.9-py36_0.tar.bz2
  expected md5 sum: d78307cb9c50a02f3446e7fb5e4c6cd8
  actual md5 sum: e1faa30cf88c0cd141dfe71e70a9597a

I try to run

conda clean --all

but it still shows the MD5mismatch error. Any suggestion to fix this MD5 exception for Artifactory ?


Solution

  • I managed to find a solution somehow, just to share to those who are having the same issue.

    Artifactory generates its own checksum and compares it with the downloaded checksum.

    For more details :

    https://jfrog.com/knowledge-base/what-are-client-checksum-server-checksum-and-checksum-policy-in-local-repositories/

    What i did was,

    1) Go to Artifactory. Find the downloaded artifact with issues on checksum mismatch.

    2) Click on the artifact, by right it will show

    Checksums
    SHA-256: XXX(Uploaded: Identical)
    SHA-1: XYZ (Uploaded: None)
    MD5: XYY(Uploaded: None)
    Client did not publish a checksum value.
    If you trust the uploaded artifact you can accept the actual checksum by clicking the 
    'Fix Checksum' button.
    

    3) Check the downloaded MD5 in the remote repository, the one Artifactory is connecting and downloading the package from.

    4) Verify it is same, and once verified, click the Fix the checksum button.

    5) This should solve the MD5 error issue. Hopefully it helps.