****************************************************************
Troubleshooting your Anaconda repository installation (AER 2.27)
****************************************************************

.. raw:: html

    <div class="section" id="i-cannot-connect-to-the-server-on-port-x">
    <h2>I Cannot connect to the server on port x<a class="headerlink" href="#i-cannot-connect-to-the-server-on-port-x" title="Permalink to this headline">¶</a></h2>
    <p>This could be because you are behind a firewall.
    Check if your iptables rules are blocking your ports:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">iptables</span> <span class="o">-</span><span class="n">L</span> <span class="o">-</span><span class="n">n</span>
    </pre></div>
    </div>
    <p>If a rule blocks a port you want to use then you must allow the port:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo iptables -t nat -F
    sudo iptables -A INPUT -p tcp -m tcp --dport &lt;PORT&gt; -j ACCEPT
    sudo service iptables save
    sudo service iptables restart
    </pre></div>
    </div>
    </div>
    <div class="section" id="no-environment-named-search-exists-in-c-anaconda-envs-when-using-anaconda-search-on-windows">
    <h2>&#8220;No environment named &#8220;search&#8221; exists in C:\Anaconda\envs&#8221; when using &#8220;anaconda search&#8221; on Windows<a class="headerlink" href="#no-environment-named-search-exists-in-c-anaconda-envs-when-using-anaconda-search-on-windows" title="Permalink to this headline">¶</a></h2>
    <p>If anaconda-client is not yet installed and you try to search for a package on anaconda.org using the &#8216;anaconda&#8217; command you may receive the following error message:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>C:\Users\username&gt;anaconda search -t conda packagename
    No environment named &quot;search&quot; exists in C:\Anaconda\envs
    </pre></div>
    </div>
    <p>This error occurs because the Windows version of Anaconda contains an anaconda.bat file, that is used for setting environment paths and switching environments, and if anaconda-client is not installed this batch file is called instead. Once you install anaconda-client the anaconda search command should work again:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>conda install anaconda-client
    anaconda search -t conda packagename
    </pre></div>
    </div>
    </div>
    <div class="section" id="anaconda-upload-fails-while-behind-a-reverse-proxy">
    <h2>Anaconda upload fails while behind a reverse proxy<a class="headerlink" href="#anaconda-upload-fails-while-behind-a-reverse-proxy" title="Permalink to this headline">¶</a></h2>
    <p>When configuring Anaconda Client to connect to an Anaconda Repository behind a reverse proxy, the <code class="docutils literal"><span class="pre">anaconda</span> <span class="pre">upload</span></code> command may appear to try connecting to the internal hostname rather than the external configured one.</p>
    <p>This can be corrected in the settings of the reverse proxy, such as Nginx or Apache.</p>
    <p>In Nginx, add the setting <code class="docutils literal"><span class="pre">proxy_set_header</span> <span class="pre">Host</span> <span class="pre">$host;</span></code> to access the internal host with the external hostname.</p>
    <p>In Apache, turn on the option <code class="docutils literal"><span class="pre">ProxyPreserveHost</span></code>.</p>
    <p>Other reverse proxies will each have their own settings to handle hostnames correctly. For example, some other reverse proxies use a settings syntax such as <code class="docutils literal"><span class="pre">http_proxy=id:passwd&#64;proxyhost:port</span></code>.</p>
    </div>
