Ejabberd muc room history getting erased when server restarts - xmpp

I am subscribing to a muc room and I am getting the messages when a user messages to muc room, everything upto here is fine, but when server restarts room history is getting erased, therefore I am unable to get any previous messages.
This is my mod_muc configuration in ejabberd.yml:
mod_mam:
default: always
db_type: sql
mod_muc:
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
default_room_options:
mam: true
persistent: true

when server restarts room history is getting erased
Right, because that recent history is not stored in any database, it is kept in temporary memory, like the list of current occupants. When the server stops, all that is forgotten.

Related

Per MUC channel bot managed by ejabberd

I would like to run one service process per MUC channel on an ejabberd server. Ideally I would like ejabberd to start / monitor that process.
That is, when a new MUC gets opened ejabberd should start the bot process and tell it the channel name through commandline options. The process will then connect to that MUC on its own and do its thing. in case it crashes, ejabberd should notice and try to restart it. In case the MUC gets closed, so should the bot process. Is such functionality available with ejabberd?
I am not aware of anything like that implemented.

Is it possible in haproxy to have sticky sessions based on cookie and still load balance?

So if this is the backend config:
backend main
mode http
balance leastconn
cookie serverid insert indirect nocache
stick-table type string len 36 size 1m expire 8h
stick on cookie(JSESSIONID)
option httpchk HEAD /web1 HTTP/1.0
http-check expect ! rstatus ^5
server monintdevweb 10.333.33.33:443 check cookie check ssl verify none #web1
server monintdevweb2 10.222.22.122:443 check cookie check ssl verify none #web2
server localmaint 10.100.00.105:9042 backup #maint
option log-health-checks
option redispatch
timeout connect 1s
timeout queue 5s
timeout server 3600s
It seems it always sends all users to web1. i.e. its not evenly load balancing using leastconn algorithm specified. I tried with stick table using src IP and that does what i want - ie persist sessions but each new session should get balanced between servers. Is it not possible to have that using cookies?
Another problem with cookies i noticed was that if I were to bring down services on the web1, all users get redirected to web2 and then redirected back to web1 when web1 is restored!! What real life scenario would find this behavior be useful?
After scouring the internet for a whole day and going thru every link that talks about load balancing and sticky sessions, I found the answer immediately after i posted the question. I need to use the "application ID" which will help load balancer differentiate between each user session so it can continue to load balance requests. I am not using IIS/asp.net so thats why it didn't hit me earlier. But here is the config that works..
change these lines..
cookie serverid insert indirect nocache
stick-table type string len 36 size 1m expire 8h
stick on cookie(JSESSIONID)
to:
stick-table type string len 36 size 1m expire 8h
stick on cookie(DWRSESSION)
where DWRSESSION is the my application session ID.

Prosody/Pidgin not sending buddy authorization requests

I'm setting up a Prosody XMPP server on my local machine for a proof of concept, and I just want to get a simple chat session going with myself. I set it to allow registration, and was able to register new users, but when I send a buddy request to one of the other users I've registered, he doesn't get it, and all users, including myself, show as "Not Authorized" in Pidgin.
I'm "test2" on my local machine, and on another machine, I'm logged in as "test3". When I send a buddy request from test2 to test3, nothing happens.
In Pidgin, the only log I see is
---- +++ test2#pc-705.example.com/ signed on # 11/20/2015 2:32:19 PM ----
where example.com is my domain.
My Prosody log just says that I've authenticated but does not mention sending buddy requests:
C:\Users\test2\Desktop\XMPP\Prosody>prosody.bat
general info Hello and welcome to Prosody version 0.9.7
general info Prosody is using the select backend for connecti
on handling
localhost:tls error Unable to initialize TLS: No SSL/TLS configurati
on present for localhost
localhost:tls error Unable to initialize TLS: No SSL/TLS configurati
on present for localhost
portmanager info Activated service 's2s' on [::]:5269, [*]:5269
mod_s2s warn No local IPv4 or IPv6 addresses detected, outgoi
ng connections may fail
portmanager info Activated service 'c2s' on [::]:5222, [*]:5222
portmanager info Activated service 'legacy_ssl' on no ports
pc-705.example.com:tls error Unable to initialize TLS: No SSL/TLS configuration present for pc-705.example.com
pc-705.example.com:tls error Unable to initialize TLS: No SSL/TLS configuration present for pc-705.example.com
c2s02310338 info Client connected
c2s02310338 info Authenticated as test2#pc-705.example.com
c2s0 info Client connected
c2s0 info Authenticated as test3#pc-705.example.com
Where is my issue?
It sounds like you might have tried adding the buddy as test3. Which isn't going to work. A buddy on XMPP is user#server.
You need to add them as test3#pc-705.example.com or whatever.
This is part of how/why XMPP server's can federate (interoperate). Like email.

Google Cloud SQL always on

I've a Google Cloud SQL instance with followings settings:
pricingPlan: PER_USE
activationPolicy: ON_DEMAND
I have added an IPv4 address.
I have verified with Google Cloud SQL API that the settings are well saved.
Problem: I do not have any active query but the instance never stop, charging me 24h per day.
I'm sure the connections don't come from me. I've deleted all authorized networks and I've reboot the instance, but I still always have 1 active connection.
Is the someone that have the same problem?
Many thanks,
Loic
As Juan Munoz says, there is always 1 active connection while your instance is running, but that won't make your instance keep running.
If you are being charged continuously even though you have set activationPolicy=ON_DEMAND and have no authorized networks you might want to check if you have an authorized App Engine app and whether it is connecting to your instance.
Also your instance will be constantly active, regardless of activationPolicy, if it is a replication master. Because the slave keeps a connection open the master will never be able to shut down. I doubt this is occurring here as I imagine the slave's connection would have appeared on your active connections graph.

ejabberd mod_muc error joining a chat room (503)

I've updated from ejabberd 15.04 to 15.07 and MUC stopped working. (I copied the exact same config file). I can create a room and change options normally but when I send an invitation and the user tries to join I get the message 503 - Service Unavailable.
This is the muc config that was working fine before and stopped working:
mod_muc:
db_type: odbc
host: "chat.#HOST#"
access: muc
access_create: muc_admin
access_persistent: muc
access_admin: muc_admin
Any idea of what might be happening? I've read some stuff about DNS but to be honest this is all local and nothing has changed related with the network from one version to another
Here's the log. The first part is when I send the direct invitation and then accept to join the room using Adium.
Here is ejabberd config file: https://gist.github.com/nunohorta/b7e97503d3b7eb2921e0
I cleared the current database and MUC is working again.