-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssh deployer errors with "unknown keys [location_file]" #100
Comments
Nice bug report! I'm just learning the code as well, but I may have an idea about this problem. weaver/internal/tool/ssh/deploy.go Lines 181 to 186 in 35727ae
I believe the That leaves the Lines 87 to 88 in 35727ae
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: diff --git a/internal/tool/ssh/deploy.go b/internal/tool/ssh/deploy.go
index 6a6e276..9be6534 100644
--- a/internal/tool/ssh/deploy.go
+++ b/internal/tool/ssh/deploy.go
@@ -179,7 +179,7 @@ func getLocations(app *protos.AppConfig) ([]string, error) {
const shortSSHKey = "ssh"
type sshConfigSchema struct {
- LocationsFile string `serverweaver_metric:"locations_file"`
+ LocationsFile string `toml:"locations_file"`
}
parsed := &sshConfigSchema{}
if err := runtime.ParseConfigSection(sshKey, shortSSHKey, app, parsed); err != nil { |
Ah thanks for finding this so quickly. I didn't get too deep into identifying the issue before having to go out. I'll try this diff either later tonight or tomorrow at some point |
Sorry for the inconvenience. Please try the diff and let us know if you have any issues running the SSH deployer. |
Yeah that looks like it has progressed a little further now onto a new error relating to creating deployment directory Thanks for the quick turn around with a fix! |
Hmm, can you share the error? I tried on my local machine and it works fine. Are you testing on your local machine or on multiple machines? |
It is a remote server
|
Got it. We create a deployment directory on each remote machine where Service Weaver will be deployed. Right now we try to create the directory using ssh and the location is os.TempDir()/deploymentId. https://github.com/ServiceWeaver/weaver/blob/main/internal/tool/ssh/deploy.go#L147 Can you try if simply creating the remote directory over SSH works? e.g., ssh #### "mkdir -p /tmp/bla". I am wondering whether you have some permission issues. Are you running linux machines? |
@rgrandl yeah running that command it worked fine |
I added some output to the command to see what the tool was doing and this seems to be the error
Not sure where it is getting |
This is the command it is running I'm guessing this is a folder on my local machine
|
Hmm, this is interesting. On linux, the temp dir is /tmp. What is your setup and which OS are you running? It feels like macOS? It seems like your ssh client doesn't have privileges to create a directory in /var/folders, maybe? Alternatively you can try to change the os.tempDir() to a custom directory where you can do writes over SSH and check if it works for now. I have a macOS laptop and I will give it a try as well. To be fair, we tested the SSH deployer only on linux machines. |
Ahh so I understand what is happening now weaver/internal/tool/ssh/deploy.go Line 143 in 35727ae
On this line you call Edit: I can create a separate issue for this if you want? |
That's a good point. Yeah, we didn't try to deploy it using SSH from our laptop on a cluster. Thanks for the finding. Sure, send us a fix. Thanks for fixing this :). |
@rgrandl I'll write up a new issue and little summary of the problem later today. I did some digging into the issue last night but was late for me (GMT timezone) so ended up not working on a fix. I have an idea for a possible fix but will discuss in more detail a possible solution in the issue later |
@aranw thanks a lot for your help. Sounds good. |
I've tried both setting up my own test weaver application and using the collatz example and both times when running
I get the following error message
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
The text was updated successfully, but these errors were encountered: