[GH-ISSUE #44] Tool throws CSharp Exception #41

Closed
opened 2026-02-26 17:44:06 +03:00 by kerem · 7 comments
Owner

Originally created by @JohannesK142 on GitHub (Dec 15, 2020).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/44

The tool worked for me for a few days and then stopped working.
I am using proxmox 6.3.3 from no-subscription channel.
In my cluster some nodes are shut down. This is the only obvious thing that might be different for my cluster compared to others.

/opt/cv4pve-autosnap --api-token 'root@pam!XXXXX' --host XXXX --vmid=200,201,202,204 snap --label='4hours' --keep=12 --debug
Method: GET, Url: https://XXXX:8006/api2/json/version
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": {
    "version": "6.3-3",
    "keyboard": "de",
    "migration": {
      "type": "secure",
      "network": "192.168.88.1/24"
    },
    "release": "6.3",
    "repoid": "eee5f901"
  }
}
=============================
ACTION Snap
VMs:     200,201,202,204
Label:   4hours
Keep:    12
State:   False
Timeout: 30000
Method: GET, Url: https://XXXX:8006/api2/json/cluster/resources?type=vm
StatusCode:          OK
ReasonPhrase:        OK
IsSuccessStatusCode: True
{
  "data": [
    {
      "template": 0,
      "node": "pve3",
      "id": "qemu/118",
      "uptime": 2386396,
      "cpu": 0.0712415503131878,
      "name": "GITLAB",
      "netout": 156804366320,
      "maxcpu": 4,
      "netin": 12525075186,
      "disk": 0,
      "diskwrite": 372354505728,
      "maxdisk": 107374182400,
      "type": "qemu",
      "mem": 4637929472,
      "status": "running",
      "vmid": 118,
      "diskread": 351669629952,
      "maxmem": 12582912000
    },
    [........ all my VMs .........]
  ]
}
=============================
================ EXCEPTION ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'name'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name()
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)
================ EXCEPTION ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'name'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name()
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
   at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)
Originally created by @JohannesK142 on GitHub (Dec 15, 2020). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/44 The tool worked for me for a few days and then stopped working. I am using proxmox 6.3.3 from no-subscription channel. In my cluster some nodes are shut down. This is the only obvious thing that might be different for my cluster compared to others. ``` /opt/cv4pve-autosnap --api-token 'root@pam!XXXXX' --host XXXX --vmid=200,201,202,204 snap --label='4hours' --keep=12 --debug Method: GET, Url: https://XXXX:8006/api2/json/version StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": { "version": "6.3-3", "keyboard": "de", "migration": { "type": "secure", "network": "192.168.88.1/24" }, "release": "6.3", "repoid": "eee5f901" } } ============================= ACTION Snap VMs: 200,201,202,204 Label: 4hours Keep: 12 State: False Timeout: 30000 Method: GET, Url: https://XXXX:8006/api2/json/cluster/resources?type=vm StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [ { "template": 0, "node": "pve3", "id": "qemu/118", "uptime": 2386396, "cpu": 0.0712415503131878, "name": "GITLAB", "netout": 156804366320, "maxcpu": 4, "netin": 12525075186, "disk": 0, "diskwrite": 372354505728, "maxdisk": 107374182400, "type": "qemu", "mem": 4637929472, "status": "running", "vmid": 118, "diskread": 351669629952, "maxmem": 12582912000 }, [........ all my VMs .........] ] } ============================= ================ EXCEPTION ================ Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 'System.Dynamic.ExpandoObject' does not contain a definition for 'name' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name() at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a) at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout) at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args) ================ EXCEPTION ================ Microsoft.CSharp.RuntimeBinder.RuntimeBinderException 'System.Dynamic.ExpandoObject' does not contain a definition for 'name' at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Corsinvest.ProxmoxVE.Api.Extension.VM.VMInfo.get_Name() at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.VmCheckIdOrName(VMInfo vm, String idOrNameCheck) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.<>c__DisplayClass3_0.<GetVMs>b__1(VMInfo a) at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at Corsinvest.ProxmoxVE.Api.Extension.VM.ClientExtension.GetVMs(PveClient client, String jolly) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.GetVMs(String vmIdsOrNames) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout) at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.<Snap>b__1() at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.<OnExecute>b__0(CancellationToken _) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args) ```
kerem closed this issue 2026-02-26 17:44:06 +03:00
Author
Owner

@franklupo commented on GitHub (Dec 15, 2020):

HI,
can you esegute command in host
pvesh get /cluster/resources --type vm --output-format json-pretty

Best regards

<!-- gh-comment-id:745207507 --> @franklupo commented on GitHub (Dec 15, 2020): HI, can you esegute command in host pvesh get /cluster/resources --type vm --output-format json-pretty Best regards
Author
Owner

@JohannesK142 commented on GitHub (Dec 15, 2020):

pvesh get /cluster/resources --type vm --output-format json-pretty
[
   
   [ ............ other VMs ..........]
   {
      "id" : "qemu/103",
      "node" : "pve",
      "status" : "unknown",
      "type" : "qemu",
      "vmid" : 103
   },
   {
      "id" : "qemu/121",
      "node" : "pve",
      "status" : "unknown",
      "type" : "qemu",
      "vmid" : 121
   },
      [ ............ other VMs ..........]
   {
      "cpu" : 0.0106572484491067,
      "disk" : 0,
      "diskread" : 15345788928,
      "diskwrite" : 14155438592,
      "id" : "qemu/204",
      "maxcpu" : 4,
      "maxdisk" : 53687091200,
      "maxmem" : 6442450944,
      "mem" : 1536356352,
      "name" : "server4",
      "netin" : 2890956531,
      "netout" : 4911670243,
      "node" : "pve4",
      "status" : "running",
      "template" : 0,
      "type" : "qemu",
      "uptime" : 873049,
      "vmid" : 204
   },
   {
      "cpu" : 0.0325046077697754,
      "disk" : 0,
      "diskread" : 63852490752,
      "diskwrite" : 259464923648,
      "id" : "qemu/202",
      "maxcpu" : 4,
      "maxdisk" : 161061273600,
      "maxmem" : 12884901888,
      "mem" : 6401769472,
      "name" : "server3",
      "netin" : 2684416173,
      "netout" : 14255146738,
      "node" : "pve4",
      "status" : "running",
      "template" : 0,
      "type" : "qemu",
      "uptime" : 873077,
      "vmid" : 202
   },
   {
      "cpu" : 0.0115897576884035,
      "disk" : 0,
      "diskread" : 318615333888,
      "diskwrite" : 198261332992,
      "id" : "qemu/201",
      "maxcpu" : 8,
      "maxdisk" : 137438953472,
      "maxmem" : 17179869184,
      "mem" : 6890528768,
      "name" : "server2",
      "netin" : 4423383434,
      "netout" : 102089077552,
      "node" : "pve4",
      "status" : "running",
      "template" : 0,
      "type" : "qemu",
      "uptime" : 873095,
      "vmid" : 201
   },
   {
      "cpu" : 0.024778102644173,
      "disk" : 0,
      "diskread" : 886523292160,
      "diskwrite" : 144783825920,
      "id" : "qemu/200",
      "maxcpu" : 4,
      "maxdisk" : 429496729600,
      "maxmem" : 16777216000,
      "mem" : 10394873856,
      "name" : "server1",
      "netin" : 40501408079,
      "netout" : 1007438750475,
      "node" : "pve4",
      "status" : "running",
      "template" : 0,
      "type" : "qemu",
      "uptime" : 872401,
      "vmid" : 200
   },
      [ ............ other VMs ..........]
]
<!-- gh-comment-id:745225313 --> @JohannesK142 commented on GitHub (Dec 15, 2020): ``` pvesh get /cluster/resources --type vm --output-format json-pretty [ [ ............ other VMs ..........] { "id" : "qemu/103", "node" : "pve", "status" : "unknown", "type" : "qemu", "vmid" : 103 }, { "id" : "qemu/121", "node" : "pve", "status" : "unknown", "type" : "qemu", "vmid" : 121 }, [ ............ other VMs ..........] { "cpu" : 0.0106572484491067, "disk" : 0, "diskread" : 15345788928, "diskwrite" : 14155438592, "id" : "qemu/204", "maxcpu" : 4, "maxdisk" : 53687091200, "maxmem" : 6442450944, "mem" : 1536356352, "name" : "server4", "netin" : 2890956531, "netout" : 4911670243, "node" : "pve4", "status" : "running", "template" : 0, "type" : "qemu", "uptime" : 873049, "vmid" : 204 }, { "cpu" : 0.0325046077697754, "disk" : 0, "diskread" : 63852490752, "diskwrite" : 259464923648, "id" : "qemu/202", "maxcpu" : 4, "maxdisk" : 161061273600, "maxmem" : 12884901888, "mem" : 6401769472, "name" : "server3", "netin" : 2684416173, "netout" : 14255146738, "node" : "pve4", "status" : "running", "template" : 0, "type" : "qemu", "uptime" : 873077, "vmid" : 202 }, { "cpu" : 0.0115897576884035, "disk" : 0, "diskread" : 318615333888, "diskwrite" : 198261332992, "id" : "qemu/201", "maxcpu" : 8, "maxdisk" : 137438953472, "maxmem" : 17179869184, "mem" : 6890528768, "name" : "server2", "netin" : 4423383434, "netout" : 102089077552, "node" : "pve4", "status" : "running", "template" : 0, "type" : "qemu", "uptime" : 873095, "vmid" : 201 }, { "cpu" : 0.024778102644173, "disk" : 0, "diskread" : 886523292160, "diskwrite" : 144783825920, "id" : "qemu/200", "maxcpu" : 4, "maxdisk" : 429496729600, "maxmem" : 16777216000, "mem" : 10394873856, "name" : "server1", "netin" : 40501408079, "netout" : 1007438750475, "node" : "pve4", "status" : "running", "template" : 0, "type" : "qemu", "uptime" : 872401, "vmid" : 200 }, [ ............ other VMs ..........] ] ```
Author
Owner

@franklupo commented on GitHub (Dec 15, 2020):

Hi the problem is the unknow vm.

 "id" : "qemu/103",
      "node" : "pve",
      "status" : "unknown",
      "type" : "qemu",
      "vmid" : 103

Look how to solve the problem.

Best regards

<!-- gh-comment-id:745269373 --> @franklupo commented on GitHub (Dec 15, 2020): Hi the problem is the unknow vm. ``` "id" : "qemu/103", "node" : "pve", "status" : "unknown", "type" : "qemu", "vmid" : 103 ``` Look how to solve the problem. Best regards
Author
Owner

@JohannesK142 commented on GitHub (Dec 15, 2020):

Hi, thanks for your fast responses.

Do you mean you will look how to solve the problem, or I should look how to remove the VMs?

The unknown VMs are part of the nodes which are shut down.
I would like to keep the VMs on the shut down nodes.

Best regards

<!-- gh-comment-id:745275886 --> @JohannesK142 commented on GitHub (Dec 15, 2020): Hi, thanks for your fast responses. Do you mean you will look how to solve the problem, or I should look how to remove the VMs? The unknown VMs are part of the nodes which are shut down. I would like to keep the VMs on the shut down nodes. Best regards
Author
Owner

@franklupo commented on GitHub (Dec 15, 2020):

Hi,
I have to solve the problem.

Best regards

<!-- gh-comment-id:745387166 --> @franklupo commented on GitHub (Dec 15, 2020): Hi, I have to solve the problem. Best regards
Author
Owner

@franklupo commented on GitHub (Dec 15, 2020):

Hi,
test new version https://github.com/Corsinvest/cv4pve-autosnap/releases/tag/v1.9.11

<!-- gh-comment-id:745472352 --> @franklupo commented on GitHub (Dec 15, 2020): Hi, test new version https://github.com/Corsinvest/cv4pve-autosnap/releases/tag/v1.9.11
Author
Owner

@JohannesK142 commented on GitHub (Dec 16, 2020):

Hi, thank you very much for the fast fix! Now it is working!

Best regards

<!-- gh-comment-id:746379976 --> @JohannesK142 commented on GitHub (Dec 16, 2020): Hi, thank you very much for the fast fix! Now it is working! Best regards
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-autosnap#41
No description provided.