You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Fedora Linux 38 (Workstation Edition) / Kernel: 6.3.12-200.fc38.x86_64
I've been doing some testing of the latest Gate proxy versions lately, and a couple of days ago I had mentioned how v0.31.1 was unable to parse -1 or "-1" properly, referenced here: #221
A simple workaround was to simply pass "-1s", which seemed to do the trick.
The latest commit (59afe39), which attempts to solve the parsing issue however, seems to unfortunately break cachePingTTL parsing altogether:
Error logs
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `-1s` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `-1` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `0s` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `0` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `1s` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `1` into configutil.Duration
error reading config file "/home/server/minecraft/proxy/testing/config.yml": error unmarshaling config file "/home/server/minecraft/proxy/testing/config.yml" to *config.Config: yaml: unmarshal errors:
line 10: cannot unmarshal !!str `60s` into configutil.Duration
Arch:
x86_64
Go version:
go1.20.6 linux/amd64
Tested on:
Debian GNU/Linux 12 (bookworm)
/ Kernel:6.1.0-10-amd64
Fedora Linux 38 (Workstation Edition)
/ Kernel:6.3.12-200.fc38.x86_64
I've been doing some testing of the latest Gate proxy versions lately, and a couple of days ago I had mentioned how
v0.31.1
was unable to parse-1
or"-1"
properly, referenced here: #221A simple workaround was to simply pass
"-1s"
, which seemed to do the trick.The latest commit (59afe39), which attempts to solve the parsing issue however, seems to unfortunately break
cachePingTTL
parsing altogether:Error logs
The configuration used was:
config.yml
I'm not experienced with Go but I did attempt to debug as best I could.
At line 625 in
yaml/decode.go
(https://github.com/go-yaml/yaml/blob/f6f7691b1fdeb513f56608cd2c32c51f8194bf51/decode.go#L625), an attempt to resolve the type in a switch statement results in something like:interface {}(string) "-1s"
which will switch on case
string
@ line 647 (https://github.com/go-yaml/yaml/blob/f6f7691b1fdeb513f56608cd2c32c51f8194bf51/decode.go#L647), but will fail to equate to adurationType
(https://github.com/go-yaml/yaml/blob/f6f7691b1fdeb513f56608cd2c32c51f8194bf51/decode.go#L332), thereby skipping thetime.ParseDuration
statement on the next line.Interestingly, I don't think the wrapper functions introduced in (https://github.com/minekube/gate/blob/master/pkg/util/configutil/duration.go) are ever called. No breakpoints seemed to hit them. I wonder if this has to do with it being recognized as a
string
and not of it's respective type, possibly previously mentioned here #218 and here spf13/viper#338 (comment)How to reproduce:
https://github.com/minekube/gate/releases/tag/v0.31.2
.config.yml
file using Lite-Mode, with thecachePingTTL
value set to a numerical value with or without the "s" appended.Caveats:
cachePingTTL
for Lite-ModeThe text was updated successfully, but these errors were encountered: