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

Got an error AttributeError: 'StompConnection11' object has no attribute 'start' with alert type stomp #2731

Open
kvskjava opened this issue Apr 3, 2020 · 1 comment

Comments

@kvskjava
Copy link

kvskjava commented Apr 3, 2020

Hi Team,

I've created a sample rule with alert type as stomp in order to store the alert details into Apache ActiveMQ server.

Initially it showed error to include stomp related properties even though those are all optional(elastalert.util.EAException: Error initiating alert ['stomp']: Missing required option(s): stomp_login, stomp_password, stomp_hostport, stomp_hostname),
so I added the required properties in my rule yaml as shown below:

alert:

  • "stomp"
    stomp:
    stomp_hostname: localhost
    stomp_hostport: 61613
    stomp_login: admin
    stomp_password: admin

Now it's showing error as

ERROR:root:Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/elastalert/elastalert.py", line 1440, in alert
return self.send_alert(matches, rule, alert_time=alert_time, retried=retried)
File "/usr/local/lib/python3.6/site-packages/elastalert/elastalert.py", line 1529, in send_alert
alert.alert(matches)
File "/usr/local/lib/python3.6/site-packages/elastalert/alerts.py", line 378, in alert
conn.start()
AttributeError: 'StompConnection11' object has no attribute 'start'

Am I doing anything wrong or missing anything?
Kindly help me on it. Any help would be highly appreciated.

@nsano-rururu
Copy link
Contributor

nsano-rururu commented Nov 4, 2020

@kvskjava

It looks like the code doesn't work with the current stomp.py. It works if you delete "conn.start()".

https://github.com/Yelp/elastalert/blob/master/elastalert/alerts.py#L374

before

        conn.start()
        conn.connect(self.stomp_login, self.stomp_password)
        # Ensures that the CONNECTED frame is received otherwise, the disconnect call will fail.
        time.sleep(1)
        conn.send(self.stomp_destination, json.dumps(fullmessage))
        conn.disconnect()

after

delete 「 conn.start()」

        conn.connect(self.stomp_login, self.stomp_password)
        # Ensures that the CONNECTED frame is received otherwise, the disconnect call will fail.
        time.sleep(1)
        conn.send(self.stomp_destination, json.dumps(fullmessage))
        conn.disconnect()

キャプチャ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants