Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

RuntimeError: project local_path user cannot be found in /var/lib/awx/projects #11

Closed
ghost opened this issue Sep 12, 2017 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented Sep 12, 2017

Hi,

Thanks for creating ansible awx role and containers.

I am running ansible awx role on oracle virtual box. Role has been ran perfectly and i was able to access the Ansible awx. I have added the playbooks manually and create a template to perform the job.

But while running job template i am getting below error:

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/awx/main/tasks.py", line 799, in run
cwd = self.build_cwd(instance, **kwargs)
File "/usr/lib/python2.7/site-packages/awx/main/tasks.py", line 1188, in build_cwd
(job.project.local_path, root))
RuntimeError: project local_path user cannot be found in /var/lib/awx/projects

I have created the directory under awx_web container and do i have define somewhere in settings for PROJECT PATH. Link Ansible tower do we have any file w.r.t settings.

@MartinTerp
Copy link

you need the same folder on the awx_task container.
you can add this to your compose file for _task and _web:

volumes:
  - /mnt/awx:/var/lib/awx/projects

This will map /mnt/awx (or replace with something else) on the host server running the container, to the /var/lib/awx/projects folder on the container.
This way you can have a shared directory for your playbooks

@ghost
Copy link
Author

ghost commented Sep 12, 2017

Hi,

Thanks for the suggestion.

I am novice in dockers so i have tried manually mount the volume for running below command:

[root@ansible ~]# docker run -v /media/sf_ansible_cookbooks:/var/lib/awx/projects -i -t awx_web:1.0.0.331
WARNING: IPv4 forwarding is disabled. Networking will not work.

Traceback (most recent call last):
File "/usr/bin/awx-manage", line 9, in
load_entry_point('awx==1.0.0.331', 'console_scripts', 'awx-manage')()
File "/usr/lib/python2.7/site-packages/awx/init.py", line 107, in manage
execute_from_command_line(sys.argv)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/init.py", line 354, in execute_from_command_line
utility.execute()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/init.py", line 328, in execute
django.setup()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/usr/lib/python2.7/site-packages/awx/conf/apps.py", line 18, in ready
configure_external_logger(settings)
File "/usr/lib/python2.7/site-packages/awx/main/utils/handlers.py", line 342, in configure_external_logger
is_enabled = settings_module.LOG_AGGREGATOR_ENABLED
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/conf/init.py", line 49, in getattr
return getattr(self._wrapped, name)
File "/usr/lib/python2.7/site-packages/awx/conf/settings.py", line 386, in getattr
value = self._get_local(name)
File "/usr/lib64/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/site-packages/awx/conf/settings.py", line 64, in _log_database_error
if get_tower_migration_version() < '310':
File "/usr/lib/python2.7/site-packages/awx/main/utils/db.py", line 13, in get_tower_migration_version
loader = MigrationLoader(connection, ignore_no_migrations=True)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in init
self.build_graph()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 164, in cursor
cursor = self.make_cursor(self._cursor())
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/transaction_hooks/mixin.py", line 75, in connect
super(TransactionHooksDatabaseWrapperMixin, self).connect(*a, **kw)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/psycopg2/init.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: local user with ID 1000 does not exist

2017-09-12 16:48:47,009 INFO RPC interface 'supervisor' initialized
2017-09-12 16:48:47,009 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-09-12 16:48:47,009 INFO supervisord started with pid 18
2017-09-12 16:48:48,014 INFO spawned: 'daphne' with pid 21
2017-09-12 16:48:48,029 INFO spawned: 'nginx' with pid 22
2017-09-12 16:48:48,039 INFO spawned: 'uwsgi' with pid 23
*** Starting uWSGI 2.0.14 (64bit) on [Tue Sep 12 16:48:48 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 11 September 2017 20:23:42
os: Linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017
nodename: 442909efc9cc
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /var/lib/awx
detected binary path: /var/lib/awx/venv/awx/bin/uwsgi
your memory page size is 4096 bytes
*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 65536
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8050 fd 3

@ghost
Copy link
Author

ghost commented Sep 12, 2017

Hi,

I am able to resolve the issue by syncing up both containers directory "/var/lib/awx/projects" on awx_web and awx_tasks container but sharing a directory from source server to containers giving me issues :(

@MartinTerp
Copy link

@rahulansible how do you start the containers without the folder mount?

@ghost
Copy link
Author

ghost commented Sep 13, 2017

@MartinTerp containers are already running. Once ansible-awx role has completed, status of containers were running or i will start them with docker container start. I have edited the docker-compose.yml file come up with awx role and tried re-running the playbook but no luck.

@shgonzalez
Copy link

shgonzalez commented Dec 20, 2019

Try this secuence:

  • stop containers
  • edit docker-compose.yml, adding volumes to _web and _task containers.
  • docker-compose -f docker-compose.yml create
  • docker-compose -f docker-compose.yml start

@geerlingguy
Copy link
Owner

I'm closing all issues on this repository as it has been deprecated; please see: #49

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

No branches or pull requests

3 participants