Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./run_demo.bash: I meet some problems and solutions. #49

Closed
JKTesla opened this issue Jan 9, 2019 · 17 comments
Closed

./run_demo.bash: I meet some problems and solutions. #49

JKTesla opened this issue Jan 9, 2019 · 17 comments

Comments

@JKTesla
Copy link

JKTesla commented Jan 9, 2019

I keep doing using our simulator to do somethings interesting.

when I ./run_demo.bash, The log told me PermissionError: [Errno 13] permission denied: ... as follows:

Exception:
Traceback (most recent call last):
File "/usr/lib/python3.5/shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] permission denied: '/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker-0.0.1.egg-info' -> '/tmp/pip-_z0wg77r-uninstall/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker-0.0.1.egg-info'

So I just to sudo ./run_demo.bash, but the log told me useradd: user 'root' already exists Cannot run if build has not passed. as follows(in the bottom line):

Building docker file with arguments: {'nocache': False, 'path': '/tmp/tmpqyj388m2', 'tag': 'rocker_osrf/car_demo_nvidia_user', 'rm': True, 'decode': True}
building > Step 1/14 : FROM nvidia/opengl:1.0-glvnd-devel-ubuntu16.04 as glvnd
building > ---> 9bf691023f43
building > Step 2/14 : FROM osrf/car_demo
building > ---> 2b79635dafba


building > Step 13/14 : RUN useradd -U --uid 0 -ms /bin/bash root && echo "root:root" | chpasswd && adduser root sudo && echo "root ALL=NOPASSWD: ALL" >> /etc/sudoers.d/root
building > ---> Running in 4833a569e750
building > useradd: user 'root' already exists
useradd: user 'root' already exists
Cannot run if build has not passed.

I have no idea about it. So find The user ‘root’ already exists.
So I decide to remove --user in the rocker --nvidia --user --exec --devices /dev/input/js0 /dev/input/js1 -- osrf/car_demo.

This time, I sudo ./run_demo.bash again, using rocker --nvidia --exec --devices /dev/input/js0 /dev/input/js1 -- osrf/car_demo.The simulator can run well again.

So @tfoote, I think whether we can remove --user thoroughly and using sudo ./run_demo.bash

tfoote added a commit to osrf/rocker that referenced this issue Jan 9, 2019
@tfoote
Copy link
Contributor

tfoote commented Jan 9, 2019

It's highly not recommended to run docker as sudo. As per the readme make sure that you have added your user to the docker group. Then you should be able to run docker without sudo.

If you're running as sudo the --user option is not useful as 'root' already exists inside the container. I've pushed a change to make it more robust: osrf/rocker@a845001

But you should figure out what your permissions issue is before trying to continue. Note that if you've run things are root before there may be files that you need to clean up the permissions on. But the instructions shouldn't be changed to recommend sudo.

@tfoote tfoote closed this as completed Jan 9, 2019
@JKTesla
Copy link
Author

JKTesla commented Jan 10, 2019

thx brother @tfoote , I get it!
But I have a new problem...
111
The log told me rocker: error: unrecognized arguments: --exec ???

I didn't find the rocker about the explanation of --exec

@JKTesla
Copy link
Author

JKTesla commented Jan 10, 2019

When I execute these steps before ./run_demo.bash, the simulator can work well again, thx.

@sloretz
Copy link
Collaborator

sloretz commented Jan 10, 2019

@JKTesla It looks like --exec was replaced by --noexec osrf/rocker@c866fb0

@JKTesla
Copy link
Author

JKTesla commented Jan 12, 2019

@JKTesla It looks like --exec was replaced by --noexec osrf/rocker@c866fb0

So brother @tfoote @sloretz , the run_demo.bash need get some corresponding changes?
I test it again, exchange --exec to --noexec or remove --exec.
the log told me that AttributeError: module 'docker' has no attribute 'APIClient'

test2

test3

I just find tips here , I also need remove the docker-py python module from my system?Because my simulator can not work sometimes……report the wrong log as follows:
test1

@vitiennam
Copy link

@JKTesla I am facing the same problem, how do you pass it ??

@JKTesla
Copy link
Author

JKTesla commented Jan 15, 2019

@kimchicanh sorry, I do not solve this problem, just spend on learning more about rocker and docker to find some ideas...

@tfoote
Copy link
Contributor

tfoote commented Jan 15, 2019

@JKTesla Please copy and paste and use block quotes instead of screenshots so that content can be searched as well as copy and pasted. You may need a slightly newer version of docker-py than is on your system. I've opened a ticket at osrf/rocker#16 to get a better error message

@JKTesla
Copy link
Author

JKTesla commented Jan 17, 2019

Sorry for screenshots.

I have already installed docker before.And use this instruction.And my docker version as follows:

$ docker version
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:23 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:02:44 2019
OS/Arch: linux/amd64
Experimental: false

As your advice, I installed the docker-py, using pip install docker .

But the previous problem still exists..

$ ./run_demo.bash
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Collecting git+https://github.com/osrf/rocker.git
Cloning https://github.com/osrf/rocker.git to /tmp/pip-0kfnr_kc-build
Requirement already up-to-date: distro in /tmp/car_demo_rocker_venv/lib/python3.5/site-packages (from rocker===0.1.3)

Requirement already up-to-date: certifi>=2017.4.17 in /tmp/car_demo_rocker_venv/lib/python3.5/site-packages (from requests!=2.11.0,>=2.5.2->docker-py->rocker===0.1.3)
Installing collected packages: rocker
Found existing installation: rocker 0.1.3
Uninstalling rocker-0.1.3:
Successfully uninstalled rocker-0.1.3
Running setup.py install for rocker ... done
Successfully installed rocker-0.1.3
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Plugins found: ['dev_helpers', 'home', 'nvidia', 'pulse', 'user']
usage: rocker [-h] [--noexecute] [--nocache] [--pull]
[--network {bridge,host,overlay,none}]
[--devices [DEVICES [DEVICES ...]]] [--dev-helpers] [--home]
[--nvidia] [--pulse] [--user]
image [command [command ...]]
rocker: error: unrecognized arguments: --exec

@sloretz
Copy link
Collaborator

sloretz commented Jan 17, 2019

@JKTesla #51 should fix the error rocker: error: unrecognized arguments: --exec. Mind trying it out and saying if it fixes the issue?

@JKTesla
Copy link
Author

JKTesla commented Jan 18, 2019

This modification works, Thx.
But the simulator still stumbles at Building docker file with arguments: ..., when I ./run_demo.bash
the terminal still told me:

^^^^^^
Building docker file with arguments: {'tag': 'rocker_osrf/car_demo_nvidia_user', 'nocache': False, 'decode': True, 'rm': True, 'path': '/tmp/tmpxl6n1w6t'}
Traceback (most recent call last):
File "/tmp/car_demo_rocker_venv/bin/rocker", line 9, in
load_entry_point('rocker==0.1.3', 'console_scripts', 'rocker')()
File "/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker/cli.py", line 63, in main
exit_code = dig.build(**vars(args))
File "/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker/core.py", line 62, in build
docker_client = docker.APIClient()
AttributeError: module 'docker' has no attribute 'APIClient'

As @tfoote advice, I have upgraded docker-py in my system

$ pip install docker-py
/home/jk/.local/lib/python2.7/site-packages/pip/_vendor/requests/init.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
Requirement already satisfied: docker-py in /home/jk/.local/lib/python2.7/site-packages (1.10.6)

Requirement already satisfied: urllib3<1.25,>=1.21.1 in /home/jk/.local/lib/python2.7/site-packages (from requests!=2.11.0,>=2.5.2->docker-py) (1.24.1)

$ sudo pip install docker

Successfully installed docker-3.7.0

And I once installed Python3.7 in my system(Ubuntu14.04), reset Python2.7 (default in Ubuntu14.04) to the highest priority(hope to keep the version consistent,both python and docker-py)

$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 200
$ sudo update-alternatives --config python

$ python --version
Python 2.7.12

Is it because of the Chinese Internet firewall?make me create docker_client unsuccessfully?

@JKTesla
Copy link
Author

JKTesla commented Jan 18, 2019

btw, in the future, if I can set rocker at local computer by replacing below command:
pip install -U git+https://github.com/osrf/rocker.git

@tfoote
Copy link
Contributor

tfoote commented Jan 18, 2019

You need to be careful about into what python environment you are installing tools. rocker is a python3 only package. Any python2 package you install will not effect it. Your pip installs are going into python2.7 directories so are not accessible.You need to use pip3 or some other equivalent method to get the modules into your python3 path.

@JKTesla
Copy link
Author

JKTesla commented Jan 19, 2019

Thx your advice, but the simulator doesn't work on my system up to now...
./run_demo.bash, It also stucks here:

^^^^^^
Building docker file with arguments: {'tag': 'rocker_osrf/car_demo_nvidia_user', 'decode': True, 'rm': True, 'path': '/tmp/tmpop033rd4', 'nocache': False}
Traceback (most recent call last):
File "/tmp/car_demo_rocker_venv/bin/rocker", line 9, in
load_entry_point('rocker==0.1.3', 'console_scripts', 'rocker')()
File "/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker/cli.py", line 63, in main
exit_code = dig.build(**vars(args))
File "/tmp/car_demo_rocker_venv/lib/python3.5/site-packages/rocker/core.py", line 62, in build
docker_client = docker.APIClient()
AttributeError: module 'docker' has no attribute 'APIClient'
1111

Follow your instructions, I am careful about python environment when I work.
Step by step, run each command as follows:

$ sudo update-alternatives --config python
 I choose Python 3.5
$ python --version
 Python 3.5.2
$ sudo pip3 install rocker
11
$ ./build_demo.bash
1

I am so puzzled about this. Now I don't know how I ran it successfully ago. Also because of my wrong operation, I have reinstalled my ubuntu-16.04, but the simulator still can not run successfully again...

Thx, your help.

@sloretz
Copy link
Collaborator

sloretz commented Jan 22, 2019

As @tfoote advice, I have upgraded docker-py in my system

$ pip install docker-py

AttributeError: module 'docker' has no attribute 'APIClient'

I think this will be fixed when osrf/rocker#18 is merged.

@JKTesla
Copy link
Author

JKTesla commented Jan 25, 2019

Hi brother @sloretz @tfoote , my simulator can work successfully again, thx for your works very much.

@JKTesla
Copy link
Author

JKTesla commented Jan 25, 2019

Hey buddy @kimchicanh , the rocker's problem had been solved by contributors, I can run demo Successfully. Maybe you can also have a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants