weaver: ssh deployer errors with "unknown keys [location_file]"
I’ve tried both setting up my own test weaver application and using the collatz example and both times when running
❯ weaver ssh deploy weaver.toml
I get the following error message
unable to parse ssh config: section "ssh" has unknown keys [locations_file]
I’ve tried looking at the code but nothing seems to stand out to me at a quick glance as to why this is erroring. I don’t fully understand how all the code works just yet but thought I’d raise the issue and continue debugging
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (1 by maintainers)
Hi @aranw. Thanks for pointing out the issue. @dnephin this is one of the problem, great find 😃. There is another small issue we introduced while renaming the project. I am creating a fix.
Nice bug report! I’m just learning the code as well, but I may have an idea about this problem.
https://github.com/ServiceWeaver/weaver/blob/35727ae307c392d27cadfbf5302d56a3e76977ab/internal/tool/ssh/deploy.go#L181-L186
I believe the
serverweaver_metricstruct tag on line 182 is wrong. It doesn’t appear anywhere else in the code, andParseConfigSection(which receives that struct) seems to use https://pkg.go.dev/github.com/burntsushi/toml#Decode to decode the config. That function expects atomlstruct tag.That leaves the
locations_filefield from the config as “undecoded”, which causes the error here:https://github.com/ServiceWeaver/weaver/blob/35727ae307c392d27cadfbf5302d56a3e76977ab/runtime/config.go#L87-L88
I suspect this diff should fix it, but I’m not familiar enough with the testing of this package to add test coverage for the change: