ybalt / ansible-tower

Ansible Tower dockerized
Apache License 2.0
104 stars 79 forks source link

stdout capture is missing #9

Open datpham23 opened 7 years ago

datpham23 commented 7 years ago

Can't execute any jobs, getting the following error in the standard out panel: stdout capture is missing

Tried the image on my mac and linux box.

ybalt commented 7 years ago

What docker parameters you used for running?

datpham23 commented 7 years ago

I ran it w/ the basic parameters you had in your readme.

docker run -d -p 443:443 --name tower lardos/ansible-tower
tchellomello commented 6 years ago

Same issue here. Looking at the logs this is the error:

==> tower.log <==
2018-02-07 07:38:08,064 ERROR    awx.main.tasks project_update 45 execution encountered exception.
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/var/lib/awx/venv/awx/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/tmp/buildd/ansible-tower-3.2.1/debian/ansible-tower/usr/lib/python2.7/dist-packages/awx/main/tasks.py", line 466, in _wrapped
  File "/tmp/buildd/ansible-tower-3.2.1/debian/ansible-tower/usr/lib/python2.7/dist-packages/awx/main/tasks.py", line 915, in run
Exception: project_update 45 (error) encountered an error (rc=None), please see task stdout for details.
tchellomello commented 6 years ago

To workaround the issue, I've expected the volume /var/lib/awx and create a directory with my playbook to test under the projects subdir, however whenever trying to execute it throws the error:

Traceback (most recent call last):
File "/tmp/buildd/ansible-tower-3.2.1/debian/ansible-tower/usr/lib/python2.7/dist-packages/awx/main/tasks.py", line 839, in run
RuntimeError: bubblewrap is not installed
ybalt commented 6 years ago

@tchellomello it's strange issues, as Ansible Tower in docker installed via official playbook and it should install all needed dependencies.

tchellomello commented 6 years ago

@ybalt yes, I'm trying to troubleshoot why this is not working.

I'm currently running the image 0fa5972fcdfa

docker.io/ybalt/ansible-tower latest 0fa5972fcdfa 5 weeks ago 1.37 GB

ybalt commented 6 years ago

@ you can try to build docker image by yourself, during the process it will show how dep install work

tchellomello commented 6 years ago

@ybalt I think I found the problem. I had a similar issue with the pihole image too as I'm running on Fedora. It seems the systemd is not being able to spawn and the workaround is to provide a mount dir for the /run. I did that and worked on my environment. I also found another issue that I'm sending you a patch shortly. I'll keep you posted.

ybalt commented 6 years ago

@tchellomello thanks!

ybalt commented 6 years ago

PR merged, need some time for Docker Hub to build new image

tchellomello commented 6 years ago

@ybalt Thanks for accepting #16. I'm now testing the changes on a local build and I'll let you know the results. That PR still does not fix the problems related on this issue, but I think we are almost there.

tchellomello commented 6 years ago

@ybalt ok, after troubleshooting I not able to experience the issue only when the image is running with privileged. When the container is running without the privileged option, the git repository does not sync and only show the error "stdout capture is missing".

Plus when trying to execute a playbook, I get the error:

==> tower.log <==
2018-02-07 09:01:03,444 ERROR    awx.main.tasks job 248 execution encountered exception.
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/var/lib/awx/venv/awx/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/tmp/buildd/ansible-tower-3.2.1/debian/ansible-tower/usr/lib/python2.7/dist-packages/awx/main/tasks.py", line 466, in _wrapped
  File "/tmp/buildd/ansible-tower-3.2.1/debian/ansible-tower/usr/lib/python2.7/dist-packages/awx/main/tasks.py", line 915, in run
Exception: job 248 (error) encountered an error (rc=None), please see task stdout for details.

however this does not occur when running with priviliged.

@datpham23 could you try to run the container with --privileged to see if the error goes away?

tchellomello commented 6 years ago

It could be related to a permission under /dev directory for stdout or stderr. I'll try to run a rpdb on that code to see if we can find as running as privileged is not the best solution.

BlackCorsair commented 6 years ago

Hello, I had the same issue: if I don't have the '--privileged' flag, when I run anything it will show stdout capture is missing. Also, the project wouldn't sync with github. But I found something that may be the cause:

I create the container with the following commands:

docker create -v /var/lib/postgresql/9.6/main --name tower-data ybalt/ansible-tower /bin/true
docker run -d -p 8443:443 -v ~/ansible_projects:/var/lib/awx/projects --volumes-from tower-data --name ansible-tower --privileged ybalt/ansible-tower

And then, I noticed that on the container, there are two projects directories:

root@4b138f244a8a:/var/lib/awx# ll
total 44
drwxr-xr-x 1 awx  awx    108 May 31 12:28 ./
drwxr-xr-x 1 root root    33 Mar 14 19:45 ../
drwx------ 3 awx  awx     17 May 31 12:08 .ansible/
-rw------- 1 awx  awx    126 May 31 12:31 .bash_history
drwx------ 2 awx  awx      6 Mar 14 19:46 .ssh/
-rw-r--r-- 1 root root     5 Mar 14 20:03 .tower_version
prw------- 1 awx  awx      0 May 31 12:21 awxfifo|
-rw-r--r-- 1 awx  awx  16384 May 31 12:36 beat.db
-rw-r--r-- 1 root root 15086 Oct 11  2017 favicon.ico
drwxr-x--- 1 awx  awx    308 May 31 12:32 job_status/
drwxr-xr-x 3 awx  awx     55 May 31 12:32 projects/
drwxr-xr-x 2 root root     6 May 31 10:49 projects,/
drwxr-xr-x 3 root awx     20 Mar 14 19:46 public/
drwxr-xr-x 4 root root    32 Mar 14 19:42 venv/
-rw-r--r-- 1 root root   200 Oct 11  2017 wsgi.py

The "projects," have the right ownership (awx:awx), but the correct directory "projects" has the same ownership as the host docker user (root). When I changed the permissions from the container, it resolved correctly and the project started syncing.

debovis commented 5 years ago

@BlackCorsair I am having the same issues. Project is not sync-ing and stdout capture is missing. Did you find a solution?

debovis commented 5 years ago

Vagrant is the better option