Comments (2)
现象 我们基于[email protected]版本搭建的了内部goproxy服务,代码如下:
package main import ( "github.com/goproxy/goproxy" "net/http" "os" ) func main() { http.ListenAndServe(":9080", &goproxy.Goproxy{ GoBinEnv: append( os.Environ(), "GOPROXY=https://goproxy.cn", // 使用 Goproxy.cn 作为上游代理 "GOPRIVATE=*.xxx.com", // 解决私有模块的拉取问题(配置成公司内部的代码源) ), ProxiedSUMDBs: []string{ "sum.golang.org https://goproxy.cn/sumdb/sum.golang.org", // 代理默认的校验和数据库 }, }) }
基于go-1.16.1编译后,部署了若干台机器。运行一段时间后,接到反馈拉取某些golang模块会出现500错误,例如: curl "http://127.0.0.1:9080/github.com/bombsimon/logrusr/@v/v1.0.0.mod" 会返回错误: "internal server error" 状态码是500 但访问其他资源是ok的,就是某些资源始终都是这个500错误(其他机器上正常)。 然后,重启goproxy服务后,再curl则正常了。
** 问题频率 ** 随机在不同的机器上都出现这个问题,访问某些资源(资源有随机性,基本是github.com的)时500错误。 重启后在1个星期到2天之间就会重新出现此问题。 我采取的应对措施是:针对出现了500错误的资源url进行监控,发现500则重启goproxy 但后来发现这个方法也不能保证服务稳定性,因为总是有各种各样的github.com的资源会出现500, 试图查后端日志,发现也没有什么有价值的日志,几乎就是一句 internal server error
期望 有更多的日志指引如何避免此问题 或者提升goproxy的健壮性。
我也遇见过,私有代理会报错
from goproxy.
只显示一句 internal server error
是有意在向请求方隐藏后端的错误详情,但这句话应该只是出现在响应主体中才对。此外的详细错误信息会交给 goproxy.Goproxy.ErrorLogger
去记录,不过记录的内容的确缺少索引,难以找到对应的问题请求,这部分需要改善一下。感谢反馈!
from goproxy.
Related Issues (20)
- Unable to complete go get command when GOPROXY=direct HOT 11
- /tmp required but not configurable HOT 3
- 可以使用 goproxy 解决私有 GitLab 仓库问题吗? HOT 9
- goproxy 无法代理私有 GitLab多级子目录问题 HOT 4
- 自建goproxy,私有包拉取不了 HOT 8
- failed to list module versions HOT 5
- 代理有时会产生http2: server sent GOAWAY and closed the connection错误 HOT 3
- 无法拉取gitlab中的私有包 HOT 18
- goproxy responds with HTTP/1.0 on response to CONNECT, some clients do not support this HOT 1
- Disable-Module-Fetch: true header support HOT 1
- server panic HOT 2
- is there a changelog? HOT 1
- goproxy redirect http proxy to transparent proxy cause some http quest 400 error HOT 1
- support /@latest endpoint HOT 4
- [BUG] go get stuck and server output git error HOT 6
- 拉取私有仓库问题 HOT 2
- 502了 HOT 1
- connections staying open HOT 1
- Dockerfile use nobody user, but git lfs install with root
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goproxy.