Closed a1um1 closed 1 year ago
I think the issue is now fixed, but I would like to test it first.
how did you get the pid ? is that the PID of a process inside the qemu ? is the agent able to list the running processes ?
I think it's occured by parsing problem it's have this same problem with qemu rrddata and /agent/file-read method or anything that use GET query params
is that work on windows VM qemu? so it only works on the process starting via the agent?
have you a sample command I can exec in a windows QEMU agent to get its exec-status?
await agent.ping.$post()
const {pid} = await proxmox.nodes.$(query.node).qemu.$(query.vmID).agent.exec.$post({
command: `powershell.exe ping 127.0.0.1`,
})
const result = await proxmox.nodes.$(query.node).qemu.$(query.vmID).agent['exec-status'].$get({
pid:pid
})
The test is in progress, but I need to switch to another project; I'll be back in 30 minutes.
Your "powershell.exe ping 127.0.0.1" look more promising than my "echo hello" :)
I need to fix an offline remote server, which will take more time than expected. I will finish that within 12hours.
I do not have powershell.exe on my remote Windows :(
cmd.exe should do a job what windows version are you on
can you try v 0.4.1
extract from sample.ts:
try {
const mtd1 = theNode.qemu.$(qemu.vmid).agent.exec.$post;
// const process = await exec.$post({ command: "powershell.exe ping 127.0.0.1" })
const process = await mtd1({ command: "C:/Windows/System32/ping.exe 127.0.0.1" })
console.log('pid:', process.pid)
const getter = theNode.qemu.$(qemu.vmid).agent["exec-status"].$get;
let exited = false;
let waitcnd = 0;
while (!exited) {
const status = await getter({ pid: process.pid })
console.log(++waitcnd + ' status:', status)
exited = !!status.exited;
await delay(500);
}
// { exited: 0 }
// { exitcode: 0, exited: 1, out-data: 'stdout'}
} catch (e) {
console.log(e);
}
v 0.4.1 is fixed this issues with every GET method so you can close this issue now Thank for supporting
I got this error with exec-status
Replication problems
create agent exec and retrive pid and call agent exec-status should replicate an error but try to access that URL with browser will result like it's seem to be