st2-packages icon indicating copy to clipboard operation
st2-packages copied to clipboard

ChatOps Log Does Not Exist On CentOS7/Ubuntu16

Open DoriftoShoes opened this issue 8 years ago • 8 comments

On OS CentOS7/Ubuntu16 with systemd init the chatops logs are ending up in /var/log/messages and /var/log/st2/st2chatops.log does not exist.

DoriftoShoes avatar May 23 '16 22:05 DoriftoShoes

[vagrant@rhel7 ~]$ sh self-check.sh

Starting the Nine-Step Hubot Self-Check Program
===============================================

Step 1: Hubot is running.
Step 2: Hubot-stackstorm is installed (0.4.1).
Step 3: StackStorm has aliases that are registered and enabled.
Step 4: Chatops.notify rule is present.
Step 5: Chatops.notify rule is enabled.
Step 6: Hubot responds to the "help" command.
Step 7: Hubot loads commands from StackStorm.
cat: /var/log/st2/st2chatops.log: No such file or directory
Step 8: chatops.post_message execution succeeded.
Step 9 failed: chatops.post_message hasn't been received.

    Try to check both Hubot and StackStorm logs for more information.

===============================================

Uh oh! Something went wrong!

Please perform the steps outlined in the error message above
and then re-launch this script.

If you're still having trouble, gist the log files
and come see us in our Slack community:
https://stackstorm.com/community-signup

You can access Hubot logs at /var/log/st2/st2chatops.log.

Other StackStorm logs are also stored in /var/log/st2/.

[vagrant@rhel7 ~]$ /var/log/st2/st2chatops.log
-bash: /var/log/st2/st2chatops.log: No such file or directory
[vagrant@rhel7 ~]$

humblearner avatar May 23 '16 23:05 humblearner

Thanks @humblearner. Looks like there is an actual bug in centos 7.

lakshmi-kannan avatar May 23 '16 23:05 lakshmi-kannan

It looks like we get logging on centos7 for python processes because of explicit app logging. Let me confirm with @enykeev.

lakshmi-kannan avatar May 24 '16 04:05 lakshmi-kannan

I am right and this is a blocker to enable app level logging for hubot. https://github.com/github/hubot/pull/1164

lakshmi-kannan avatar May 24 '16 04:05 lakshmi-kannan

At the moment, for systemd (CentOS7, Ubuntu16) the only way is:

journalctl --unit=st2chatops

arm4b avatar May 21 '17 11:05 arm4b

Should be closed with c590deffdc11a325352c0c04a4d2635f9e3325c4, but I've only tested on Ubuntu 16.04 so far.

blag avatar Jun 29 '18 03:06 blag

@blag The change mentioned (which is BTW a direct push to master and not a PR :-1: ) just brings workarounds for self-check script, but doesn't fix the root cause.

Eg. ChatOps Log Does Not Exist On CentOS7/Ubuntu16 is still an issue.

arm4b avatar Jun 29 '18 10:06 arm4b

Newer systemd versions allow specifying a log file, but this won't work for Ubuntu16 or RHEL 7.

There are some ugly workarounds, but they're ugly. No obvious good solution here.

LindsayHill avatar Oct 30 '18 03:10 LindsayHill