Testing the integration of the chat services from WebTop

Continuing the discussion from More Webtop Questions (signatures, chat, public folder):

1 Like

If you get these errors, please enter the whole line in a terminal and check the output for errors.

No, the documentation should provide all you need.

No need to point to the Nethserver ejabberd. If configured as described in the docs, it should just work.

Maybe. Is the ejabberd service running?

systemctl status ejabberd

Does it work if you connect from another client (to check if it’s an ejabberd or webtop issue) ?

I’d try the other things first but if nothing works, reinstalling an app is always worth a try.

1 Like

Hello @mrmarkuz,

There is something wrong with my ejabberd running on my nethserver. The service was not running. I tried pressing start in the GUI but it would fail with the following command:

echo ‘{“action”:“start”,“name”:“ejabberd”}’ | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/system-services/update | jq

So I issued this command in the terminal and the service would again Fail with the following:

{
“id”: “1602563010”,
“type”: “EventFailed”,
“message”: “Action failed”
}

I then searched on the forums and found a reference from nethserver support that perhaps the database was corrupted so I cleaned it up using these commands:

service ejabberd stop
rm -rf /var/lib/ejabberd/spool/*
service ejabberd start

This finally allowed my ejabberd service to successfully start.

So I tried accessing the WebTop Chat again but when I login I once again have the same error that Webtop can’t access the chat server.

So then I went into ejabberd application and turned it off. I then turned it back on again and received an error that ejabberd could not start. The command it was issuing was this:

echo ‘{“configuration”:{“props”:{“status”:“enabled”,“WebAdmin”:“disabled”,“S2S”:“disabled”,“ModMamStatus”:“disabled”,“ModMamPurgeDBStatus”:“disabled”,“ModMamPurgeDBInterval”:“30”,“ModHttpUploadStatus”:“disabled”,“ModHttpUploadQuotaStatus”:“enabled”,“ModHttpUploadQuotaMaxDay”:“30”,“ShaperFast”:“1000000”,“ShaperNormal”:“500000”}}}’ | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-ejabberd/update | jq

This resulted in the following results showing an error at the end. I’m not sure what all these errors mean.

{
“steps”: 2,
“pid”: 7320,
“args”: “”,
“event”: “nethserver-ejabberd-save”
}
{
“step”: 1,
“pid”: 7320,
“action”: “S05generic_template_expand”,
“event”: “nethserver-ejabberd-save”,
“state”: “running”
}
{
“progress”: “0.50”,
“time”: “0.103037”,
“exit”: 0,
“event”: “nethserver-ejabberd-save”,
“state”: “done”,
“step”: 1,
“pid”: 7320,
“action”: “S05generic_template_expand”
}
{
“step”: 2,
“pid”: 7320,
“action”: “S90adjust-services”,
“event”: “nethserver-ejabberd-save”,
“state”: “running”
}
{
“progress”: “1.00”,
“time”: “104.432497”,
“exit”: 256,
“event”: “nethserver-ejabberd-save”,
“state”: “done”,
“step”: 2,
“pid”: 7320,
“action”: “S90adjust-services”
}
{
“pid”: 7320,
“status”: “failed”,
“event”: “nethserver-ejabberd-save”
}
{
“type”: “EventError”,
“id”: 1602564012,
“message”: “update_action_failed”
}

Can you or someone from @support_team assist with why I’m having so much trouble with my ejabberd?

Thank you.

The nethserver-ejabberd-save event is fired to save the configuration and during this action there’s an error. You can also run it on CLI with signal-event nethserver-ejabberd-save.

Please check /var/log/messages for errors (it should be near the nethserver-ejabberd-save event).

Let’s check the ejabberd config:

config show ejabberd

Please also check if there are some forgotten custom templates in /etc/e-smith/templates-custom/....

1 Like

Hello @mrmarkuz,

I’ve issued the above command and run a tail on /var/log/messages. Here are the results I can see related to the ejabberd-save event:

Oct 13 14:22:29 swasdomain esmith::event[31530]: Event: nethserver-ejabberd-save
Oct 13 14:22:29 swasdomain esmith::event[31530]: expanding /etc/ejabberd/ejabberd.yml
Oct 13 14:22:29 swasdomain esmith::event[31530]: Action: /etc/e-smith/events/actions/generic_templat e_expand SUCCESS [0.148432]
Oct 13 14:22:29 swasdomain systemd: Reloading.
Oct 13 14:23:31 swasdomain systemd: ejabberd.service: control process exited, code=exited status=1
Oct 13 14:23:31 swasdomain systemd: Failed to start ejabberd XMPP Server.
Oct 13 14:23:31 swasdomain systemd: Unit ejabberd.service entered failed state.
Oct 13 14:23:31 swasdomain systemd: ejabberd.service failed.
Oct 13 14:23:31 swasdomain esmith::event[31530]: Job for ejabberd.service failed because the control process exited with error code. See “systemctl status ejabberd.service” and “journalctl -xe” for details.
Oct 13 14:23:31 swasdomain esmith::event[31530]: [INFO] service ejabberd restart
Oct 13 14:23:31 swasdomain systemd: Stopped ejabberd XMPP Server.
Oct 13 14:23:31 swasdomain systemd: Starting ejabberd XMPP Server…
Oct 13 14:24:37 swasdomain systemd: ejabberd.service: control process exited, code=exited status=1
Oct 13 14:24:37 swasdomain systemd: Failed to start ejabberd XMPP Server.
Oct 13 14:24:37 swasdomain systemd: Unit ejabberd.service entered failed state.
Oct 13 14:24:37 swasdomain systemd: ejabberd.service failed.
Oct 13 14:24:37 swasdomain esmith::event[31530]: Job for ejabberd.service failed because the control process exited with error code. See “systemctl status ejabberd.service” and “journalctl -xe” for details.
Oct 13 14:24:37 swasdomain esmith::event[31530]: [WARNING] restart service ejabberd failed!
Oct 13 14:24:37 swasdomain systemd: Reloading.
Oct 13 14:24:38 swasdomain esmith::event[31530]: [INFO] service httpd reload
Oct 13 14:24:38 swasdomain systemd: Reloading The Apache HTTP Server.
Oct 13 14:24:38 swasdomain systemd: Reloaded The Apache HTTP Server.
Oct 13 14:24:38 swasdomain esmith::event[31530]: Action: /etc/e-smith/events/actions/adjust-services FAILED: 1 [128.339488]
Oct 13 14:24:38 swasdomain esmith::event[31530]: Event: nethserver-ejabberd-save FAILED
Oct 13 14:24:43 swasdomain systemd: ejabberd.service holdoff time over, scheduling restart.
Oct 13 14:24:43 swasdomain systemd: Stopped ejabberd XMPP Server.
Oct 13 14:24:43 swasdomain systemd: Starting ejabberd XMPP Server…

Here are the contents of ejabberd config file:

[root@swasdomain ~]# config show ejabberd
ejabberd=service
ModHttpUploadQuotaMaxDay=30
ModHttpUploadQuotaStatus=enabled
ModHttpUploadStatus=disabled
ModMamPurgeDBInterval=30
ModMamPurgeDBStatus=disabled
ModMamStatus=disabled
S2S=disabled
ShaperFast=1000000
ShaperNormal=500000
TCPPorts=5222,5223,5269,5280,5443
WebAdmin=disabled
access=green,red
status=enabled

My ‘/etc/e-smith/templates-custom/’ folder is empty so no forgoteen custom templates exist.

Thank you.

The config looks good.

Please also check /var/log/ejabberd/* for errors.

1 Like

Hello @mrmarkuz,

Now we’re onto something here. I see the following messages in my /var/log/ejabberd/error.log:

2020-10-13 18:01:17.251 [error] <0.365.0>@ejabberd_pkix:log_errors:401 Failed to read PEM file /etc/ejabberd/ejabberd.pem: at line 61: no matching private key found for this certificate
2020-10-13 18:01:17.251 [critical] <0.365.0>@ejabberd_pkix:stop_ejabberd:352 ejabberd initialization was aborted due to invalid certificates configuration

And in /var/log/ejabberd/ejabberd.log I see similar messages:

2020-10-13 18:02:27.480 [notice] <0.120.0>@lager_file_backend:152 Changed loghwm of /var/log/ejabberd/error.log to 100
2020-10-13 18:02:27.480 [notice] <0.120.0>@lager_file_backend:152 Changed loghwm of /var/log/ejabberd/ejabberd.log to 100
2020-10-13 18:02:27.625 [info] <0.106.0>@ejabberd_config:load:82 Loading configuration from /etc/ejabberd/ejabberd.yml
2020-10-13 18:02:27.815 [warning] <0.106.0>@gen_mod:warn_soft_dep_fail:582 Module mod_mam is recommended for module mod_muc but is not found in the config
2020-10-13 18:02:27.840 [info] <0.106.0>@ejabberd_config:load:89 Configuration loaded successfully
2020-10-13 18:02:29.354 [info] <0.341.0>@gen_mod:start_modules:130 Loading modules for swaslab.local
2020-10-13 18:02:29.676 [info] <0.106.0>@ejabberd_cluster_mnesia:wait_for_sync:123 Waiting for Mnesia synchronization to complete
2020-10-13 18:02:29.734 [error] <0.365.0>@ejabberd_pkix:log_errors:401 Failed to read PEM file /etc/ejabberd/ejabberd.pem: at line 61: no matching private key found for this certificate
2020-10-13 18:02:29.734 [warning] <0.365.0>@ejabberd_pkix:log_warnings:393 Invalid certificate in /etc/ejabberd/ejabberd.pem: at line 28: certificate is signed by unknown CA
2020-10-13 18:02:29.734 [critical] <0.365.0>@ejabberd_pkix:stop_ejabberd:352 ejabberd initialization was aborted due to invalid certificates configuration

I’ve been using my own company certs which I’ve uploaded to Nethserver (valid until may 2021). What would be the issue with my ejabberd using the certs I’ve added to Nethserver?

Thank you.

[quote=“greavette, post:7, topic:16694”]
I’ve been using my own company certs which I’ve uploaded to Nethserver
[/quote]/etc/

Did you set it as default?

If yes please compare the /etc/ejabberd/ejabber.pem with /etc/pki/tls/localhost.crt and /etc/pki/tls/private/localhost.key

A pem certificate can be the crt plus the key file, see https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files

Maybe it’s enough to set the wanted certificate as default in Cockpit again and then restart ejabberd. Sometimes the process of setting certs for the apps is interrupted.

2 Likes

Hello @mrmarkuz,

Once again your patience has helped me find my issue. The cert used for ejabberd was the localhost cert on Nethserver which is not what I uploaded or use on my HAProxy server. I’ve modified the ejabber.pem file to be what I need and my ejabberd connection issues have now been fixed. Service starts and stays running. My WebTop now has a chat fuction that works.

I even have the ejabberd Admin working now as wel. I had to figure out that after creating the jabberadmins group I login with my @.com. I had tried logging in with just my domain userid without the @domain afterwards but this wouldn’t work.

Thanks!

2 Likes

Hey @mrmarkuz or @alefattorini,

Where’s the solve box on this post? I wanted to complete it so others can see a solution was found. But since this post was split from my original I don’t see a solve box any longer.

Thank you.

1 Like

Three dots on the post to be marked as solution.

2 Likes

Hi @dnutan,

Do you mean these three dots?

image

When I expand these three dots on the post I want to mark as solving my issue I only see the following:

image

Thank you.

Maybe some moderator should add a support tag…

Yes, but you do not see it as only the original thread owner (now I see this thread was opened by Alessio) and moderators can mark it as solved.
Tell me which post do you want to be marked as solution so I can do if for you.

2 Likes

Thank you Marc for your help!

Please add solve to the 8th post (Markus) - Testing the integration of the chat services from WebTop.

The post where he has me check the pem cert files for ejabberd to make sure they are correct.

Thanks!

1 Like

Sorry my fault I forgot to change the owner :slight_smile:

3 Likes