processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.08k stars 1.51k forks source link

Ejabberd Cluster file / images send not working for one node to second node #3359

Open kamalakkannan1984 opened 4 years ago

kamalakkannan1984 commented 4 years ago

Environment

Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml

loglevel: 4
...

Errors from error.log/crash.log

2020-08-19 10:57:54.010 [warning] <0.1997.0>@mod_http_upload:process:563 Rejecting file ca427369-3812-4459-8162-ba4694f831fd.jpg from ::ffff:127.0.0.1 for 7049.xxxx.yyyyy.com: Invalid slot

Ejabberd Clustor file sharing not working for one node to second node

Bug description

The Ejabberd cluster setup via HAProxy load balancer. In the cluster setup I have Node1(Ejabberd server 1) and Node2(Ejabberd server 2). When I upload file some time get rejected regarding invalid slot.

Our setup is HAProxy connect with two nodes(Node1 and Node2)

Note: Single Node(Ejabberd server) working fine.

Please any one share your ideas and feedback.

prefiks commented 4 years ago

Yes indeed there is no sharing token assignments between nodes in this module, so you could be only be able to perform upload on node where slot allocation was performed. To make this work we would need to move slot keeping logic to outside each module state, possibly in memory mnesia db?

weiss commented 4 years ago

To make this work we would need to move slot keeping logic to outside each module state, possibly in memory mnesia db?

My plan is to get rid of the module state altogether by replacing it with the external_secret mechanism.

weiss commented 4 years ago

@kamalakkannan1984 right now my suggestion would be to have an external web server handle the actual file uploads by using one of the implementations mentioned here. If you specify the same external_secret for mod_http_upload and the web servers running on your nodes, uploads will be accepted by all of them.

mkl262 commented 4 years ago

The same thing happens to me on ejabberd 19.09.1. I have a similar setup with 2 nodes and a HAProxy server.

weiss commented 4 years ago

Sure. The suggested solution would work with 19.09.1 as well.