Giter VIP home page Giter VIP logo

Comments (2)

vicnoah avatar vicnoah commented on June 15, 2024

现象 我们基于[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.

aofei avatar aofei commented on June 15, 2024

只显示一句 internal server error 是有意在向请求方隐藏后端的错误详情,但这句话应该只是出现在响应主体中才对。此外的详细错误信息会交给 goproxy.Goproxy.ErrorLogger 去记录,不过记录的内容的确缺少索引,难以找到对应的问题请求,这部分需要改善一下。感谢反馈!

from goproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.