[GH-ISSUE #104] Ambiguous method call error in cv4pve-autosnap when creating snapshots #93

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

Originally created by @Perfeitor on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/104

What happened?

I'm encountering an issue when attempting to create snapshots using cv4pve-autosnap on Proxmox VE 8.4.1. The command fails with the following error:
The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'

Expected behavior

The snapshot should be created successfully without encountering the ambiguity error between the two WaitForTaskToFinishAsync methods.

Relevant log output

root@AutoSnap:/usr/local/bin# /usr/local/bin/cv4pve-autosnap --host=192.168.1.50 --username=Snapshot@pam --password=<my_password> --vmid=100 snap --label="every12hours" --keep=2
ACTION Snap
PVE Version:      8.4.1
VMs:              100
Label:            every12hours
Keep:             2
State:            False
Only running:     False
Timeout:          30 sec.
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
                  Storage      Type     Valid   Used %    Disk Size  Disk Usage
              ark/lxcpool   zfspool        Ok       9.8   181.03 GB     17.8 GB
               ark/vmpool   zfspool        Ok       4.9   990.53 GB    48.15 GB
----- VM 100 lxc running -----
Create snapshot: autoevery12hours250429023122
The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
fail: Corsinvest.ProxmoxVE.AutoSnap.Api.Application[0]
      The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
      Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
         at CallSite.Target(Closure, CallSite, PveClientBase, Object, Int32, Int64)
         at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
         at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Result result, Int32 wait, Int64 timeout)
         at Corsinvest.ProxmoxVE.Api.Extension.Utils.SnapshotHelper.CreateSnapshotAsync(PveClient client, String node, VmType vmType, Int64 vmId, String name, String description, Boolean state, Int64 timeout)
         at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.SnapAsync(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 maxPercentageStorage, Boolean onlyRuns)
Total execution 00:00:00.0963756

Proxmox VE Version

8.4.1

Version (bug)

1.16.0

Version (working)

No response

On what operating system are you experiencing the issue?

Linux

Pull Request

  • I would like to do a Pull Request
Originally created by @Perfeitor on GitHub (Apr 29, 2025). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/104 ### What happened? I'm encountering an issue when attempting to create snapshots using cv4pve-autosnap on Proxmox VE 8.4.1. The command fails with the following error: `The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'` ### Expected behavior The snapshot should be created successfully without encountering the ambiguity error between the two WaitForTaskToFinishAsync methods. ### Relevant log output ```shell root@AutoSnap:/usr/local/bin# /usr/local/bin/cv4pve-autosnap --host=192.168.1.50 --username=Snapshot@pam --password=<my_password> --vmid=100 snap --label="every12hours" --keep=2 ACTION Snap PVE Version: 8.4.1 VMs: 100 Label: every12hours Keep: 2 State: False Only running: False Timeout: 30 sec. Timestamp format: yyMMddHHmmss Max % Storage : 95% Storage Type Valid Used % Disk Size Disk Usage ark/lxcpool zfspool Ok 9.8 181.03 GB 17.8 GB ark/vmpool zfspool Ok 4.9 990.53 GB 48.15 GB ----- VM 100 lxc running ----- Create snapshot: autoevery12hours250429023122 The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' fail: Corsinvest.ProxmoxVE.AutoSnap.Api.Application[0] The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' at CallSite.Target(Closure, CallSite, PveClientBase, Object, Int32, Int64) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Result result, Int32 wait, Int64 timeout) at Corsinvest.ProxmoxVE.Api.Extension.Utils.SnapshotHelper.CreateSnapshotAsync(PveClient client, String node, VmType vmType, Int64 vmId, String name, String description, Boolean state, Int64 timeout) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.SnapAsync(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 maxPercentageStorage, Boolean onlyRuns) Total execution 00:00:00.0963756 ``` ### Proxmox VE Version 8.4.1 ### Version (bug) 1.16.0 ### Version (working) _No response_ ### On what operating system are you experiencing the issue? Linux ### Pull Request - [ ] I would like to do a Pull Request
kerem 2026-02-26 17:44:22 +03:00
Author
Owner

@franklupo commented on GitHub (Apr 30, 2025):

Hi,
could you give more details? I can't reproduce the error.

best regards

<!-- gh-comment-id:2841050508 --> @franklupo commented on GitHub (Apr 30, 2025): Hi, could you give more details? I can't reproduce the error. best regards
Author
Owner

@Perfeitor commented on GitHub (Apr 30, 2025):

Hi,
could you give more details? I can't reproduce the error.

best regards

Hi again,
Just wanted to follow up with additional environment information that may help reproducing the issue:

cv4pve-autosnap Version: 1.16.0

Proxmox VE Host Version: 8.4.1

Running inside LXC container on the same host

OS inside container: Debian 12 (Bookworm)
Output of cat /etc/os-release:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

LXC Container Configuration:

arch: amd64
cores: 2
features: nesting=1
hostname: AutoSnap
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:90:64:2A,ip=dhcp,ip6=auto,type=veth
ostype: debian
parent: AutoSnap
rootfs: lxcpool:subvol-107-disk-0,mountoptions=discard,size=2G
swap: 512
unprivileged: 1

How the tool was installed:
I did not install it via pip or build from source. Instead, I downloaded the prebuilt release archive from GitHub, extracted it, and ran the executable (cv4pve-autosnap) directly.

If you need any other specific information to help reproduce the issue, let me know and I’ll gladly provide it.

<!-- gh-comment-id:2841137492 --> @Perfeitor commented on GitHub (Apr 30, 2025): > Hi, > could you give more details? I can't reproduce the error. > > best regards Hi again, Just wanted to follow up with additional environment information that may help reproducing the issue: cv4pve-autosnap Version: 1.16.0 Proxmox VE Host Version: 8.4.1 Running inside LXC container on the same host OS inside container: Debian 12 (Bookworm) Output of cat /etc/os-release: ``` PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian ``` LXC Container Configuration: ``` arch: amd64 cores: 2 features: nesting=1 hostname: AutoSnap memory: 1024 net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:90:64:2A,ip=dhcp,ip6=auto,type=veth ostype: debian parent: AutoSnap rootfs: lxcpool:subvol-107-disk-0,mountoptions=discard,size=2G swap: 512 unprivileged: 1 ``` How the tool was installed: I did not install it via pip or build from source. Instead, I downloaded the prebuilt release archive from GitHub, extracted it, and ran the executable (cv4pve-autosnap) directly. If you need any other specific information to help reproduce the issue, let me know and I’ll gladly provide it.
Author
Owner

@franklupo commented on GitHub (Apr 30, 2025):

Can you rum from your computer?
Best regards

<!-- gh-comment-id:2841226947 --> @franklupo commented on GitHub (Apr 30, 2025): Can you rum from your computer? Best regards
Author
Owner

@Perfeitor commented on GitHub (Apr 30, 2025):

Can you rum from your computer?
Best regards

Could you please let me know exactly which additional information or logs you need?

<!-- gh-comment-id:2841245097 --> @Perfeitor commented on GitHub (Apr 30, 2025): > Can you rum from your computer? > Best regards Could you please let me know exactly which additional information or logs you need?
Author
Owner

@franklupo commented on GitHub (Apr 30, 2025):

If you run it from your local computer does it give you the same errors? I don't want it to be a lxc problem

<!-- gh-comment-id:2841300101 --> @franklupo commented on GitHub (Apr 30, 2025): If you run it from your local computer does it give you the same errors? I don't want it to be a lxc problem
Author
Owner

@Perfeitor commented on GitHub (Apr 30, 2025):

If you run it from your local computer does it give you the same errors? I don't want it to be a lxc problem

I have tested running cv4pve-autosnap directly on my Proxmox VE 8.4.1 host (not inside a container), and the exact same error occurs.

<!-- gh-comment-id:2841337221 --> @Perfeitor commented on GitHub (Apr 30, 2025): > If you run it from your local computer does it give you the same errors? I don't want it to be a lxc problem I have tested running cv4pve-autosnap directly on my Proxmox VE 8.4.1 host (not inside a container), and the exact same error occurs.
Author
Owner

@franklupo commented on GitHub (Apr 30, 2025):

Hi @Perfeitor,
run with parameter with --debug
WARNING!! The credentials will also be present in the logs, remove them.
Attach the log

Best regards

<!-- gh-comment-id:2842411460 --> @franklupo commented on GitHub (Apr 30, 2025): Hi @Perfeitor, run with parameter with --debug WARNING!! The credentials will also be present in the logs, remove them. Attach the log Best regards
Author
Owner

@Perfeitor commented on GitHub (May 1, 2025):

Hi @Perfeitor, run with parameter with --debug WARNING!! The credentials will also be present in the logs, remove them. Attach the log

Best regards

Apologies for the delayed reply.

After running with the --debug flag, I discovered another issue related to missing VM.Snapshot permission. Once I added the required permission, everything ran smoothly.

Thank you for your support. I can confirm that there were two issues displayed. Initially, without --debug, I only saw the WaitForTaskToFinishAsync ambiguous error. It wasn’t until I used --debug that the missing permission error appeared. After adding the missing permission, the WaitForTaskToFinishAsync ambiguous issue was no longer relevant, and the command ran successfully.

Here’s the detailed output:

root@ark:~# ./cv4pve-autosnap --host=127.0.0.1 --username=Snapshot@pam --password=my-pass --vmid=100 snap --label="
every12hours" --keep=2 --debug
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Login: Snapshot@pam
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: POST, Url: https://127.0.0.1:8006/api2/json/access/ticket
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Parameters:
      password : my-pass
      username : Snapshot
      realm : pam
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          OK
      ReasonPhrase:        OK
      IsSuccessStatusCode: True
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "data": {
          "ticket": "PVE:Snapshot@pam:681335D8::Fan3iOtk727E0rcoSLg3Ngw0TtLS+p/3EhQIjgyHbT14swnbwioP3ns42ZVB6YYxgsk3Aa7fzU0yI3Z+gqRGXmrDnitLrW6gIRP7ZSlHs9HdBVhJGUrwEsNf6/PM0WmkkSyfoSNuEYlUI2IyJZQfAf+N+chqZsBUrKXE0HrLzi6PnRdlOX4A4yDc/hFUOo9VUFo1zBvlQTygpRShBy/9Op2mb58q82aiNxEr92XMOExnG4JySNHT+pbgYf9jEQTRTX09V2zpar9SQa3ARs7MBRJ20VBnmxzRSHhtOekX+FZ+7C0/FE9+f6z3k7TIKN61IYHHV4vZ4nD3bGqJUYemOg==",
          "username": "Snapshot@pam",
          "cap": {
            "vms": {
              "VM.Backup": 1,
              "VM.Audit": 1
            },
            "dc": {},
            "mapping": {},
            "sdn": {},
            "nodes": {},
            "storage": {
              "Datastore.Audit": 1
            },
            "access": {}
          },
          "CSRFPreventionToken": "681335D8:Y5n/iAmCtDPEFYUAN/Nwjxo0iU5Ackdu6AS3aHus0TU"
        }
      }
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: GET, Url: https://127.0.0.1:8006/api2/json/version
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          OK
      ReasonPhrase:        OK
      IsSuccessStatusCode: True
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "data": {
          "release": "8.4",
          "repoid": "2a5fa54a8503f96d",
          "version": "8.4.1"
        }
      }
ACTION Snap
PVE Version:      8.4.1
VMs:              100
Label:            every12hours
Keep:             2
State:            False
Only running:     False
Timeout:          30 sec.
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=vm
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          OK
      ReasonPhrase:        OK
      IsSuccessStatusCode: True
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "data": [
          {
            "diskwrite": 0,
            "diskread": 49127424,
            "maxcpu": 2,
            "node": "ark",
            "vmid": 100,
            "template": 0,
            "tags": "192.168.1.117",
            "mem": 18173952,
            "disk": 360841216,
            "uptime": 90189,
            "maxmem": 1073741824,
            "id": "lxc/100",
            "name": "ReverseProxy",
            "status": "running",
            "maxdisk": 2147483648,
            "netin": 6953365,
            "type": "lxc",
            "cpu": 0,
            "netout": 127408
          },
          {
            "netout": 0,
            "netin": 0,
            "maxdisk": 21474836480,
            "cpu": 0,
            "type": "qemu",
            "status": "stopped",
            "name": "Ubuntu",
            "uptime": 0,
            "id": "qemu/101",
            "maxmem": 4294967296,
            "mem": 0,
            "disk": 0,
            "tags": "ubuntu",
            "node": "ark",
            "vmid": 101,
            "template": 0,
            "maxcpu": 4,
            "diskread": 0,
            "diskwrite": 0
          },
          {
            "mem": 1824968704,
            "disk": 0,
            "tags": "docker;ubuntu;web",
            "node": "ark",
            "vmid": 102,
            "template": 0,
            "maxcpu": 4,
            "diskread": 901863580,
            "diskwrite": 1009293312,
            "netout": 1900358,
            "maxdisk": 68719476736,
            "netin": 67168353,
            "cpu": 0.00223614818864392,
            "type": "qemu",
            "status": "running",
            "name": "WebServer",
            "uptime": 90187,
            "id": "qemu/102",
            "maxmem": 4294967296
          },
          {
            "diskread": 0,
            "diskwrite": 0,
            "maxcpu": 4,
            "vmid": 103,
            "node": "ark",
            "template": 0,
            "tags": "docker;game;ubuntu",
            "mem": 0,
            "disk": 0,
            "uptime": 0,
            "maxmem": 17179869184,
            "id": "qemu/103",
            "name": "GameServer",
            "status": "stopped",
            "netin": 0,
            "maxdisk": 68719476736,
            "type": "qemu",
            "cpu": 0,
            "netout": 0
          },
          {
            "type": "qemu",
            "cpu": 0,
            "netin": 0,
            "maxdisk": 34359738368,
            "netout": 0,
            "maxmem": 4294967296,
            "id": "qemu/104",
            "uptime": 0,
            "name": "Mint",
            "status": "stopped",
            "tags": "mint",
            "disk": 0,
            "mem": 0,
            "diskread": 0,
            "diskwrite": 0,
            "maxcpu": 2,
            "template": 0,
            "node": "ark",
            "vmid": 104
          },
          {
            "netout": 0,
            "type": "qemu",
            "cpu": 0,
            "netin": 0,
            "maxdisk": 68719476736,
            "name": "DockerVMTemplate",
            "status": "stopped",
            "maxmem": 4294967296,
            "id": "qemu/105",
            "uptime": 0,
            "disk": 0,
            "mem": 0,
            "template": 1,
            "vmid": 105,
            "node": "ark",
            "diskread": 0,
            "diskwrite": 0,
            "maxcpu": 2
          },
          {
            "tags": "192.168.1.11",
            "disk": 648151040,
            "mem": 86441984,
            "diskread": 46956544,
            "diskwrite": 0,
            "maxcpu": 1,
            "template": 0,
            "node": "ark",
            "vmid": 106,
            "type": "lxc",
            "cpu": 0.000198766438923249,
            "maxdisk": 2147483648,
            "netin": 9347082,
            "netout": 320569,
            "maxmem": 1073741824,
            "id": "lxc/106",
            "uptime": 90183,
            "name": "DNSServer",
            "status": "running"
          },
          {
            "uptime": 89925,
            "maxmem": 1073741824,
            "id": "lxc/107",
            "name": "AutoSnap",
            "status": "running",
            "maxdisk": 2147483648,
            "netin": 6844534,
            "type": "lxc",
            "cpu": 0,
            "netout": 62804,
            "diskread": 31649792,
            "diskwrite": 0,
            "maxcpu": 2,
            "vmid": 107,
            "node": "ark",
            "template": 0,
            "tags": "192.168.1.28",
            "mem": 18100224,
            "disk": 407502848
          }
        ]
      }
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=storage
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          OK
      ReasonPhrase:        OK
      IsSuccessStatusCode: True
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "data": [
          {
            "id": "storage/ark/local",
            "node": "ark",
            "plugintype": "dir",
            "content": "vztmpl,iso",
            "status": "available",
            "maxdisk": 63143804928,
            "type": "storage",
            "storage": "local",
            "shared": 0,
            "disk": 18628870144
          },
          {
            "content": "backup",
            "status": "available",
            "plugintype": "dir",
            "node": "ark",
            "id": "storage/ark/vmdata",
            "disk": 131072,
            "shared": 0,
            "storage": "vmdata",
            "type": "storage",
            "maxdisk": 942178697216
          },
          {
            "storage": "lxcpool",
            "type": "storage",
            "maxdisk": 181026160640,
            "disk": 18905796608,
            "shared": 0,
            "id": "storage/ark/lxcpool",
            "content": "images,rootdir",
            "status": "available",
            "plugintype": "zfspool",
            "node": "ark"
          },
          {
            "node": "ark",
            "plugintype": "zfspool",
            "content": "images,rootdir",
            "status": "available",
            "id": "storage/ark/vmpool",
            "shared": 0,
            "disk": 48348213760,
            "maxdisk": 990526832640,
            "type": "storage",
            "storage": "vmpool"
          }
        ]
      }
                  Storage      Type     Valid   Used %    Disk Size  Disk Usage
              ark/lxcpool   zfspool        Ok      10.4   181.03 GB    18.91 GB
               ark/vmpool   zfspool        Ok       4.9   990.53 GB    48.35 GB
----- VM 100 lxc running -----
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: GET, Url: https://127.0.0.1:8006/api2/json/nodes/ark/lxc/100/config
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          OK
      ReasonPhrase:        OK
      IsSuccessStatusCode: True
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "data": {
          "swap": 512,
          "hostname": "ReverseProxy",
          "memory": 1024,
          "features": "nesting=1",
          "cores": 2,
          "onboot": 1,
          "ostype": "debian",
          "unprivileged": 1,
          "tags": "192.168.1.117",
          "digest": "514a1fdc4496d24f0a2117b7f70a8332b22220f8",
          "rootfs": "lxcpool:subvol-100-disk-0,mountoptions=discard,size=2G",
          "arch": "amd64",
          "parent": "CleanOS",
          "net0": "name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:EB:DF:36,ip=dhcp,ip6=auto,type=veth"
        }
      }
Create snapshot: autoevery12hours250501155032
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Method: POST, Url: https://127.0.0.1:8006/api2/json/nodes/ark/lxc/100/snapshot
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      Parameters:
      snapname : autoevery12hours250501155032
      description : cv4pve-autosnap
dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      StatusCode:          Forbidden
      ReasonPhrase:        Permission check failed (/vms/100, VM.Snapshot)
      IsSuccessStatusCode: False
trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0]
      {
        "message": "Permission check failed (/vms/100, VM.Snapshot)\n",
        "data": null
      }
The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
fail: Corsinvest.ProxmoxVE.AutoSnap.Api.Application[0]
      The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
      Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)'
         at CallSite.Target(Closure, CallSite, PveClientBase, Object, Int32, Int64)
         at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
         at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Result result, Int32 wait, Int64 timeout)
         at Corsinvest.ProxmoxVE.Api.Extension.Utils.SnapshotHelper.CreateSnapshotAsync(PveClient client, String node, VmType vmType, Int64 vmId, String name, String description, Boolean state, Int64 timeout)
         at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.SnapAsync(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 maxPercentageStorage, Boolean onlyRuns)
Total execution 00:00:00.0856076

Best regards.

<!-- gh-comment-id:2844439937 --> @Perfeitor commented on GitHub (May 1, 2025): > Hi [@Perfeitor](https://github.com/Perfeitor), run with parameter with --debug WARNING!! The credentials will also be present in the logs, remove them. Attach the log > > Best regards Apologies for the delayed reply. After running with the --debug flag, I discovered another issue related to missing VM.Snapshot permission. Once I added the required permission, everything ran smoothly. Thank you for your support. I can confirm that there were two issues displayed. Initially, without --debug, I only saw the WaitForTaskToFinishAsync ambiguous error. It wasn’t until I used --debug that the missing permission error appeared. After adding the missing permission, the WaitForTaskToFinishAsync ambiguous issue was no longer relevant, and the command ran successfully. Here’s the detailed output: ``` root@ark:~# ./cv4pve-autosnap --host=127.0.0.1 --username=Snapshot@pam --password=my-pass --vmid=100 snap --label=" every12hours" --keep=2 --debug dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Login: Snapshot@pam dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: POST, Url: https://127.0.0.1:8006/api2/json/access/ticket dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Parameters: password : my-pass username : Snapshot realm : pam dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": { "ticket": "PVE:Snapshot@pam:681335D8::Fan3iOtk727E0rcoSLg3Ngw0TtLS+p/3EhQIjgyHbT14swnbwioP3ns42ZVB6YYxgsk3Aa7fzU0yI3Z+gqRGXmrDnitLrW6gIRP7ZSlHs9HdBVhJGUrwEsNf6/PM0WmkkSyfoSNuEYlUI2IyJZQfAf+N+chqZsBUrKXE0HrLzi6PnRdlOX4A4yDc/hFUOo9VUFo1zBvlQTygpRShBy/9Op2mb58q82aiNxEr92XMOExnG4JySNHT+pbgYf9jEQTRTX09V2zpar9SQa3ARs7MBRJ20VBnmxzRSHhtOekX+FZ+7C0/FE9+f6z3k7TIKN61IYHHV4vZ4nD3bGqJUYemOg==", "username": "Snapshot@pam", "cap": { "vms": { "VM.Backup": 1, "VM.Audit": 1 }, "dc": {}, "mapping": {}, "sdn": {}, "nodes": {}, "storage": { "Datastore.Audit": 1 }, "access": {} }, "CSRFPreventionToken": "681335D8:Y5n/iAmCtDPEFYUAN/Nwjxo0iU5Ackdu6AS3aHus0TU" } } dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://127.0.0.1:8006/api2/json/version dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": { "release": "8.4", "repoid": "2a5fa54a8503f96d", "version": "8.4.1" } } ACTION Snap PVE Version: 8.4.1 VMs: 100 Label: every12hours Keep: 2 State: False Only running: False Timeout: 30 sec. Timestamp format: yyMMddHHmmss Max % Storage : 95% dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=vm dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": [ { "diskwrite": 0, "diskread": 49127424, "maxcpu": 2, "node": "ark", "vmid": 100, "template": 0, "tags": "192.168.1.117", "mem": 18173952, "disk": 360841216, "uptime": 90189, "maxmem": 1073741824, "id": "lxc/100", "name": "ReverseProxy", "status": "running", "maxdisk": 2147483648, "netin": 6953365, "type": "lxc", "cpu": 0, "netout": 127408 }, { "netout": 0, "netin": 0, "maxdisk": 21474836480, "cpu": 0, "type": "qemu", "status": "stopped", "name": "Ubuntu", "uptime": 0, "id": "qemu/101", "maxmem": 4294967296, "mem": 0, "disk": 0, "tags": "ubuntu", "node": "ark", "vmid": 101, "template": 0, "maxcpu": 4, "diskread": 0, "diskwrite": 0 }, { "mem": 1824968704, "disk": 0, "tags": "docker;ubuntu;web", "node": "ark", "vmid": 102, "template": 0, "maxcpu": 4, "diskread": 901863580, "diskwrite": 1009293312, "netout": 1900358, "maxdisk": 68719476736, "netin": 67168353, "cpu": 0.00223614818864392, "type": "qemu", "status": "running", "name": "WebServer", "uptime": 90187, "id": "qemu/102", "maxmem": 4294967296 }, { "diskread": 0, "diskwrite": 0, "maxcpu": 4, "vmid": 103, "node": "ark", "template": 0, "tags": "docker;game;ubuntu", "mem": 0, "disk": 0, "uptime": 0, "maxmem": 17179869184, "id": "qemu/103", "name": "GameServer", "status": "stopped", "netin": 0, "maxdisk": 68719476736, "type": "qemu", "cpu": 0, "netout": 0 }, { "type": "qemu", "cpu": 0, "netin": 0, "maxdisk": 34359738368, "netout": 0, "maxmem": 4294967296, "id": "qemu/104", "uptime": 0, "name": "Mint", "status": "stopped", "tags": "mint", "disk": 0, "mem": 0, "diskread": 0, "diskwrite": 0, "maxcpu": 2, "template": 0, "node": "ark", "vmid": 104 }, { "netout": 0, "type": "qemu", "cpu": 0, "netin": 0, "maxdisk": 68719476736, "name": "DockerVMTemplate", "status": "stopped", "maxmem": 4294967296, "id": "qemu/105", "uptime": 0, "disk": 0, "mem": 0, "template": 1, "vmid": 105, "node": "ark", "diskread": 0, "diskwrite": 0, "maxcpu": 2 }, { "tags": "192.168.1.11", "disk": 648151040, "mem": 86441984, "diskread": 46956544, "diskwrite": 0, "maxcpu": 1, "template": 0, "node": "ark", "vmid": 106, "type": "lxc", "cpu": 0.000198766438923249, "maxdisk": 2147483648, "netin": 9347082, "netout": 320569, "maxmem": 1073741824, "id": "lxc/106", "uptime": 90183, "name": "DNSServer", "status": "running" }, { "uptime": 89925, "maxmem": 1073741824, "id": "lxc/107", "name": "AutoSnap", "status": "running", "maxdisk": 2147483648, "netin": 6844534, "type": "lxc", "cpu": 0, "netout": 62804, "diskread": 31649792, "diskwrite": 0, "maxcpu": 2, "vmid": 107, "node": "ark", "template": 0, "tags": "192.168.1.28", "mem": 18100224, "disk": 407502848 } ] } dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=storage dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": [ { "id": "storage/ark/local", "node": "ark", "plugintype": "dir", "content": "vztmpl,iso", "status": "available", "maxdisk": 63143804928, "type": "storage", "storage": "local", "shared": 0, "disk": 18628870144 }, { "content": "backup", "status": "available", "plugintype": "dir", "node": "ark", "id": "storage/ark/vmdata", "disk": 131072, "shared": 0, "storage": "vmdata", "type": "storage", "maxdisk": 942178697216 }, { "storage": "lxcpool", "type": "storage", "maxdisk": 181026160640, "disk": 18905796608, "shared": 0, "id": "storage/ark/lxcpool", "content": "images,rootdir", "status": "available", "plugintype": "zfspool", "node": "ark" }, { "node": "ark", "plugintype": "zfspool", "content": "images,rootdir", "status": "available", "id": "storage/ark/vmpool", "shared": 0, "disk": 48348213760, "maxdisk": 990526832640, "type": "storage", "storage": "vmpool" } ] } Storage Type Valid Used % Disk Size Disk Usage ark/lxcpool zfspool Ok 10.4 181.03 GB 18.91 GB ark/vmpool zfspool Ok 4.9 990.53 GB 48.35 GB ----- VM 100 lxc running ----- dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: GET, Url: https://127.0.0.1:8006/api2/json/nodes/ark/lxc/100/config dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "data": { "swap": 512, "hostname": "ReverseProxy", "memory": 1024, "features": "nesting=1", "cores": 2, "onboot": 1, "ostype": "debian", "unprivileged": 1, "tags": "192.168.1.117", "digest": "514a1fdc4496d24f0a2117b7f70a8332b22220f8", "rootfs": "lxcpool:subvol-100-disk-0,mountoptions=discard,size=2G", "arch": "amd64", "parent": "CleanOS", "net0": "name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:EB:DF:36,ip=dhcp,ip6=auto,type=veth" } } Create snapshot: autoevery12hours250501155032 dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Method: POST, Url: https://127.0.0.1:8006/api2/json/nodes/ark/lxc/100/snapshot dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] Parameters: snapname : autoevery12hours250501155032 description : cv4pve-autosnap dbug: Corsinvest.ProxmoxVE.Api.PveClientBase[0] StatusCode: Forbidden ReasonPhrase: Permission check failed (/vms/100, VM.Snapshot) IsSuccessStatusCode: False trce: Corsinvest.ProxmoxVE.Api.PveClientBase[0] { "message": "Permission check failed (/vms/100, VM.Snapshot)\n", "data": null } The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' fail: Corsinvest.ProxmoxVE.AutoSnap.Api.Application[0] The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Corsinvest.ProxmoxVE.Api.Result, int, long)' and 'Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(string, int, long)' at CallSite.Target(Closure, CallSite, PveClientBase, Object, Int32, Int64) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinishAsync(Result result, Int32 wait, Int64 timeout) at Corsinvest.ProxmoxVE.Api.Extension.Utils.SnapshotHelper.CreateSnapshotAsync(PveClient client, String node, VmType vmType, Int64 vmId, String name, String description, Boolean state, Int64 timeout) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.SnapAsync(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 maxPercentageStorage, Boolean onlyRuns) Total execution 00:00:00.0856076 ``` Best regards.
Author
Owner
<!-- gh-comment-id:2844764908 --> @franklupo commented on GitHub (May 1, 2025): https://github.com/Corsinvest/cv4pve-autosnap?tab=readme-ov-file#permission
Author
Owner

@Perfeitor commented on GitHub (May 1, 2025):

https://github.com/Corsinvest/cv4pve-autosnap?tab=readme-ov-file#permission

Thank you very much for your support. Everything is working perfectly now. The mistake was on my side - I granted all necessary permissions but overlooked VM.Snapshot.

<!-- gh-comment-id:2844791475 --> @Perfeitor commented on GitHub (May 1, 2025): > https://github.com/Corsinvest/cv4pve-autosnap?tab=readme-ov-file#permission Thank you very much for your support. Everything is working perfectly now. The mistake was on my side - I granted all necessary permissions but overlooked VM.Snapshot.
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#93
No description provided.