================================================================
Troubleshooting your Anaconda repository installation (AER 2.32)
================================================================

.. 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-default"><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-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">iptables</span> <span class="o">-</span><span class="n">t</span> <span class="n">nat</span> <span class="o">-</span><span class="n">F</span>
    <span class="n">sudo</span> <span class="n">iptables</span> <span class="o">-</span><span class="n">A</span> <span class="n">INPUT</span> <span class="o">-</span><span class="n">p</span> <span class="n">tcp</span> <span class="o">-</span><span class="n">m</span> <span class="n">tcp</span> <span class="o">--</span><span class="n">dport</span> <span class="o">&lt;</span><span class="n">PORT</span><span class="o">&gt;</span> <span class="o">-</span><span class="n">j</span> <span class="n">ACCEPT</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">iptables</span> <span class="n">save</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">iptables</span> <span class="n">restart</span>
    </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-default"><div class="highlight"><pre><span></span><span class="n">C</span><span class="p">:</span>\<span class="n">Users</span>\<span class="n">username</span><span class="o">&gt;</span><span class="n">anaconda</span> <span class="n">search</span> <span class="o">-</span><span class="n">t</span> <span class="n">conda</span> <span class="n">packagename</span>
    <span class="n">No</span> <span class="n">environment</span> <span class="n">named</span> <span class="s2">&quot;search&quot;</span> <span class="n">exists</span> <span class="ow">in</span> <span class="n">C</span><span class="p">:</span>\<span class="n">Anaconda</span>\<span class="n">envs</span>
    </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-default"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">anaconda</span><span class="o">-</span><span class="n">client</span>
    <span class="n">anaconda</span> <span class="n">search</span> <span class="o">-</span><span class="n">t</span> <span class="n">conda</span> <span class="n">packagename</span>
    </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>
    <div class="section" id="start-anaconda-repository-application-as-a-foreground-process">
    <h2>Start Anaconda Repository application as a foreground process<a class="headerlink" href="#start-anaconda-repository-application-as-a-foreground-process" title="Permalink to this headline">¶</a></h2>
    <p>Anaconda Repository should normally be started as a daemon. For troubleshooting it can instead be started as a foreground process on a specified port:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span> <span class="o">--</span><span class="n">port</span> <span class="mi">8080</span>
    </pre></div>
    </div>
    <p>Stop the application with control-c.</p>
    </div>
