Open jonaskohl opened 8 months ago
Hi @jonaskohl, Thank you for the feedback!
The CopyFilesOverSSHV0 task uses SSH service connection with the private key inside. Please make sure that the uploaded private key is valid with the correct host and username.
Based on the log I see that you have privateKey field in your connection, but, the error is located in ssh2 library when the library tries to parse key and, probably confuses the passed key with another and returns wrong instance.
So, could you check that you uploaded/pasted the private key exactly and could you please specify, did you used the file or pasted the key into the field?
The private key is correct for the given host and user. I pasted the key's contents (in PEM format) into the private key textbox inside of the Servie Connection settings
I just tried by writing a small node script that utilizes ssh2 directly and that works without problem.
const { readFileSync } = require('fs');
const { Client } = require('ssh2');
const conn = new Client();
conn.on('ready', () => {
console.log('Client :: ready');
conn.exec('uptime', (err, stream) => {
if (err) throw err;
stream.on('close', (code, signal) => {
console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
conn.end();
}).on('data', (data) => {
console.log('STDOUT: ' + data);
}).stderr.on('data', (data) => {
console.log('STDERR: ' + data);
});
});
}).connect({
host: [REDACTED],
port: 22,
username: [REDACTED],
privateKey: readFileSync('./id_ed25519')
});
BTW, this issue seems to be affecting the SSHv0
(Version 0.200.0) as well
@jonaskohl, thanks for the check! We are working on more prioritized issues at the moment, but will get back to this one soon!
Hi there. I'd appreciate fixing this problem, as it blocks our work.
@jonaskohl The workaround for me is to recreate a new service connection without pasting the ssh key, login with a password only
This sadly is not an option for me/my company for security reasons. The remote SSH user does not allow password login, so authentication has to happen via SSH keys.
Hello, @DmitriiBobreshev I wonder whether to you have any ETA regarding this bug?
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Still no updates after almost half a year?
New issue checklist
Task name
CopyFilesOverSSH
Task version
0.205.0
Issue Description
When using the
CopyFilesOverSSH
task, the task fails withTypeError: Cannot read property 'getPrivatePEM' of undefined.
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
Azure DevOps Server (Please specify exact version in the textbox below)
Azure DevOps Server Version (if applicable)
Azure DevOps Server 2022.0.1 (AzureDevOpsServer_20230418.1)
Operation system
Windows Server 2019
Relevant log output
Full task logs with system.debug enabled
Repro steps
No response