StackStorm / st2

StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, incident responses, troubleshooting, deployments, and more for DevOps and SREs. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html
https://stackstorm.com/
Apache License 2.0
6.09k stars 746 forks source link

"unknown file" reported as module when exceptions raised by sensor #5061

Open amanda11 opened 4 years ago

amanda11 commented 4 years ago

SUMMARY

Error messages generated by sensor result in "unknown file" instead of module names on python 3 systems, e.g.

2020-10-15 08:22:43,653 139699041297216 ERROR (unknown file) [-] File "/opt/stackstorm/packs/openstack/sensors/messaging_sensor.py", line 52, in poll

STACKSTORM VERSION

3.3dev and 3.2.0

OS, environment, install method

Ubuntu 18.04, Single node install from ansible.

Steps to reproduce the problem

One easy way to get an exception from sensor:

  1. Install StackStorm
  2. Install OpenStack pack - but don't configure it's config file
  3. The openstack sensor will raise an exception as it can't locate the OS parametrs.
  4. Examine the /var/log/st2/st2sensorcontainer.log

Expected Results

Log the exception message in the test should not report "unknown file" for module.

Actual Results

"unknown file" is reported on the ERROR lines, eg


2020-10-15 08:22:43,653 139699041297216 ERROR (unknown file) [-] File "/opt/stackstorm/packs/openstack/sensors/messaging_sensor.py", line 52, in poll
amanda11 commented 4 years ago

A similar problems was seen on all messages in the st2 logs on python 3, and the fix was https://github.com/StackStorm/st2/pull/5058. It is therefore probable that it is a similar problem whereby a logger method that is over-ridden has different return tuples for python3 and python 2.