"No module named trellis.utils" when setting up GitLab runner for Trellis

I’m trying to set up GitLab continuous deployment for my Roots stack projects, but I’m hitting a snag: ERROR! Unexpected Exception, this is probably a bug: No module named trellis.utils

Here is the output:

ansible-playbook 2.4.3.0
  config file = trellis/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = trellis/.venv/local/lib/python2.7/site-packages/ansible
  executable location = trellis/.venv/bin/ansible-playbook
  python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]
Using trellis/ansible.cfg as config file
Parsed trellis/hosts/development inventory source with ini plugin
Parsed trellis/hosts/production inventory source with ini plugin
Parsed trellis/hosts/staging inventory source with ini plugin
statically imported: trellis/roles/common/tasks/disable_challenge_sites.yml
statically imported: trellis/roles/common/tasks/reload_nginx.yml
statically imported: trellis/vendor/roles/ntp/tasks/clock-rhel-6.yml
[DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 
'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions.
 This feature will be removed in a future release. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: include is kept for backwards compatibility but usage is
 discouraged. The module documentation details page may explain more about this
 rationale.. This feature will be removed in a future release. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
statically imported: trellis/roles/users/tasks/connection-warnings.yml
statically imported: trellis/vendor/roles/composer/tasks/global-require.yml
statically imported: trellis/vendor/roles/composer/tasks/project-bin.yml
statically imported: trellis/roles/letsencrypt/tasks/setup.yml
statically imported: trellis/roles/letsencrypt/tasks/nginx.yml
statically imported: trellis/roles/common/tasks/reload_nginx.yml
statically imported: trellis/roles/letsencrypt/tasks/certificates.yml
statically imported: trellis/roles/wordpress-setup/tasks/database.yml
statically imported: trellis/roles/wordpress-setup/tasks/self-signed-certificate.yml
statically imported: trellis/roles/wordpress-setup/tasks/nginx-client-cert.yml
statically imported: trellis/roles/wordpress-setup/tasks/nginx-includes.yml
statically imported: trellis/roles/wordpress-setup/tasks/nginx.yml
statically imported: trellis/roles/common/tasks/disable_challenge_sites.yml
the full traceback was:

Traceback (most recent call last):
  File "trellis/.venv/bin/ansible-playbook", line 106, in <module>
    exit_code = cli.run()
  File "trellis/.venv/local/lib/python2.7/site-packages/ansible/cli/playbook.py", line 122, in run
    results = pbex.run()
  File "trellis/.venv/local/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 90, in run
    self._tqm.load_callbacks()
  File "trellis/.venv/local/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 179, in load_callbacks
    self._stdout_callback = callback_loader.get(self._stdout_callback)
  File "trellis/.venv/local/lib/python2.7/site-packages/ansible/plugins/loader.py", line 363, in get
    self._module_cache[path] = self._load_module_source(name, path)
  File "trellis/.venv/local/lib/python2.7/site-packages/ansible/plugins/loader.py", line 339, in _load_module_source
    module = imp.load_source(full_name, path, module_file)
  File "trellis/lib/trellis/plugins/callback/output.py", line 16, in <module>
    from trellis.utils import output as output
ImportError: No module named trellis.utils

Trellis version looks like its commit e72019bfc9e21da3ba0526d81c340c93c19dfe7d just after 1.0.0-rc.2

I’d really appreciate any suggestions. Thanks in advance! :slight_smile:

Update: I managed to get around this by temporarily disabling the trellis output callback plugin. This is not, ideal, but allows server.yml to run successfully.

This topic was automatically closed after 42 days. New replies are no longer allowed.