Giter VIP home page Giter VIP logo

Comments (6)

liuhaogui avatar liuhaogui commented on May 16, 2024

贴点日志

server

2021/11/23 13:27:41 [INFO]listen on 6154
panic: runtime error: index out of range [0] with length 0

goroutine 20 [running]:
github.com/lwch/logging.(*rotateSizeLogger).rotate(0xc00009c000)
	/Users/alex.liu/Golang/pkg/mod/github.com/lwch/[email protected]/rotate_size.go:95 +0xcdd
github.com/lwch/logging.Logger.Error(0x139eb90, 0xc00009c000, 0x134d899, 0x27, 0xc0000134d0, 0x3, 0x3)
	/Users/alex.liu/Golang/pkg/mod/github.com/lwch/[email protected]/log.go:63 +0x35
github.com/lwch/logging.Error(...)
	/Users/alex.liu/Golang/pkg/mod/github.com/lwch/[email protected]/log.go:30
natpass/code/server/handler.(*Handler).Handle(0xc0000ae000, 0x13a1358, 0xc000094020)
	/Users/alex.liu/Golang/src/github.com/lwch/natpass/code/server/handler/handler.go:68 +0x11e
created by main.run
	/Users/alex.liu/Golang/src/github.com/lwch/natpass/code/server/main.go:116 +0xce
exit status 2

from natpass.

liuhaogui avatar liuhaogui commented on May 16, 2024
 + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:68) natpass/code/server/handler.(*Handler).Handle
2021/11/23 13:26:39 [ERROR]read handshake from 172.16.19.245:51606 8 times, err=read tcp 172.26.21.214:6154->172.16.19.245:51606: read: connection reset by peer
  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:68) natpass/code/server/handler.(*Handler).Handle
2021/11/23 13:26:39 [ERROR]read handshake from 172.16.19.245:51606 9 times, err=read tcp 172.26.21.214:6154->172.16.19.245:51606: read: connection reset by peer
  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:68) natpass/code/server/handler.(*Handler).Handle
2021/11/23 13:26:39 [ERROR]read handshake from 172.16.19.245:51606 10 times, err=read tcp 172.26.21.214:6154->172.16.19.245:51606: read: connection reset by peer
  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:68) natpass/code/server/handler.(*Handler).Handle

from natpass.

liuhaogui avatar liuhaogui commented on May 16, 2024

windows

image

from natpass.

lwch avatar lwch commented on May 16, 2024

上面这个错误可能是因为配置了错误的log.rotate数值造成的,该数值必须大于0,下一版本中会加入配置文件的参数规范性检查。

  • golang本身的代码组织目录结构比较松散,且建议单个文件或方法不宜过长,我这边目前做了一些约定
    • h_开头的文件表示API接口,供前端调用
    • send_开头的文件表示数据包拼装,用于网络通信
    • 跨平台编译文件遵从golang的规范,使用build tag或文件名后缀
  • 对于panic的说法,在natpass中原则上只要影响程序正常启动的,直接panic不进行捕获,在运行时产生的错误会有error log记录
  • tls是为了保证通信安全,目前let's encrypt项目推进了这么多年就是为了提高网络通信的安全性的,因此在natpass项目中将不会提供不安全的明文传输

最后,感谢您的建议,natpass距离1.0.0正式版release还有很多功能没有完成,因此开发文档较少,我会在开发过程中尽量补齐的。

from natpass.

lwch avatar lwch commented on May 16, 2024

上面这个问题终于找到原因了,在golang中path在拼绝对路径时会将其转换到一个相对路径,导致最终引用的配置文件没能正确被include进来,该问题将在v0.7.2版本中进行修复

from natpass.

lwch avatar lwch commented on May 16, 2024

v0.8.0版本已支持非tls加密连接

from natpass.

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.