On Tue, Feb 19, 2019, at 7:32 AM, Derek Lambert wrote:
I’m having an issue downloading attachments from HyperKitty. The download begins as expected, but never progresses. Eventually it times out. I imagine the browser is expecting data matching the content-length header, but never receives it.
Inspecting the contents of the download file reveals (address varies):
<memory at 0x7f148fcb9588>
I’ve been able to work around the issue with the following patch:
--- env/lib/python3.7/site-packages/hyperkitty/models/email.py.orig 2018-12-06 21:38:39.544448735 +0000 +++ env/lib/python3.7/site-packages/hyperkitty/models/email.py 2018-12-06 23:01:39.923239421 +0000 @@ -309,7 +309,7 @@ def get_content(self): folder = self._get_folder() if folder is None: - return self.content + return self.content.tobytes() filepath = os.path.join(folder, str(self.counter)) if not os.path.exists(filepath): logger.error("Could not find local attachment %s for email %s",
I haven't been able to replicate the issue with the HyperKitty tests, presumably the issue is somewhere in the Django <-> uwsgi <-> nginx stack.
My configs are based on mailman-suite and maxking/docker-mailman. I've tried stripping out all the performance tweaks from my uwsgi and nginx configs, but no change.
Versions: HyperKitty 1.2.1 Postorius 1.2.3 Django 2.1.7 nginx 1.14.1 uwsgi 2.0.18 Python 3.7.2
Has anyone come across this before?
I am not sure if this is exactly a bug in Hyperkitty. I am not able to replicate this with a extremely complicated test: Downloading a signature file in an email on lists.mailman3.org. It runs on gunicorn + Django 2.1.5 ( I think) and latest Git heads of respective projects. Is this a recurring or one time thing that you observed? It would be great if we could you could capture the HTTP Headers with and without the patch you sent above to help debug why does `.tobytes()` lets you download. -- thanks, Abhilash Raj (maxking)