Search code examples
c++conan

How do deal with conan server connection refused?


I have a docker container which runs as Conan server. I am trying to upload some Conan packages from another docker container to conan server. After entering username and passwd I am getting following error

 Error uploading file: conanmanifest.txt, 
    'HTTPConnectionPool(host='localhost', port=9300): Max retries exceeded with url: /v1/files/hello/0.1/demo/testing/0/export/conanmanifest.txt?signature=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZV9wYXRoIjoiaGVsbG8vMC4xL2RlbW8vdGVzdGluZy8wL2V4cG9ydC9jb25hbm1hbmlmZXN0LnR4dCIsInVzZXJuYW1lIjoiZGVtbyIsImZpbGVzaXplIjo1OCwiZXhwIjoxNTg1NDQyMjYyfQ.7sHncjZ7J8gV5HENMqCIwLe7b483QfrGJ2PVyolvjC4
         (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f99c84d2e50>: 

Failed to establish a new connection: [Errno 111] Connection refused'))'

        ERROR: hello/0.1@demo/testing: Upload recipe to 'my_server' failed: Execute upload again to retry upload the failed files: conanfile.py, conanmanifest.txt. [Remote: my_server]

ERROR: Errors uploading some packages

I ran the following command docker run -t -p 9300:9999 --name mycont my_conan

then edited server.conf file accordingly

port:9300
public_port:9999
host_name: containerIP 

From now on I expect to reach by curl http://localhost:9999 but getting

Failed to connect to localhost port 9999: Connection refused PS: From my host to the server, it works perfectly fine. Bu the error is appearing when i want to upload from container to container


Solution

  • I solve it by copying a custom config file to docker container. Otherwise I could not override default config file.

    1. Write custom config file
    2. COPY or ADD to image (in Dockerfile)
    3. mv custom.conf /path/to/directory/ (from entrypoint)