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

How to setup mod_http_upload ? #1736

Closed
Immakittycat opened this issue May 19, 2017 · 24 comments
Closed

How to setup mod_http_upload ? #1736

Immakittycat opened this issue May 19, 2017 · 24 comments

Comments

@Immakittycat
Copy link

Immakittycat commented May 19, 2017

What version of ejabberd are you using?

17.03

What operating system (version) are you using?

Windows 7

How did you install ejabberd (source, package, distribution)?

Windows installer.

What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?

I would like to be able to transfer files through my Ejabberd server, with the receiver being offline.
Thus, I need to store the files on my server and, on connection of the receiver, send him the file.
To do so, I tried to install the "mod_http_upload" module, but I can't manage to get it to work.

Might someone help me configuring this ? You'll find my ejabberd.yml file attached to this post, whose with I get a 404 error every time I try to put something on the put_url defined there.

ejabberd.txt

EDIT 31/05/2017 :
I downloaded the last version of ejabberd (17.04) and it now works like a charm !
I still don't know what was blocking with the old version, but anyway, the problem's now solved.

Thanks again for your help.

@weiss
Copy link
Member

weiss commented May 19, 2017

Remove the host option from the mod_http_upload configuration.

@Immakittycat
Copy link
Author

Tried it, unsuccesfully.
I still can't put the file. I also tried to use Gajim with its http_upload plugin to test the file transfer, and I always got the same "Service unavailable" error.

Any other idea ?
Thanks for your help !

@weiss
Copy link
Member

weiss commented May 19, 2017

Any [error] messages in your ejabberd.log file?

If there aren't, could you grab the output from Gajim's XML Console while you issue the upload request?

@Immakittycat
Copy link
Author

I have no [error] messages in my ejabberd.log, only a [info] one :

2017-05-19 13:26:42.955 [info] <0.460.0>@mod_http_upload:create_slot:577 Got HTTP upload slot for bob@tech-ut16093cw/Gajim (file: Recherches.docx)

On Gajim's XML console, here's what I get :

<!-- Out 19/05/2017 13:26:37 -->
<iq xmlns="jabber:client" to="upload.tech-ut16093cw" type="get" id="b47bbdf8-abf1-47df-b8ba-657202bcee58">
<request xmlns="urn:xmpp:http:upload">
<filename>Recherches.docx</filename>
<size>236949</size>
<content-type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</content-type>
</request>
</iq>

<!-- In 19/05/2017 13:26:37 -->
<iq xml:lang='fr' to='bob@tech-ut16093cw/Gajim' from='upload.tech-ut16093cw' type='result' id='b47bbdf8-abf1-47df-b8ba-657202bcee58'>
<slot xmlns='urn:xmpp:http:upload'>
<get>http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/srpIyQlOXgqCsxvZzxYQfkJMThPATrYf9yeNZuvd/Recherches.docx</get>
<put>http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/srpIyQlOXgqCsxvZzxYQfkJMThPATrYf9yeNZuvd/Recherches.docx</put>
</slot>
</iq>

Thanks for your help !

@weiss
Copy link
Member

weiss commented May 19, 2017

So the problem is the HTTP (not the XMPP) communication. I think the Gajim plugin prints debug output to stdout or stderr (so you'd see it if you start Gajim from a terminal).

Can you access http://172.16.13.159:5443/upload/ from a browser?

@Immakittycat
Copy link
Author

Tried launching gajim.exe from the terminal, but it doesn't print me any error in there when I try to send the file.
No, I cannot access the http://172.16.13.159:5443/upload/ page from my browsers.

@weiss
Copy link
Member

weiss commented May 19, 2017

No, I cannot access the http://172.16.13.159:5443/upload/ page from my browsers.

What error message do you get?

@Immakittycat
Copy link
Author

"Not found" .

@weiss
Copy link
Member

weiss commented May 19, 2017

Could you retry running Gajim from a terminal using the following command line?

gajim -l gajim.plugin_system.httpupload=DEBUG

@Immakittycat
Copy link
Author

Tried it, but there's still nothing in my terminal.
The command launches Gajim but, when I'm trying to send a file, nothing gets written in the terminal.

@weiss
Copy link
Member

weiss commented May 19, 2017

Could you check the following folder for a gajim.log file (replace <user> with your user name)?

C:\Users\<user>\AppData\Roaming\Gajim

@Immakittycat
Copy link
Author

Here it is :

crée le répertoire C:\Users\fblanc\AppData\Roaming\Gajim\Vcards
crée le répertoire C:\Users\fblanc\AppData\Roaming\Gajim\Avatars
crée le répertoire C:\Users\fblanc\AppData\Roaming\Gajim\Pluginsconfig
création de la base de donnée de l'historique
création de la base de donnée de cache
crée le répertoire C:\Users\fblanc\AppData\Roaming\Gajim\Certs
crée le répertoire C:\Users\fblanc\AppData\Roaming\Gajim\Localcerts
12/04/2017 14:01:25 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
12/04/2017 14:01:29 (E) gajim.c.resolver: Invalid host: _stun._udp.tech-ut16093cw
13/04/2017 08:40:25 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
13/04/2017 08:44:45 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
13/04/2017 08:49:05 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
13/04/2017 08:53:26 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
14/04/2017 09:34:07 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
18/04/2017 09:35:24 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
20/04/2017 10:12:27 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
20/04/2017 10:12:49 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.172.16.13.95
20/04/2017 10:12:52 (E) gajim.c.resolver: Invalid host: _stun._udp.172.16.13.95
04/05/2017 11:05:09 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.172.16.13.95
04/05/2017 11:05:36 (E) gajim.c.resolver: Invalid host: _stun._udp.172.16.13.95
04/05/2017 11:09:51 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.172.16.13.95
04/05/2017 11:09:54 (E) gajim.c.resolver: Invalid host: _stun._udp.172.16.13.95
19/05/2017 11:04:03 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.172.16.13.95
19/05/2017 11:04:36 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
19/05/2017 11:04:44 (E) gajim.c.resolver: Invalid host: _stun._udp.tech-ut16093cw
19/05/2017 11:13:40 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:13:54 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:16:34 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:16:48 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:17:17 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:19:03 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 11:25:08 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
19/05/2017 13:26:17 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 13:26:58 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 13:52:49 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.172.16.13.95
19/05/2017 13:53:55 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
19/05/2017 13:53:58 (E) gajim.c.resolver: Invalid host: _stun._udp.tech-ut16093cw
19/05/2017 13:54:27 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
Logger gajim.plugin_system.httpupload level set to 10
19/05/2017 15:39:44 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
19/05/2017 15:39:48 (W) nbxmpp.dispatcher_nb: Unknown stanza: error
19/05/2017 15:39:48 (E) gajim.c.resolver: Invalid host: _stun._udp.tech-ut16093cw
19/05/2017 15:39:50 (I) gajim.plugin_system.httpupload: bob@tech-ut16093cw can do http uploads via component upload.tech-ut16093cw
Logger gajim.plugin_system.httpupload level set to 10
19/05/2017 15:40:03 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: False
19/05/2017 15:40:03 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: False
19/05/2017 15:40:03 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: False
19/05/2017 15:40:03 (E) gajim.c.resolver: Invalid host: _xmpp-client._tcp.tech-ut16093cw
19/05/2017 15:40:07 (E) gajim.c.resolver: Invalid host: _stun._udp.tech-ut16093cw
19/05/2017 15:40:10 (I) gajim.plugin_system.httpupload: bob@tech-ut16093cw can do http uploads via component upload.tech-ut16093cw
19/05/2017 15:40:10 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:12 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:12 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:12 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:16 (I) gajim.plugin_system.httpupload: Encryption is: False / OMEMO not found
19/05/2017 15:40:16 (I) gajim.plugin_system.httpupload: Detected MIME Type of file: image/png
19/05/2017 15:40:16 (I) gajim.plugin_system.httpupload: jid_to_servers of bob@tech-ut16093cw: upload.tech-ut16093cw ; connection: <nbxmpp.client_nb.NonBlockingClient object at 0x050707D0>
19/05/2017 15:40:16 (D) gajim.plugin_system.httpupload: sending httpupload slot request iq...
19/05/2017 15:40:16 (I) gajim.plugin_system.httpupload: Uploading file to 'http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/yEAW2Ez7TmG1dCLPWkKmNXza7pZGCrJLcWetVKIQ/black_in_yellow.png'...
19/05/2017 15:40:16 (I) gajim.plugin_system.httpupload: Please download from 'http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/yEAW2Ez7TmG1dCLPWkKmNXza7pZGCrJLcWetVKIQ/black_in_yellow.png' later...
19/05/2017 15:40:16 (D) gajim.plugin_system.httpupload: opening urllib2 upload request...
19/05/2017 15:40:16 (D) gajim.plugin_system.httpupload: upload progress: 100.00% (7627 of 7627 bytes)
19/05/2017 15:40:16 (D) gajim.plugin_system.httpupload: upload progress: 100.00% (7627 of 7627 bytes)
19/05/2017 15:40:37 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
19/05/2017 15:40:50 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:50 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:40:50 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:41:02 (I) gajim.plugin_system.httpupload: Encryption is: False / OMEMO not found
19/05/2017 15:41:02 (I) gajim.plugin_system.httpupload: Detected MIME Type of file: image/jpeg
19/05/2017 15:41:02 (I) gajim.plugin_system.httpupload: jid_to_servers of bob@tech-ut16093cw: upload.tech-ut16093cw ; connection: <nbxmpp.client_nb.NonBlockingClient object at 0x050707D0>
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: sending httpupload slot request iq...
19/05/2017 15:41:02 (I) gajim.plugin_system.httpupload: Uploading file to 'http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/jqef91aObIl3vwDW2Q43Dap8Y2oVnyGx9ebnBhsa/calimero.jpg'...
19/05/2017 15:41:02 (I) gajim.plugin_system.httpupload: Please download from 'http://172.16.13.159:5443/upload/a5becd84ae2e1abf27892bea8bd80fa8b6bf3269/jqef91aObIl3vwDW2Q43Dap8Y2oVnyGx9ebnBhsa/calimero.jpg' later...
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: opening urllib2 upload request...
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 14.06% (8192 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 28.13% (16384 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 42.19% (24576 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 56.25% (32768 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 70.31% (40960 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 84.38% (49152 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 98.44% (57344 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 100.00% (58253 of 58253 bytes)
19/05/2017 15:41:02 (D) gajim.plugin_system.httpupload: upload progress: 100.00% (58253 of 58253 bytes)
19/05/2017 15:41:23 (E) gajim.plugin_system.httpupload: URLError
Traceback (most recent call last):
  File "C:\Users\fblanc\AppData\Roaming\Gajim\Plugins\httpupload\httpupload.py", line 494, in uploader
    transfer = urllib2.urlopen(request, timeout=30)
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
  File "C:\Python27\lib\urllib2.py", line 435, in open
  File "C:\Python27\lib\urllib2.py", line 548, in http_response
  File "C:\Python27\lib\urllib2.py", line 473, in error
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
  File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
HTTPError: HTTP Error 503: Service Unavailable
Logger gajim.plugin_system.httpupload level set to 10
19/05/2017 15:43:57 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:43:57 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:44:05 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True
19/05/2017 15:44:05 (I) gajim.plugin_system.httpupload: Account tech-ut16093cw: httpupload is_supported: True

@weiss
Copy link
Member

weiss commented May 19, 2017

HTTPError: HTTP Error 503: Service Unavailable

There's no code in ejabberd that would return this error. Maybe there's a (transparent) proxy in the middle; e.g., some piece of anti-virus software or whatever?

You could check whether you can reproduce it from a different system/client (e.g., with Conversations or Xabber on Android or with Monal on iOS).

@Immakittycat
Copy link
Author

I tried both Xabber and Monal but I can't manage to connect to the server using those apps, even though the phone was connected to the same local network.

@weiss
Copy link
Member

weiss commented May 22, 2017

Debugging such networking issues remotely is a bit of a PITA ...

@Immakittycat
Copy link
Author

Yeah, I guess it is :/ .
Anyway, thanks for the help you provided. I'll pursue my efforts trying to make this work.
Hopefully I'll figured out what's blocking.

@weiss
Copy link
Member

weiss commented May 24, 2017

Hopefully I'll figured out what's blocking.

Good luck!

I'll close this issue for the moment. Feel free to add comments with additional info, especially if you suspect a mod_http_upload bug.

@weiss weiss closed this as completed May 24, 2017
@ghost
Copy link

ghost commented Jun 23, 2017

Ejabberd 17.04

I want to share my experience configuring the 'mod_http_upload' because it was painful according to me.
Finally I succeeded, bless this stackoverflow page.

Previously I turned the log level to 5 'debug' but did not help, no clue, it keeps failing silently.

@mod_http_upload:create_slot:585 Got HTTP upload slot for pvincent@libre.re/7468694814666474808666 (file: logo.png)

may appear in the logfile, however there is no file created in the upload directory and nothing more.
I suspected file permission, CORs issues, the quota parameter missing, etc.... but it was related to http instead of https ! Please, for further investigation, would you mind log more relevant debug messages specially related to this http_upload module. It might help a lot configuring and tuning accordingly to our needs.

@weiss
Copy link
Member

weiss commented Jun 23, 2017

would you mind log more relevant debug messages specially related to this http_upload module.

If the put_url doesn't point to a correctly configured listener, mod_http_upload won't see any HTTP(S) requests, so it's not trivial to produce helpful log output for this kind of configuration error. For other cases, the module tries its best to log useful messages.

Finally I succeeded, bless this stackoverflow page.

Is anything helpful mentioned there that's missing in the official docs?

@ghost
Copy link

ghost commented Jun 23, 2017

thank you for this quick reply weiss

According to me, it's a bit tricky due to :

  • http/https leads to silent failure
  • put_url => open a browser, it responds 'not found'
  • is quota mandatory or optional ?
  • a movim issue : Access-Control pragma

meantime, I've decided to let NGINX as the main frontend (reverse proxy), thus I can't reuse the same certfile => ejabberd claims for a full pem certificate rather than a 'standard' nginx certificate.

I will try to reproduce the same errors I did and investigate further...

@weiss
Copy link
Member

weiss commented Jun 23, 2017

I've decided to let NGINX as the main frontend (reverse proxy), thus I can't reuse the same certfile => ejabberd claims for a full pem certificate rather than a 'standard' nginx certificate.

According to the Nginx docs, you should be able to use the PEM file for ejabberd in Nginx as well:

If intermediate certificates should be specified in addition to a primary certificate, they should be specified in the same file in the following order: the primary certificate comes first, then the intermediate certificates. A secret key in the PEM format may be placed in the same file.

@ghost
Copy link

ghost commented Jun 23, 2017

ok, very helpful.
that may simplify my settings.
thx weiss

@ghost
Copy link

ghost commented Jun 26, 2017

ok I've investigated a bit further.
My mistake was related to virtual hosts (I've got 2)

put_url: "https://bosh.@HOST@/upload"
works

put_url: "https://bosh.domain.tld/upload"
ejabberctl restart => failure

I guess the http upload module starts twice with the same put_url and crashed somehow

@lock
Copy link

lock bot commented Jun 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants