Howto configure XMPP chat? #732

Open
Aendrew87 opened this Issue Aug 1, 2016 · 50 comments

Projects

None yet

6 participants

@Aendrew87

I updates from 0.2.1 to 0.3.0 and tried to use chat but nothing happens.

I found out that there is a configuration page (/#/settings/11).
But what should I insert in this fields?

  • Bosh Service URL
  • Jabber Host
  • Client Resource Name

In the demo (board.demo.restya.com) the chat is not configured too and I was also not able to start it.

@rrjanbiah
Contributor

@Aendrew87 Sorry about the delay. Yes, the options aren't user friendly. We'll definitely improve. In the meantime, please refer:

Bosh Service URL
http://example.com:5280/http-bind/
Jabber Host
example.com
Client Resource Name
restya

@Aendrew87

@rrjanbiah thx for your answer - today it did not work - next week I will travel a little bit but after that week I will have a look on this case.

@rrjanbiah
Contributor

@Aendrew87 Thanks for your note. Please check if your ejabberd is up and running in the mentioned host and port.

@BlackDuck888

i did't get XMPP run. i think everything is fine. i used the ejabber.yml from your github.

the apache log shows.

[Sun Aug 07 18:25:04.154746 2016] [:error] [pid 17425] [client 192.168.195.30:59468] PHP Fatal error: Uncaught XmppPrebindConnectionException: No encryption supported by the server is supported by this library. in /var/www/restyaboard/server/php/libs/vendors/xmpp-prebind-php/XmppPrebind.php:156\nStack trace:\n#0 /var/www/restyaboard/server/php/R/r.php(57): XmppPrebind->connect('BlackDuck', NULL)\n#1 /var/www/restyaboard/server/php/R/r.php(5234): r_get('/xmpp_login', Array, Array)\n#2 {main}\n thrown in /var/www/restyaboard/server/php/libs/vendors/xmpp-prebind-php/XmppPrebind.php on line 156, referer: http://restya.fritz.box/

@Aendrew87

@rrjanbiah i tried to install v0.3.0 (with the installations script) on a cleane debian but now I got some information doubled.
I also tried to execute the steps without the script but got the same result.
xmpp

This is a screenshot after i saved the configuration and reloaded the page.
I entered the following informations:
Bosh Service URL: http://192.168.254.129:5280/http-bind/
Jabber Host: 192.168.254.129
Client Resource Name: restya

this also happens to my boards (i created only one board)
boards

there are also pages where everything looks good.
login

On my real installation this error did not occure but there i count not test this things.

Any ideas how to solve this doubled entries and start the test of xmpp?

@rrjanbiah
Contributor

@Aendrew87 Sorry about that. This is a known issue #705 and fixed in dev branch. But, due to some other priority in hand, we couldn't release in time.

@BlackDuck888

@Aendrew87 you can try my installscript, it is a beta but it work better right now. some different is that i am using apache. i would prefer a clean ubuntu but the latest debian should work to.

[https://github.com/BlackDuck888/board/tree/contrib/installscript/install]

@Aendrew87

@BlackDuck888 the solution in #705 is to execute a few sql statemente so I think this is less work
@rrjanbiah no problem, so I will try to execute this sql statements on my test installation

@Aendrew87

@rrjanbiah the two sql statements from #705 solved the doubled information

After that I found several problems with the ejabberd configuration :(

  1. ejabberd is not started after a reboot
  2. The configfile (ejabberd.yml) had default username and password (there where some errors in '/var/log/ejabberd/error.log')
  3. The sql dump was imported with user 'postgres' (psql -d ${EJABBERD_DBNAME} -f "/opt/ejabberd-15.07/sql/pg.sql" -U postgres) (there were some permission errors in the error.log)

So I fixed the issues

  1. Started ejabberd (ejabberdctl start)
  2. Updated '/etc/ejabberd/ejabberd.yml' with the username and password from the install script
  3. Deleted database 'ejabberd' and imported the sql file with user 'ejabb' (psql -d ${EJABBERD_DBNAME} -f "/opt/ejabberd-15.07/sql/pg.sql" -U ${EJABBERD_DBUSER})

No I get no errors in 'error.log' but some errors in 'ejabberd.log'.

Here is my 'ejabberd.log.txt' as a txt file.
In the log I found a line

Failed authentication for admin@192.168.254.129

I logged in with user admin but dont know what's going wrong now.

@BlackDuck888

@Aendrew87 Is ejabber working within rastyaboard with this modification? I think i did same in my install script, admin logon work for me, but within rastyaboard i did get it work.

@Aendrew87

@BlackDuck888 No, it does not work - I still get 'Failed authentication for admin@192.168.254.129'

@Aendrew87
Aendrew87 commented Aug 16, 2016 edited

@BlackDuck888 In your install script you do more steps then i did

sed -i 's/restya.com/'$webdir'/g' /etc/ejabberd/ejabberd.yml
sed -i 's/ejabberd15/'${EJABBERD_DBNAME}'/g' /etc/ejabberd/ejabberd.yml

echo "Changing PostgreSQL ejabberd database name, user and password..."
sed -i "s/^._'CHAT_DB_HOST'._$/define('CHAT_DB_HOST', '${EJABBERD_DBHOST}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^._'CHAT_DB_USER'._$/define('CHAT_DB_USER', '${EJABBERD_DBUSER}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^._'CHAT_DB_PASSWORD'._$/define('CHAT_DB_PASSWORD', '${EJABBERD_DBPASS}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^._'CHAT_DB_NAME'._$/define('CHAT_DB_NAME', '${EJABBERD_DBNAME}');/g" "$dir/server/php/config.inc.php"
sed -i "s/^._'CHAT_DB_PORT'._$/define('CHAT_DB_PORT', '${EJABBERD_DBPORT}');/g" "$dir/server/php/config.inc.php"

I will try this changes, maybe that helps.

@Aendrew87

ok, i checked the changes.

In config.inc.php the install script did all the work.
In ejabberd.yml there was no 'ejabberd15'.

So this not the solution :(

@Aendrew87

@BlackDuck888 today you owned some kisses... with your install script the chat is working - one suggestion for your script: install 'git' because it is needed for ejabberd (#722)

Tomorrow I will compare the differences between my first installation in the current installation.

@BlackDuck888

@Aendrew87

  • i download the ejabberd.yml from https://github.com/RestyaPlatform/board/blob/master/ejabberd.yml in this config 'ejabberd15' exist
  • in the original script the username and dbname are swapped, thats is definitely wrong
  • i added git right now, ejabberd should not need it because i use the dist package, but i need it for the rasty apps

You say the chat is working, is it working within restyaboard? Thats is the thing i did't get working right now. What have you done after using my script? which os you are running?

@Aendrew87

@BlackDuck888

i download the ejabberd.yml from https://github.com/RestyaPlatform/board/blob/master/ejabberd.yml in this config 'ejabberd15' exist

I checked that and you are right. The 'ejabberd15' is the name of the database.
In your install script you use this command:
sed -i 's/ejabberd15/'${EJABBERD_DBNAME}'/g' /etc/ejabberd/ejabberd.yml
So I only searched for 'ejabberd15' but the name of the database was allready changed.
Maybe you would update this line with something like that:
sed -i 's/odbc_database: \"ejabberd15\"/'${EJABBERD_DBNAME}'/g' /etc/ejabberd/ejabberd.yml
For username and password you allready did that.

in the original script the username and dbname are swapped, thats is definitely wrong

Yes, but this did not solve my problem.

i added git right now, ejabberd should not need it because i use the dist package, but i need it for the rasty apps

The dis package could be the difference. I compared the yml-file I had and there where some differences (dont't know why). With this old yml file and the installation with your script I was not able to START ejabberd (process was hangig during startup).
I also tried the old installation with nginx, added the dist package (removed the old ejabberd before) and changed the yml file but this did not work at all.

In the next days I will try to compare a few more files. Maybe there is another difference.

Regarding your last questions:

You say the chat is working, is it working within restyaboard?

Yes, I thought so but there seems to be still an issue - after a reboot all boards are 'deleted' from chat

What have you done after using my script?

I only configured the three options from above.

which os you are running?

debian 8.5

Here are the screenshot from the running chat
chat

And how it looks like after a reboot
chat2

@BlackDuck888

@Aendrew87 i get this.
screen

i never got connected, and i used my script on debian 8.5 to.

are you german? i saw the german header in the window. (dann können wir das auch auf deutsch machen, meine email ist im github sichtbar)

@rrjanbiah
Contributor

@Aendrew87 @BlackDuck888 As we're about to work on this ticket, is there any useful information that you may share here? Thanks for your help.

@Aendrew87

@rrjanbiah yes, we are discussing the case via mail.

We installed several times and in some cases the chat works (until a reboot) but in many cases the chat does not work.
At the moment there is no solution for this problem and we are still installing and testing.

@rrjanbiah
Contributor

@Aendrew87 Many thanks for your note.

@BlackDuck888

@rrjanbiah all my installation ended with the errormassage written above (XmppPrebindConnectionException: No encryption supported by the server is supported by this library) in Apache log. i think there is an lib missing or xmppPrebind has a bug, but i can't figure it out.

@rrjanbiah
Contributor

@BlackDuck888 Thanks for your note too. Much appreciated.

@EllaStique
EllaStique commented Aug 26, 2016 edited

I've got a similar problem, with also "XmppPrebindException, cannot connect to service". By checking some files (.../libs/vendors/xmpp-prebind-php/XmppPrebind.php and ...html/restyaboard/server/php/R/r.php) it looks like the chat needs a password even if no account is created ...

@BlackDuck888

@EllaStique i don't know how you installed the restyaboard, but in the origin script is a bug (where dbname and dbuser switched) so restyaboard is not able to connect to the database.

@EllaStique

@BlackDuck888 Oh, that could be it, I'm going to check, thank you !

@BlackDuck888

One thing that i could figure out, is that the locales play a role in this issue. If i install my system with us locales it works, if i use the german locales it does not.

what i can't figure out right now, which service (postgre, xmpp-prebind, apache, php) has the problem with the "wrong" locales. This points for me in direction postgre https://www.postgresql.org/docs/9.3/static/multibyte.html somewhere in the mid

When copying any other database, the encoding and locale settings cannot be changed from those of the source database, because that might result in corrupt data.

Maybe someone from the devteam has a hint for me.

@BlackDuck888
BlackDuck888 commented Sep 12, 2016 edited

Right now, ist works for me with a plain installation of ubuntu 15.10 or 16.04. I think there are some new packages which fix this problem. Looking to my old test vm it looks like the bosh service was faulty and hasn't work.

@Aendrew87 i think this issue can be closed.

the correct settings were mention in the second post.

@Aendrew87

@BlackDuck888 thx for reply - i will check that the next days

@Aendrew87

I testet on my virtual debian system.

The result:

  • With the install script from BlackDuck888 and the configuration from above the chat works but after a restart all the existing boards are removed from the chat list (when creating new boards i could use them but they get lost after a reboot too)
  • With the original install script i could still not get the chat working (i also tried to use the ejabberd-dist-package as BlackDuck888 does in his install script)

So at the moment, for me, the chat does not work and i have no idea how to solve this.

@rrjanbiah
Contributor

@Aendrew87 Thanks for your note. We're trying our best to reproduce it on our end and to fix it once. Will update as early as possible.

@BlackDuck888

@rrjanbiah i can confirm this bug under debian. I set up a new machine and facing into the same problem.

it looks like thats some db activities can't set, and then a rollback is done.

2016-09-14 13:00:07 CEST [903-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [902-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [900-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [904-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [905-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [908-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [907-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [906-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [901-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [899-1] ejabb@ejabberd LOG: Anweisung: SELECT oid, typname FROM pg_type
2016-09-14 13:00:07 CEST [905-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [908-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [907-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [907-3] ejabb@ejabberd FEHLER: tuple concurrently updated
2016-09-14 13:00:07 CEST [907-4] ejabb@ejabberd ANWEISUNG: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [906-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [901-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [901-3] ejabb@ejabberd FEHLER: tuple concurrently updated
2016-09-14 13:00:07 CEST [901-4] ejabb@ejabberd ANWEISUNG: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [899-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [904-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [904-3] ejabb@ejabberd FEHLER: tuple concurrently updated
2016-09-14 13:00:07 CEST [904-4] ejabb@ejabberd ANWEISUNG: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [900-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [902-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [902-3] ejabb@ejabberd FEHLER: tuple concurrently updated
2016-09-14 13:00:07 CEST [902-4] ejabb@ejabberd ANWEISUNG: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [903-2] ejabb@ejabberd LOG: Anweisung: alter database ejabberd set standard_conforming_strings='off';
2016-09-14 13:00:07 CEST [907-5] ejabb@ejabberd LOG: Anweisung: ROLLBACK
2016-09-14 13:00:07 CEST [901-5] ejabb@ejabberd LOG: Anweisung: ROLLBACK
2016-09-14 13:00:07 CEST [904-5] ejabb@ejabberd LOG: Anweisung: ROLLBACK
2016-09-14 13:00:07 CEST [902-5] ejabb@ejabberd LOG: Anweisung: ROLLBACK
2016-09-14 13:00:07 CEST [908-3] ejabb@ejabberd LOG: Anweisung: select name, opts from muc_room where host='conference.restya.intra.veenkergmbh.de';
2016-09-14 13:00:07 CEST [902-6] ejabb@ejabberd WARNUNG: keine Transaktion offen
2016-09-14 13:00:07 CEST [904-6] ejabb@ejabberd WARNUNG: keine Transaktion offen
2016-09-14 13:00:07 CEST [901-6] ejabb@ejabberd WARNUNG: keine Transaktion offen
2016-09-14 13:00:07 CEST [907-6] ejabb@ejabberd WARNUNG: keine Transaktion offen

@BlackDuck888

extention to my post befor, ubuntu 15.10 shows the similar error in log, but no ROLLBACK.
And the chatrooms are avaible after a reboot of the server, but a board which is created before xmpp is configured in settings will never be created.

@Aendrew87

@rrjanbiah if you could not reproduce i could share my debian vm with you

@lmarikannan
Contributor

@Aendrew87 Can you please share your debian vm?

@Aendrew87

@lmarikannan sure, please give me a few days to upload the files - is a vmware workstation 10 image ok for you or do you want another image (VirtualBox or other)?

@lmarikannan
Contributor

@Aendrew87 Can you please share VirtualBox version 5.0.26 r108824 image?

@lmarikannan lmarikannan added this to the v0.4 milestone Oct 24, 2016
@Aendrew87

@lmarikannan sorry, but my provider disconnected my internet and is not able to fix the problem. i will create the VirtualBox image and upload it as soon as possible

@Aendrew87

@lmarikannan I got the information that my provider needs about 9 days from now to fix the internet connection - After that time I will try to create the image and upload it

@lmarikannan
Contributor

@Aendrew87 Thank you for your updates.

@Aendrew87

@lmarikannan my provider solved the problem and now i was able to create your new VirtualBox (5.0.26) image and upload it (both links are the same file):
https://drive.google.com/file/d/0B22r_4IMDwj5RV9xVGVrc1NrZjg/view?usp=sharing
https://www.dropbox.com/s/vy8yf6e9y4vt1h8/Debian8.5.zip?dl=0

password for user 'root' is 'root'
the dns name is 'testboard.local'
after the boot you need to start ejabberd

for further questions just ask me :)

@lmarikannan
Contributor

@Aendrew87 Sorry about the delay. We have downloaded the VM. We will check and update you.

@lmarikannan
Contributor

@Aendrew87 We have checked the VM provided by you and there is no software installed in that. Can you please check or let us know the way to proceed?

@Aendrew87

@lmarikannan have you checked the snapshots too? i just downloaded the file and there should be several snapshots - the right one is 'chat not working'

@lmarikannan
Contributor

@Aendrew87 We have checked the snapshots folder and cannot able to find it. Can you please check the attachment?

snapshots

@Aendrew87

@lmarikannan sorry, i missed to tell you an important thing about the vm... you need local dns entry for 'testboard.local'...

  1. Download and install VirtualBox
  2. Download and unzip Debian8.5.zip
  3. Start the vm with snapshot 'chat not working' (there might be an error to change the network adapter)
    01
  4. Login as root and get the current ip (ifconfig)
    03
  5. Create local dns entry 'testboard.local' for this ip (in my case '192.168.1.124') (Windows user use the file 'C:\Windows\System32\drivers\etc\hosts', linux users use the file '/etc/hosts')
    04
  6. On the vm start ejabberd service (ejabberdctl start) and wait a few seconds
  7. Open your browser and visit 'testboard.local'
    05

Now you should see the installed restyaboard and could login with the default user and password (user: admin | password: restya)

Hope that helps

@lmarikannan
Contributor

@Aendrew87 Like already we explained in the previous comment, we cannot able to find the chat not working snapshot inside snapshots folder.

@Aendrew87
Aendrew87 commented Nov 16, 2016 edited

@lmarikannan you could select the snapshot directly in VirtualBox.

I downloaded the Debian8.5.zip yesterday and got this after opening 'Debian8.5.vbox':
01
There the snapshot was allready selected.
On the right side you could change to the snapshot area.

This is the screenshot in my case (should be the same on your system):
02

@lmarikannan
Contributor

@Aendrew87 Thanks for your detailed explanation. We will check and update you.

@lgg
lgg commented Jan 10, 2017

@Aendrew87 any updates?

@Aendrew87

@lgg not yet

@lmarikannan could you give us a short update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment