liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.5k stars 256 forks source link

Can't sync at all because of an ssh key location error #989

Closed Zenwoh closed 2 years ago

Zenwoh commented 2 years ago

Bug description I can't sync remote and local at all, when I try to I get ENOENT: no such file or directory, open 'c:\C\Users\*private_name*\Documents\*private*.key' as an error, which is basically telling me that it's trying to get this key from c:\C\Users\..., putting a C before the Users file for no reason. I have no idea what caused this, as I didn't change any of the config files at all or the key's location.

Thing to note is that I do NOT want to sync my ssh key with the remote folder, and as far as I know I don't even need an ssh key to access this server. I'm very confused as to why this extension (and the 2 forks on the marketplace) gets this error.

I'm sorry for all the censoring, I'm an intern at a company, don't want to risk anything. The IPs should only be accessible internally and shouldn't be exposed to the web but I just don't know enough about that to feel comfortable sharing info. As a side note, I mainly want to sync from local to remote, almost never the opposite, but I don't know if that changes things at all in my situation

Config file

{    
    "name": "Test Server",
    "host": "***.***.***.***",
    "protocol": "sftp",
    "secure": true,
    "port": 22,
    "username": "*********",
    "password": "********",
    "remotePath": "/home/*private_user*/*private_project*",
    "uploadOnSave": true
}

To Reproduce Steps to reproduce the behavior:

  1. Try to sync any file, no matter which way (to or from)

Desktop:

Extension Logs from Startup

[04-06 11:43:13] [debug] register command "Cancel All Transfer" from "./commandCancelAllTransfer.ts"
[04-06 11:43:13] [debug] register command "Config" from "./commandConfig.ts"
[04-06 11:43:13] [debug] register command "List Active Folder" from "./commandListActiveFolder.ts"
[04-06 11:43:13] [debug] register command "Open Ssh Connection" from "./commandOpenSshConnection.ts"
[04-06 11:43:13] [debug] register command "Set Profile" from "./commandSetProfile.ts"
[04-06 11:43:13] [debug] register command "Toggle Output Panel" from "./commandToggleOutputPanel.ts"
[04-06 11:43:13] [debug] register command "Upload Changed Files" from "./commandUploadChangedFiles.ts"
[04-06 11:43:13] [debug] register command "Delete Remote" from "./fileCommandDeleteRemote.ts"
[04-06 11:43:13] [debug] register command "Diff" from "./fileCommandDiff.ts"
[04-06 11:43:13] [debug] register command "Diff Active File" from "./fileCommandDiffActiveFile.ts"
[04-06 11:43:13] [debug] register command "Download" from "./fileCommandDownload.ts"
[04-06 11:43:13] [debug] register command "Download Active File" from "./fileCommandDownloadActiveFile.ts"
[04-06 11:43:13] [debug] register command "Download Active Folder" from "./fileCommandDownloadActiveFolder.ts"
[04-06 11:43:13] [debug] register command "Download File" from "./fileCommandDownloadFile.ts"
[04-06 11:43:13] [debug] register command "Download Folder" from "./fileCommandDownloadFolder.ts"
[04-06 11:43:13] [debug] register command "Download Force" from "./fileCommandDownloadForce.ts"
[04-06 11:43:13] [debug] register command "Download Project" from "./fileCommandDownloadProject.ts"
[04-06 11:43:13] [debug] register command "Edit In Local" from "./fileCommandEditInLocal.ts"
[04-06 11:43:13] [debug] register command "List" from "./fileCommandList.ts"
[04-06 11:43:13] [debug] register command "List All" from "./fileCommandListAll.ts"
[04-06 11:43:13] [debug] register command "Reveal In Explorer" from "./fileCommandRevealInExplorer.ts"
[04-06 11:43:13] [debug] register command "Reveal In Remote Explorer" from "./fileCommandRevealInRemoteExplorer.ts"
[04-06 11:43:13] [debug] register command "Sync Both Directions" from "./fileCommandSyncBothDirections.ts"
[04-06 11:43:13] [debug] register command "Sync Local To Remote" from "./fileCommandSyncLocalToRemote.ts"
[04-06 11:43:13] [debug] register command "Sync Remote To Local" from "./fileCommandSyncRemoteToLocal.ts"
[04-06 11:43:13] [debug] register command "Upload" from "./fileCommandUpload.ts"
[04-06 11:43:13] [debug] register command "Upload Active File" from "./fileCommandUploadActiveFile.ts"
[04-06 11:43:13] [debug] register command "Upload Active Folder" from "./fileCommandUploadActiveFolder.ts"
[04-06 11:43:13] [debug] register command "Upload File" from "./fileCommandUploadFile.ts"
[04-06 11:43:13] [debug] register command "Upload Folder" from "./fileCommandUploadFolder.ts"
[04-06 11:43:13] [debug] register command "Upload Force" from "./fileCommandUploadForce.ts"
[04-06 11:43:13] [debug] register command "Upload Project" from "./fileCommandUploadProject.ts"
[04-06 11:43:13] [info] config at c:\*private*\Projet\*platform* {"remotePath":"/home/*private_user*/*private_project*","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":false,"secure":true,"remoteTimeOffsetInHours":0,"name":"Test Server","host":"***.***.***.***","port":22,"username":"******","password":"******"}
[04-06 11:50:41] [trace] run command 'Sync Local To Remote'
[04-06 11:50:41] [trace] handle sync local ➞ remote for c:\*private folder*\Projet\*private project*
[04-06 11:50:41] [error] Error: ENOENT: no such file or directory, open 'c:\C\Users\*private_name*\Documents\*private_name*.key'
Zenwoh commented 2 years ago

Okay, I found the issue. I changed my .ssh\config file, where I added this: IdentityFile /Users/*private_name*/Documents/*private_name*.key in order for git to know where my ssh key was. Taking this line away fixed this "bug" for me. I fixed what I wanted to fix with my git problems using a different method than the IdentityFile /Users/*private_name*/Documents/*private_name*.key route, so I'll close this issue.