StackStorm / StackStorm/st2-packages

Low priority: `sys.excepthook is missing` on RHEL 7

Open
#488 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

complexity:easy
Dominant language
Shell
Stars
28
Forks
63
PR merge metrics
No merged PRs in 30d

Description

When installing ST2 2.3 or 2.4dev on RHEL 7.4 with the one-line install script, early in the installation we see this output:

########################################################
          Installing st2 stable
########################################################
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package net-tools-2.0-0.22.20131004git.el7.x86_64 already installed and latest version
Nothing to do
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package policycoreutils-python-2.5-17.1.el7.x86_64 already installed and latest version
Nothing to do
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package yum-utils-1.1.31-42.el7.noarch already installed and latest version
Nothing to do

This comes from this line in the bootstrap script:

    # Allow rabbitmq to use '25672' port, otherwise it will fail to start
    sudo semanage port --list | grep -q 25672 || sudo semanage port -a -t amqp_port_t -p tcp 25672

When running this manually, we can see that this results in an error:

ec2-user@ip-10-0-4-161 ~]$ sudo semanage port --list | grep -q 25672
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
[ec2-user@ip-10-0-4-161 ~]$

It appears to be the same problem as referenced here

The underlying problem is related to semanage, but it only shows up when passed to grep -q.

As a workaround, we could do something like this:

sudo semanage port --list | grep 25672 > /dev/null || sudo semanage port -a -t amqp_port_t -p tcp 25672

Not quite as elegant, but it gets the job done.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scripts/st2bootstrap-el7.sh at line 170 and reproduce the semanage port --list pipeline on RHEL 7. Compare the grep -q command with the proposed /dev/null workaround. Done means the bootstrap no longer emits the sys.excepthook or lost sys.stderr messages while still adding port 25672 when it is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.