Heroku Django Gunicorn错误H18(请求中断)错误
我正在使用Django
与Gunicorn
on Heroku
。我通过发布到后端发送某些文件(不需要存储)的 https 请求,本地一切正常。 但是在Heroku
我发送小文件(< 13kbytes)时,它有效,但是对于较大的文件,我会得到
错误H18(请求中断)。
如果该错误是来自Heroku
本身,我无法理解该错误的原因,如果它来自请求的正文或gunicorn
。
找出任何想法的可能原因的最佳方法是什么?
I'm using Django
with Gunicorn
on heroku
. And I make https
requests via post to my backend sending some files (which don't need to be stored), locally everything works fine.
But on heroku
when I send small files (<13kbytes) it works, but for larger files I get
Error H18 (Request Interrupted).
I couldn't understand the reason for the error, if it's from heroku
itself, if it's from the body of the request to be large or from gunicorn
.
What would be the best way to find out the possible cause of this, any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是 clue :
您可能已经体验了限制如果您是免费用户。但是,最好确定问题而不是猜测。您可以做的是安装 heroku cli 。然后,设置帐户后,在您的后端发送另一个大文件。这将再次返回H18错误。然后,您可以在终端中追踪问题:
Here's a clue:
You might have experienced one of the limitations on heroku if you're a free user. However, it's best to pinpoint the issue instead of speculating. What you can do is install the Heroku CLI. Then, after you setup your account, send another large file on your backend. This will return the H18 error again. You can then trace the issue in your terminal with this:
对于将来有同样问题的人来说,我的问题出现了,我不等待所有文件都被上传,本地工作是由于即时上传的文件,但在服务器中没有立即上传。因此,要解决我的问题,我需要使用等待和纸张等待文件,然后再致电后端。
For people in the future with the same problem, me problem came of i dont wait all file be uploaded, locally works cause instantally files uploaded, but in server not is instantally. So to solve my problem i needed use await and promisses to wait the files and after that e call the backend.