0

After configuring the module and restarting the server, I can see the HTTP upload is enabled at the server end by using an XMPP client. But when I try to upload, it doesn't upload the file and it throws a timeout exception. I'm using Xabber mobile app on android as a client. Here is the config I'm using.

{mod_http_upload, [   {host, upload.@HOST@},   {backend, s3},   {expiration_time, 600}, % play.minio.io's clock is skewed by few minutes   {s3, [
        {bucket_url, "http://server.com:9000/bucket/"},
        {add_acl, false},
        {region, "us-east-1"},
        {access_key_id, "JWlsdfKd"},
        {secret_access_key, "3dz8jasdrtyv678ytfZh20qb5cG2qd"}   ]} ]}

Please help where I'm missing.

Jay
  • 13
  • 1
  • 6

2 Answers2

1

It looks like the configuration is not fully correct. I assume that you use MongooseIM 3.6 or newer and min.io as the file storage. Could you try the following configuration:

  {mod_http_upload, [
        {host, "upload.@HOST@"},
        {backend, s3},
        {expiration_time, 600}, % play.minio.io's clock is skewed by few minutes
        {s3, [
              {bucket_url, "http://server.com:9000/bucket/"},
              {add_acl, false},
              {region, "us-east-1"},
              {access_key_id, "JWlsdfKd"},
              {secret_access_key, "3dz8jasdrtyv678ytfZh20qb5cG2qd"}
             ]}
  ]}

Also, if you use MongooseIM from master (or docker's latest tag) we recently updated our documentation with some tips how to quickly check if HTTP file upload works correctly, you can find it at https://mongooseim.readthedocs.io/en/latest/modules/mod_http_upload/

michalwski
  • 359
  • 1
  • 3
  • I'm using MongooseIM 3.6.2. I tried the steps as mentioned in the latest document but still no luck. It throws me an error Error: command "http_upload" not known. – Jay Apr 16 '20 at 08:49
  • 3.6.2 doesn't have the command line tools yet. If you install from source you can try master branch, if you are using docker, try tag latest. And have you tried the configuration suggested by me? – michalwski Apr 16 '20 at 10:17
  • Yeah, I tried the configuration suggested by you. I'm using the version on ubuntu 18.04 as a standalone server downloaded from https://packages.erlang-solutions.com/erlang/debian/pool/mongooseim_3.6.2-1~ubuntu~xenial_amd64.deb – Jay Apr 16 '20 at 18:24
  • Can somebody help with this? I'm still waiting for the answers. – Jay May 13 '20 at 19:07
  • I just edited my answer with the fix to "upload.@HOST@" syntax. Alos, MongooseIM 3.7.0 was released recently. It contains some tools helping to debug HTTP file configuration. Could you try it and the information provided on https://mongooseim.readthedocs.io/en/3.7.0/modules/mod_http_upload/ – michalwski Jun 01 '20 at 08:37
1

Please try to replace {host, upload.@HOST@} with {host, "upload.@HOST@"} - I'm surprised this mistake hasn't been rejected on config load TBH, as I'm pretty sure it should have caused a syntax error.

Piotr Nosek
  • 106
  • 2