Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kamalakkannan1984 opened this issue Aug 19, 2020 · 6 comments
Assignees

Comments

@kamalakkannan1984
Copy link

Environment

  • ejabberd version: 20.04
  • Erlang version: erl +V
  • OS: Linux (Debian)
  • Installed from: source | distro package | official deb/rpm | official binary installer | other

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.

@kamalakkannan1984 kamalakkannan1984 changed the title Ejabberd Clustor file sharing not working for one node to second node Ejabberd Clustor file upload not working for one node to second node Aug 19, 2020
@kamalakkannan1984 kamalakkannan1984 changed the title Ejabberd Clustor file upload not working for one node to second node Ejabberd Cluster file / images send not working for one node to second node Aug 19, 2020
@prefiks
Copy link
Member

prefiks commented Aug 20, 2020

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
Copy link
Member

weiss commented Aug 20, 2020

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 weiss self-assigned this Aug 20, 2020
@weiss
Copy link
Member

weiss commented Aug 20, 2020

@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
Copy link

mkl262 commented Aug 20, 2020

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

@weiss
Copy link
Member

weiss commented Aug 20, 2020

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

@catap
Copy link

catap commented Nov 16, 2024

@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.

Here two catches as I see:

  1. You should ditribute files across the cluster by hand.
  2. You can't use global hostname of upload node, instead you should vhost per each vhost in ejabberd.

Am I wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants