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

No logging in file, when using Ara #41838

Closed
arjandekker opened this issue Jun 22, 2018 · 7 comments
Closed

No logging in file, when using Ara #41838

arjandekker opened this issue Jun 22, 2018 · 7 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@arjandekker
Copy link

arjandekker commented Jun 22, 2018

SUMMARY

We are using Ansible and ARA together. When we use Ansible 2.3.2 we are able to log to a file and send the log to a remote ARA server. This way we have a nice output of our Ansible runs and the details are in the logfile. But with version 2.5.5 the logging to ARA works fine, but the logfile is empty. When we remove the ARA callback plugin directory from the ansible.cfg file (remove from callback_plugins) the logging is working again, but of course ARA isn't. It doesn't matter if we use ANSIBLE_LOG_PATH or log_path (inside ansible.cfg).

ISSUE TYPE
  • Bug Report
COMPONENT NAME

log

ANSIBLE VERSION
ansible 2.5.5
  config file = /home/adekker/git/ansible/ansible.cfg
  configured module search path = [u'/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/modules']
  ansible python module location = /usr/local/ansible25/lib/python2.7/site-packages/ansible
  executable location = /usr/local/ansible25/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

CONFIGURATION
ANSIBLE_PIPELINING(/home/adekker/git/ansible/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/adekker/git/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=10 -o ConnectionAttempts=10
CACHE_PLUGIN(/home/adekker/git/ansible/ansible.cfg) = memory
DEFAULT_ACTION_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/action', u'/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/actions']
DEFAULT_CALLBACK_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/callback', u'/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/callbacks']
DEFAULT_CONNECTION_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/connection']
DEFAULT_FILTER_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/filter']
DEFAULT_FORKS(/home/adekker/git/ansible/ansible.cfg) = 10
DEFAULT_GATHERING(/home/adekker/git/ansible/ansible.cfg) = smart
DEFAULT_HASH_BEHAVIOUR(/home/adekker/git/ansible/ansible.cfg) = merge
DEFAULT_HOST_LIST(/home/adekker/git/ansible/ansible.cfg) = [u'/etc/ansible/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/adekker/git/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /home/adekker/git/ansible/log/ansible.log
DEFAULT_LOOKUP_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/lookup']
DEFAULT_MANAGED_STR(/home/adekker/git/ansible/ansible.cfg) = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
DEFAULT_MODULE_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/modules']
DEFAULT_POLL_INTERVAL(/home/adekker/git/ansible/ansible.cfg) = 15
DEFAULT_TIMEOUT(/home/adekker/git/ansible/ansible.cfg) = 60
DEFAULT_TRANSPORT(/home/adekker/git/ansible/ansible.cfg) = smart
DEFAULT_VARS_PLUGIN_PATH(/home/adekker/git/ansible/ansible.cfg) = [u'/usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/vars']
HOST_KEY_CHECKING(/home/adekker/git/ansible/ansible.cfg) = False
OS / ENVIRONMENT

RHEL7
pip install ansible
pip install ara

STEPS TO REPRODUCE

install Ansible like this, pip install ansible
install ARA like this, pip install ara

Use a remote ARA server, in ansible.cfg:

[ara]
database = mysql+pymysql://ara:xxxxxxxx@localhost/ara

Specify the Ansible plugin for ARA, in ansible.cfg:

action_plugins     =  /usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/action:/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/actions
callback_plugins   =  /usr/local/ansible25/lib64/python2.7/site-packages/ansible/plugins/callback/:/usr/local/ansible25/lib/python2.7/site-packages/ara/plugins/callbacks

Change the log_path in ansible.cfg:

log_path = log/ansible.log

Run a playbook and check the logfile. It should be empty.

EXPECTED RESULTS

Logging to both ARA and the logfile

ACTUAL RESULTS

Logging in ARA works fine, but the logfile is empty.


@ansibot
Copy link
Contributor

ansibot commented Jun 22, 2018

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 22, 2018
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jun 22, 2018
@sivel
Copy link
Member

sivel commented Jun 22, 2018

cc @dmsimard

@dmsimard
Copy link
Contributor

@sivel thanks for the ping.

@arjandekker this is quite a strange bug. I'll try to see if I can figure it out, thanks for reporting it !

@dmsimard
Copy link
Contributor

I have narrowed down the issue to the logging configuration between Ansible and ARA conflicting.

We landed a logging configuration refactor in the latest version of ARA (0.15.0).
It's the likely cause for this regression because I am unable to reproduce this issue when using ARA 0.14.6, regardless of the version of Ansible.

For what it's worth, the reproducer that I've used: https://gist.github.com/dmsimard/e3716a1d6f1e97e787aeb4e016d0fd6a

As such, I don't think this is an Ansible bug but there might be a possible improvement. I don't know yet, I'll need to spend a bit more time on this.
In the meantime, I'd recommend pinning ARA to 0.14.6.

openstack-gerrit pushed a commit to ansible-community/ara that referenced this issue Jun 23, 2018
An issue reported to upstream Ansible [1] highlighted that it was
fairly easy for the logging configurations of Ansible and ARA to
conflict with each other.

This commit makes it so we no longer set the root logger -- we don't
need to since we're not expecting orphaned loggers which would inherit
from the root configuration.

It also makes it so we don't disable existing loggers which would
prevent other software from being able to log properly.

And finally, it prefixes the names of the handlers and formatters
by "ara_" in order to prevent clashing with other software.

[1]: ansible/ansible#41838

Change-Id: Iecc3324cc10a767b607d3055d6b93a12b9ae87ee
dmsimard pushed a commit to dmsimard/ansible that referenced this issue Oct 24, 2018
The logging configuration provided by ansible.utils.display was not
namespaced which could cause conflicts with other python software
running with Ansible such as plugins, modules, etc.

This patch is effectively no-op in the sense that it keeps the exact
same formatting and configuration but will prevent conflicts from
happening.
It also makes it easier to customize the logging configuration in
the future if we need to or would like to expose a way for users
to provide their own configuration.

Fixes: ansible#41838
Fixes: ansible#25757
Fixes: ansible#25759
@ansibot ansibot added the has_pr This issue has an associated PR. label Jul 27, 2019
@Akasurde
Copy link
Member

@arjandekker Are you still facing this issue? needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Aug 10, 2020
@ansibot
Copy link
Contributor

ansibot commented Sep 11, 2020

@arjandekker This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 13, 2020

@arjandekker You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

@ansibot ansibot closed this as completed Oct 13, 2020
@ansible ansible locked and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants