Bug 555091 - Microblog Plugin fail to generate alert.
Summary: Microblog Plugin fail to generate alert.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 1.4.0.B01
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Heiko W. Rupp
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: RHQ_Alerts 547864 rhq_sprint06
TreeView+ depends on / blocked
 
Reported: 2010-01-13 16:20 UTC by spandey
Modified: 2015-04-23 23:55 UTC (History)
6 users (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:57:14 UTC
Embargoed:


Attachments (Terms of Use)
rhq-server-log4j.log for bug 555091 (401.67 KB, text/x-log)
2010-01-25 09:52 UTC, spandey
no flags Details
attached microblog config (125.50 KB, image/jpeg)
2010-01-25 12:48 UTC, spandey
no flags Details
new rhq-server.log (418.27 KB, text/x-log)
2010-01-27 10:34 UTC, spandey
no flags Details
Screenshot of debugger variables (53.88 KB, image/png)
2010-02-19 12:40 UTC, Heiko W. Rupp
no flags Details

Description spandey 2010-01-13 16:20:08 UTC
Description of problem:

Microblog Plugin fail to generate alert.

Version-Release number of selected component (if applicable):


How reproducible:


Prerequisite

1)Properly configured Rhq Host.
2)Twitter account .

Steps to repro : 

1)Login to Rhq web console with valid credentials .
2)Configure server side microblog plugin for Twitter account.
3)Create a alert for rhq host samba server (Availability “Goes down” )select microblog option form “To Alert sender plugin”.
4)Manually stop samba service from rhq Host console .


Expected Result : Alert should received on Twitter Account .

Actual Result : Not received alert via microblog plugin on twitter account.

Additional info:

Comment 1 Heiko W. Rupp 2010-01-21 15:47:53 UTC
Is the alert recorded in the resources summary page?
What is shown in the console / rhq-server.log when the alert sender is firing?

Comment 2 spandey 2010-01-25 09:46:58 UTC
(In reply to comment #1)
> Is the alert recorded in the resources summary page?
> What is shown in the console / rhq-server.log when the alert sender is firing?    

For samba Availability goes down no alert has been recorded in resource summary page.


No alert fired has been recorded in rhq-server-log4j.log for samba availability log.


2nd scenario :

properly configure microblog alert plugin.
configure alert for memory usage value change and select microblog option from "To Alert sender plugin".

For this scenario alert has been recorded in resource summary page.

But not receiving alert on twitter account .

rhq-server-log4j.log displays following error 


Error: you are requesting an invalid URL.

Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at twitter4j.http.Response.asDocument(Response.java:165)
        ... 209 more
2010-01-25 04:06:30,043 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Sending failed :The response body was not well-formed:
Error: you are requesting an invalid URL.
', state=FAILURE, emails=[]}

Comment 3 spandey 2010-01-25 09:52:22 UTC
Created attachment 386576 [details]
rhq-server-log4j.log for bug 555091

Find the attached rhq-server-4j.log

Comment 4 Heiko W. Rupp 2010-01-25 10:22:53 UTC
Can you please attach the properties from the server plugin configuration page for the microblog sender?

Comment 5 Heiko W. Rupp 2010-01-25 10:28:07 UTC
I think I may have an idea on what is going on - the base url may just be wrong - did you specify one or remove it?
Can you try to explicitly set the base url in the config page to "http://twitter.com/" ?

Comment 6 spandey 2010-01-25 12:38:17 UTC
(In reply to comment #5)
> I think I may have an idea on what is going on - the base url may just be wrong
> - did you specify one or remove it?

i did not changed or removed any value .

> Can you try to explicitly set the base url in the config page to
> "http://twitter.com/" ?  

Already done , still not received alert on twitter account

Comment 7 spandey 2010-01-25 12:48:30 UTC
Created attachment 386608 [details]
attached microblog config

Comment 8 spandey 2010-01-27 10:34:28 UTC
Created attachment 387029 [details]
new rhq-server.log

Comment 9 Heiko W. Rupp 2010-01-27 11:00:29 UTC
The new server log shows 

2010-01-27 05:09:22,593 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Send notification to http://twitter.com/ as user sachitanandp id: 8273876093', state=SUCCESS, emails=[]}
2010-01-27 05:10:22,798 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Send notification to http://twitter.com/ as user sachitanandp id: 8273876093', state=SUCCESS, emails=[]}

Those are 2 tweets one minute apart, that are successfully transferred to twitter and where twitter assigned the same id to both.
So it looks like twitter is filtering duplicates

Comment 10 Heiko W. Rupp 2010-01-27 11:19:50 UTC
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update
says
"Twitter will ignore attempts to perform a duplicate update. With each update attempt, the application compares the update text with the authenticating user's last successful update, and ignores any attempts that would result in duplication. Therefore, a user cannot submit the same status twice in a row. The status element in the response will return the id from the previously successful update if a duplicate has been silently ignored."

I will add an alert id to the front of the message, which hopefully changes the tweets enough (82d2bf3)

Comment 11 spandey 2010-02-09 11:29:34 UTC
Hi Heiko 

Again i am able to repro this issue on master build .

git sha id : 9a08cb7abd7b555b2846054d31a61e6fa75e9b8c

steps to repro : 

properly configure microblog alert plugin.
configure alert for memory usage value change and select microblog option from
" Alert sender notification "(Alert Page).

For this scenario alert has been recorded in resource summary page.

But not receiving alert on twitter account .


Log details : 

2010-02-09 16:43:41,617 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Sending failed :twitter.com', state=FAILURE, emails=[]}
2010-02-09 16:43:41,626 INFO  [org.rhq.enterprise.server.util.concurrent.AlertSerializer] tid= 659: alertDefinitionId=10001: releasing write lock after being locked for millis=30056
2010-02-09 16:44:12,559 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Send notification to user@baseUrl [sachitanandp@http://twitter.com/]:, msg-id: 8272978748', state=SUCCESS, emails=[]}
2010-02-09 16:45:12,923 INFO  [org.rhq.enterprise.server.alert.AlertManagerBean] SenderResult{message='Send notification to user@baseUrl [sachitanandp@http://twitter.com/]:, msg-id: 8272978748', state=SUCCESS, emails=[]}
2010-02-09 16:46:41,589 WARN  [org.rhq.enterprise.server.plugins.alertMicroblog.MicroblogSender] Notification via Microblog failed for user@baseUrl [sachitanandp@http://twitter.com/]: 
twitter4j.TwitterException: twitter.com
	at twitter4j.http.HttpClient.httpRequest(HttpClient.java:484)

Comment 12 wes hayutin 2010-02-17 13:27:19 UTC
mass move to rhq_chainsaw tracker bug

Comment 13 wes hayutin 2010-02-18 14:49:52 UTC
This bug has now been triaged by Chainsaw on 2/18. The expectation is the bug to be addressed by the end of sprint06 roughly 3/10/10.

Comment 14 Heiko W. Rupp 2010-02-19 12:40:03 UTC
Created attachment 395089 [details]
Screenshot of debugger variables

Screenshot of debugger variables

Comment 15 Bryan Kearney 2010-02-19 13:14:13 UTC
Does that mean "works for me"?

Comment 16 Heiko W. Rupp 2010-02-20 08:50:34 UTC
I am not sure how much more random changes are needed to trick Twitter in
accepting the data.
As you can see in the screenshot, the message has changed in multiple ways from
what twitter has recorded as the previous tweet and still the new tweet is
failing with what looks like the duplicate filter has kicked in.

The code is e.g. able to send to our internal status.net instance without issues.
I was also able to send to twitter for quite a number of times in a row without issues.
So it may also have to do with the fact that the used accounts are "fresh" and
the alerts all look too similar to each other.

I assume that if a company deploys status.net for such alerting, they have a
way to switch off the dup-filter.

I have added some code in 32b3daf  to shorten the message to 140 chars -
status.net was complaining and this may have had an influence on the twitter
reaction too (looks more stable too).
Commit 32b3daf also introduces abbreviations of the message texts in order to
conserve space and thus allow to show more content.

Comment 17 Steve Salevan 2010-03-09 20:19:11 UTC
VERIFIED on 4/9 master branch git pull.

Comment 18 wes hayutin 2010-03-10 14:19:41 UTC
moving verified bugs to rhq_sprint06, and removing from rhq_chainsaw

Comment 19 Corey Welton 2010-08-12 16:57:14 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.