微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

与 dokku 和 hasura 的“上游过早关闭连接”

如何解决与 dokku 和 hasura 的“上游过早关闭连接”

当通过 Nginx 向托管在 Dokku 上的 Hasura 发送 2.7mb 有效负载(较小的有效负载工作正常)时,我收到 502 到客户端,并且在内部出现以下错误

root@api-dev:/# dokku Nginx:error-logs hasura
[error] 44443#44443: *19 upstream prematurely closed connection while reading response header from upstream,client: 103.75.204.31,server: xxx.yyy.net.au,request: "POST /v1/graphql HTTP/1.1",upstream: "http://172.17.0.3:8080/v1/graphql",host: "xxx.yyy.net.au"

172.17.0.3 是 hasura 应用程序:

root@api-dev:/# dokku network:report hasura
=====> hasura network information
       Network attach post create:    
       Network attach post deploy:    
       Network bind all interfaces:   false
       Network web listeners:         172.17.0.3:5000


root@api-dev:/# dokku Nginx:report hasura
=====> hasura Nginx information
       Nginx access log format:                                
       Nginx access log path:         /var/log/Nginx/hasura-access.log
       Nginx bind address ipv4:                                
       Nginx bind address ipv6:       ::                       
       Nginx client max body size:                             
       Nginx disable custom config:   false                    
       Nginx error log path:          /var/log/Nginx/hasura-error.log
       Nginx global hsts:             true                     
       Nginx computed hsts:           true                     
       Nginx hsts:                                             
       Nginx hsts include subdomains: true                     
       Nginx hsts max age:            15724800                 
       Nginx hsts preload:            false                    
       Nginx proxy buffer size:       4096                     
       Nginx proxy buffering:         on                       
       Nginx proxy buffers:           8 4096                   
       Nginx proxy busy buffers size: 8192                     
       Nginx proxy read timeout:      60s                      
       Nginx last visited at:         1619572196               
       Nginx x forwarded for value:   $remote_addr             
       Nginx x forwarded port value:  $server_port             
       Nginx x forwarded proto value: $scheme                  
       Nginx x forwarded ssl:                                  
root@api-dev:/# 

hasura 容器中没有错误,容器日志中的最后一行是正常的 starting API server

{"type":"startup","timestamp":"2021-04-28T00:38:43.470+0000","level":"info","detail":{"kind":"server","info":{"time_taken":0.882082376,"message":"starting API server"}}}

我已经对有效负载进行了计时,时间为 18-29 秒,以显示上述错误。 Dokku 在最低 Vultr VPS(1GB 内存)上运行。

我已按照以下说明将 Nginx 请求的最大大小增加到 50mb:nearest neighbors

我已经尝试通过节点脚本和 Postman 发送,但我得到了同样的错误,所以上游客户端不是问题——它必须是 Postman 和 Nginx间的问题。

Vultr 端会不会有代理掉线?没有负载平衡器、代理、网络配置等——只有 VPS。

有没有人有任何线索?谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。