GithubHelp home page GithubHelp logo

Comments (12)

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

Hi @ab9-er ,

At the moment, Dagda hits against docker unix socket and it does not support the remote access through the tcp socket. You can check this in the next line:

By default, a unix domain socket is created at /var/run/docker.sock, requiring either root permission, or docker group membership. If you get a 404 HTTP error, you could have a new Dagda issue in the server log. Could you check it?

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

@eliasgranderubio So basically what is happening is this when I do a python dagda.py docker containers on the server

Traceback (most recent call last):
  File  @"dagda/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "dagda/lib/python3.6/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "dagda/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "dagda/lib/python3.6/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "dagda/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "dagda/lib/python3.6/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "dagda/lib/python3.6/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "dagda/dagda/api/service/docker.py", line 51, in get_all_running_containers
    containers = InternalServer.get_docker_driver().get_docker_client().containers()
AttributeError: 'NoneType' object has no attribute 'containers'
<2017-03-24 17:03:36,572> <ERROR> <DagdaServer> <app> <Exception on /v1/docker/containers [GET]>

And what I get as a response is

{
    "err": 500,
    "msg": "Internal Server Error"
}

from dagda.

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

I've just upgrade the docker-py requirement to docker==2.2.0 and I have tested to list the containers and images again and it looks like work fine.

Before you up-to-date with master branch for testing it, execute the next command for cleaning previous requirements:

   python3 -m pip uninstall docker-py docker

Does the error persits?

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

Yes. No improvement.

from dagda.

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

If you remove the next lines (try-except) and restart the server:

Have you any different errors? Does the docker module for python works fine in MacOS?

I think you are the first person that run Dagda in MacOS, so Dagda could have several unknown issues in this distribution.

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

It breaks the server completely 🤕

dagda/lib/python3.6/site-packages/docker/api/client.py", line 168, in _retrieve_server_version
    'Error while fetching server API version: {0}'.format(e)
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

from dagda.

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

I've been seeing issues related with 'unix://var/run/docker.sock: No such file or directory' and it looks like a very common issue in MacOS.

If you replace the unix://var/run/docker.sock with tcp://{IpAddress}:{Port} (DOCKER_HOST) or the client = docker.APIClient(base_url='unix://var/run/docker.sock', version="auto", timeout=3600) with client = docker.from_env(), is your problem fixed?

from dagda.

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

Now, Dagda uses a docker client configured in the same way that Docker command-line client so your issue should be fixed.

@ab9-er, could you test it and give me feedback?

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

Steps:

docker pull mongo
docker run -d -p 27017:27017 mongo
pip install -U -r requirements.txt
python dagda/dagda.py start -m 172.16.185.129
python dagda/dagda.py docker containers
python dagda/dagda.py docker images

Error: (for listing both containers and images)

Traceback (most recent call last):
  File "dagda.py", line 130, in <module>
    main(DagdaCLIParser())
  File "/tmp/dagda/dagda/cli/dagda_cli_parser.py", line 36, in __init__
    super(DagdaCLIParser, self).__init__()
TypeError: super() argument 1 must be type, not classobj

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

Infact this is the error for any CLI command.

I guess there was some issue with my ENV, works fine now.

from dagda.

ab9-er avatar ab9-er commented on May 30, 2024

This is no longer an issue, I am closing it. Thanks a lot @eliasgranderubio 👍🏻

from dagda.

eliasgranderubio avatar eliasgranderubio commented on May 30, 2024

Anyway, you only can get the TypeError: super() argument 1 must be type, not classobj if you try to run dagda with python 2.7. Remember that this python version is not supported.

At the moment, Dagda only supports the next python versions:

  • 3.3.X
  • 3.4.X
  • 3.5.X
  • 3.6.X

from dagda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.