Comments (12)
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.
@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.
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.
Yes. No improvement.
from dagda.
If you remove the next lines (try-except) and restart the server:
- https://github.com/eliasgranderubio/dagda/blob/master/dagda/driver/docker_driver.py#L33
- https://github.com/eliasgranderubio/dagda/blob/master/dagda/driver/docker_driver.py#L35
- https://github.com/eliasgranderubio/dagda/blob/master/dagda/driver/docker_driver.py#L36
- https://github.com/eliasgranderubio/dagda/blob/master/dagda/driver/docker_driver.py#L37
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.
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.
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.
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.
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.
Infact this is the error for any CLI command.
I guess there was some issue with my ENV, works fine now.
from dagda.
This is no longer an issue, I am closing it. Thanks a lot @eliasgranderubio 👍🏻
from dagda.
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)
- docker-compose instructions unclear and db error HOT 1
- docker-compose.yaml unfriendly to macos version of docker?
- dagda crashing when sent check job?
- When initialize database , I'm getting "TypeError: documents must be a non-empty list" error
- when i run python3 dagda.py vuln --product python --product_version=3.8-slim error 500 HOT 1
- When I inspect the container image, everything is fine. HOT 2
- Scanning image with included NPM project does not show NPM vulnerabilities HOT 1
- The problem of using docker-compose to build and deploy dagda is suspected to be a bug
- How to add custom falco rules HOT 1
- Vuln --init_status has been initializing and is never finishd
- docker image scan with dagda in standalone server mode. HOT 1
- Vuln --init fails HOT 2
- check result remains Analyzing HOT 1
- Dagda issue HOT 1
- Error while starting dagda (TypeError: an integer is required - got type bytes) HOT 3
- Scan containers running in K8s? HOT 1
- Many false-positives HOT 1
- Falcosecurity/ falco output file not found. HOT 4
- Publicly Accessible CVE Database
- docker compose build doesn't work: markupsafe dependency missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagda.