Skip to content

Stackstorm fails to start 4 components if there are multiple PTR records associated with server #4161

@emptywee

Description

@emptywee
ISSUE TYPE
  • Bug Report
STACKSTORM VERSION
st2 2.7.2, on Python 2.7
OS / ENVIRONMENT / INSTALL METHOD

CentOS 6, custom install

SUMMARY

If the server where you run st2 has multiple PTR records associated with, few components fail to start:
st2notifier
st2rulesengine
st2garbagecollector
(forgot which one was the 4th)

Reason is socket.fqdn() returns different name each time invoked (round robin, probably). And Stackstorm is registering options twice on start. That creates a DuplicateOptError exception.

STEPS TO REPRODUCE
1. Add one or more PTR records for the IP address of your server. So it looks like this:
$ host 10.142.18.192
192.18.142.10.in-addr.arpa domain name pointer server1.example.com.
192.18.142.10.in-addr.arpa domain name pointer www.example.com.
192.18.142.10.in-addr.arpa domain name pointer ftp.example.com.

2. Try to start /opt/stackstorm/st2/bin/st2notifier --help
EXPECTED RESULTS

It should print help with no errors and exceptions.

ACTUAL RESULTS
$ /opt/stackstorm/st2/bin/st2notifier --help
Traceback (most recent call last):
  File "./st2notifier", line 18, in <module>
    from st2actions.cmd import st2notifier
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/cmd/st2notifier.py", line 13, in <module>
    from st2actions.notifier import config
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/notifier/config.py", line 60, in <module>
    register_opts()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/notifier/config.py", line 31, in register_opts
    _register_common_opts()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/notifier/config.py", line 40, in _register_common_opts
    common_config.register_opts()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/config.py", line 117, in register_opts
    do_register_opts(webui_opts, 'webui', ignore_errors)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/config.py", line 30, in do_register_opts
    cfg.CONF.register_opts(opts, group=group)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 1820, in __inner
    result = f(self, *args, **kwargs)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 1977, in register_opts
    self.register_opt(opt, group, clear_cache=False)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 1824, in __inner
    return f(self, *args, **kwargs)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 1961, in register_opt
    return group._register_opt(opt, cli)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 1344, in _register_opt
    if _is_opt_registered(self._opts, opt):
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/oslo_config/cfg.py", line 574, in _is_opt_registered
    raise DuplicateOptError(opt.name)
oslo_config.cfg.DuplicateOptError: duplicate option: webui_base_url

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions