Flyspray - The bug killer!

  • Status New
  • Percent Complete
    0%
  • Task Type Feature Request
  • Category Notifications → XMPP/Jabber
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version 1.0 alpha1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
    • V (10.02.2017)
  • Private
Attached to Project: Flyspray - The bug killer!
Opened by peterdd - 22.06.2015

FS#1999 - jabber xmpp configuration

There should be some help at the configuration sections for setting up jabber/xmpp notifications.

How someone can test it?

Must the admin setup his own jabber/xmpp server or are there recommended servers?

I registered with psi+ instant messager as peterdd@ubuntu-jabber.de at ubuntu-jabber.de for testing
and configured it here in my account too, but got no jabber messages.

Email notifications works and I set up both sending.

V commented on 10.02.2017 15:01

Jabber notifications does not work. I have tried:

  • setting "Account Username" as "user"
  • setting "Account Username" as "user@server.com"
  • choosing encryption: TLS
  • choosing encryption: SSL
  • choosing encryption: None (despite my server has a valid signed certificate and my jabber client has no issues connecting, same as "xmpphp" PHP library which I use to send me notifications of my servers' status)

Login and password are correct, surely.

How do I debug this?

V commented on 10.02.2017 15:18

Forgot to tell that I have set "Notify Type" to "Jabber" in my user profile.

Project Manager
peterdd commented on 11.02.2017 00:24

It seems, jabber notifications are only sent by the schedule.php, not by the http request that triggers a notification event.

grep -rin SendJabber *
includes/class.notify.php:272:   function SendJabber()
schedule.php:82:  $notify->SendJabber();

So create a cronjob that calls schedule.php
Example:

crontab -l
7  * * * * php html/flyspray/schedule.php

(this example sends at 7th minute every hour)

For testing

php schedule.php

(prefer a php cli mode executable) should do the job too.

Also reminder_daemon="1" must be set in flyspray.conf.php

To debug you can for example add a

print_r($JABBER);

at the end before return true;
in class.notify.php in function SendJabber().

I got something working now looking a bit like this with a prosody jabber server (using letsencrypt cert)

php5.4-cli schedule.php
Jabber Object
(
    [connection] => Resource id #36
    [session] => Array
        (
        )

    [resource] => class.jabber2.php
    [log] => Array
        (
            [0] => SEND: <?xml version='1.0' encoding='UTF-8' ?>
....
 [77] => No further recipients for message id {9}
            [78] => - Notification deleted
            [79] => SEND: </stream:stream>
            [80] => Disconnected from Jabber server
...

Project Manager
peterdd commented on 11.02.2017 00:34

You get no jabber notifications from bugs.flyspray.org, simply because there is currently no valid setup configured on bugs.flyspray.org

V commented on 11.02.2017 09:12

Somewhy it tells me that login or password is incorrect, but this is wrong as I use the same login and password in the other script (XMPPHP) without problems.

. . . 
    [3]=>
    string(17) "Switching to TLS."
    [4]=>
    string(57) "SEND: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
    [5]=>
    string(56) "RECV: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
    [6]=>
    string(45) "SEND: <?xml version='1.0' encoding='UTF-8' ?>"
    [7]=>
    string(120) "SEND: <stream:stream to='my.server' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"
    [8]=>
    string(362) "RECV: <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='my.server' id='5f71ca30-6416-4fc3-9976-a9825146d657' xml:lang='en' xmlns='jabber:client'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>"
    [9]=>
    string(118) "SEND: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>.... login and password in base64 here....</auth>"
    [10]=>
    string(128) "RECV: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><malformed-request/><text>Invalid username or password.</text></failure>"
    [11]=>
    string(29) "Error: Server sent "failure"."
. . .
V commented on 11.02.2017 11:09

I've found out that XMPPHP library sends base64'd string "null-byte LOGIN null-byte PASSWORD" while Flyspray sends base64'd string "null-byte LOGIN@SERVER null-byte PASSWORD" which results in authentication failure.
I'm using Prosody too btw.

V commented on 11.02.2017 11:39

Well, changing "includes/class.jabber2.php" line 357 from

                                       . base64_encode(chr(0) . $this->user . '@' . $this->server . chr(0) . $this->password) .

to

                                      . base64_encode(chr(0) . $this->user . chr(0) . $this->password) .

fixed the issue to me. I think it depends on the jabber server settings.

V commented on 11.02.2017 17:04

Notifications "You have been assigned the following task:" come before notifications "A new Flyspray task has been opened. Details are below. ".
It should be a different order - first "task opened", then "you have been assigned".

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing