Preventing Conda/Mamba from accessing Anaconda repos when institution blocks them
1
1
Entering edit mode
11 weeks ago
kalavattam ▴ 350

My institution disallows access to Anaconda repository servers (https://conda.anaconda.org) due to licensing fees. To work around this, I installed Miniforge and configured .condarc to use only the conda-forge and bioconda channels (e.g., following instructions here). This setup previously worked fine, but now, with a fresh installation of Miniforge, I’m encountering issues where Mamba/Conda still attempt to access Anaconda’s servers, causing installation failures.

Steps taken and error encountered

  1. Installed Miniforge following standard instructions.
  2. Configured .condarc to use only conda-forge and bioconda:
    channels:
    - conda-forge
    - bioconda
    channel_priority: flexible
    
  3. Attempted to create an environment:
    mamba create -n env_protocol -c bioconda -c conda-forge bc bowtie2 fastqc ipython parallel pbzip2 pigz r-argparse r-plotly r-ggsci rename samtools
    
  4. Received the following error, indicating an attempt to access an Anaconda repo:
    Download error (35) SSL connect error [https://conda.anaconda.org/conda-forge/noarch/repodata.json.zst] 
    Recv failure: Connection reset by peer
    

Despite explicitly setting up .condarc, Conda/Mamba still defaults to https://conda.anaconda.org, which is blocked.

Request for assistance

  • Are there specific settings needed to prevent Conda/Mamba from defaulting to Anaconda's servers?
  • Are there alternative non-Anaconda mirrors that can be used in there place?
  • Is there anything I'm missing here, or anything else you recommend?

Can post detailed command logs if needed—just let me know. Any help will be greatly appreciated.

conda mamba repos miniforge channels • 1.3k views
ADD COMMENT
0
Entering edit mode

Have you checked conda config --show-sources as suggested in the post you linked?

ADD REPLY
0
Entering edit mode

Thanks, yes:

$ conda config --show-sources
==> /home/kalavatt/miniforge3/.condarc <==
channel_priority: flexible
channels:
  - conda-forge
  - bioconda

==> /home/kalavatt/.condarc <==
channel_priority: flexible
channels:
 - conda-forge
 - bioconda
ADD REPLY
0
Entering edit mode

Looks like changing this may be worth investigating.

channel_priority: strict

to your .condarc.

ADD REPLY
0
Entering edit mode

With channel_priority: strict or channel_priority: flexible, I continue to encounter the same issue:

Download error (35) SSL connect error [https://conda.anaconda.org/conda-forge/noarch/repodata.json.zst] 
Recv failure: Connection reset by peer
ADD REPLY
3
Entering edit mode
11 weeks ago
Juke34 9.2k

If they blocked anaconda.org you are screwed. Only a subpart of it must be blocked. Here is the full list: https://juke34.github.io/fix-anaconda-licensing-issues/en/pages/conda-block/

Blocking anaconda.org blocks the access to conda-forge and bioconda.

ADD COMMENT
0
Entering edit mode

I wonder (since I haven't actually tried it for this) if bouncing your anaconda.org requests through a proxy would sidestep the issue, since the institution would just see traffic to and from the proxy server. (Oh and I just noticed you're the author on that writeup about the licensing changes. Thanks for that!)

ADD REPLY
0
Entering edit mode

OP is likely not in a position to run a personal proxy server. Access may be blocked at the level of main institutional firewall (more than likely).

ADD REPLY
0
Entering edit mode

Thank you for this suggestion. However, GenoMax is correct: Access is "blocked at the level of main institutional firewall."

ADD REPLY
1
Entering edit mode

I don't mean you'd have to run one yourself, just have access to one on the outside (that's not blocked by the institution, that is). A proof of concept being something like:

$ curl --proxy 103.148.131.106:8080 https://conda.anaconda.org
<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="https://anaconda.org/">https://anaconda.org/</a>. If not, click the link.

Easier said than done, though... all the free ones I tried seemed to be down/gave 4xx errors/were excruciatingly slow (including the one above when I try again). Maybe not a practical method anyway.

Hopefully your organization can fix their firewall!

ADD REPLY
0
Entering edit mode

If they blocked anaconda.org you are screwed.

I heard back from the HPCC admins and, sure enough, this is the issue.


The ever (de)volving situation with Anaconda led to a bit of a rushed change blocking all of the conda domains. While conda-forge is open, Anaconda has put some of their non-free channels there and we believe that's what's led to some problems.

ADD REPLY

Login before adding your answer.

Traffic: 2249 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6