[GH-ISSUE #57] Error on fresh install #54

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

Originally created by @sgtpepperaut on GitHub (Dec 23, 2021).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/57

What happened?

running a simple one liner on a fresh install gives me an error on proxmox 7.1-7
/usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username="snapshot@pve" --password="MYPASS" --vmid=5020 snap --label="daily" --keep=6

Expected behavior

create a snapshot :)

Relevant log output

ACTION Snap
VMs:              5020
Label:            daily
Keep:             6
State:            False
Timeout:          30000
Timestamp format: yyMMddHHmmss
Max % Storage :   95%
================ EXCEPTION ================
System.IndexOutOfRangeException
Index was outside the bounds of the array.
   at BetterConsoleTables.Table.ToString(Int32[] columnLengths)
   at BetterConsoleTables.Table.ToString()
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows)
   at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage)
   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)

Proxmox VE Version

7.1-7

Version (bug)

1.13.2

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 @sgtpepperaut on GitHub (Dec 23, 2021). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/57 ### What happened? running a simple one liner on a fresh install gives me an error on proxmox 7.1-7 /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username="snapshot@pve" --password="MYPASS" --vmid=5020 snap --label="daily" --keep=6 ### Expected behavior create a snapshot :) ### Relevant log output ```shell ACTION Snap VMs: 5020 Label: daily Keep: 6 State: False Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 95% ================ EXCEPTION ================ System.IndexOutOfRangeException Index was outside the bounds of the array. at BetterConsoleTables.Table.ToString(Int32[] columnLengths) at BetterConsoleTables.Table.ToString() at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage) 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) ``` ### Proxmox VE Version 7.1-7 ### Version (bug) 1.13.2 ### 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:11 +03:00
Author
Owner

@franklupo commented on GitHub (Dec 23, 2021):

Hi,
can you run with the --debug option and attach the result?
Remember to remove the password information from the registry.

Best regards

<!-- gh-comment-id:1000153369 --> @franklupo commented on GitHub (Dec 23, 2021): Hi, can you run with the --debug option and attach the result? Remember to remove the password information from the registry. Best regards
Author
Owner

@sgtpepperaut commented on GitHub (Dec 23, 2021):

here is the output:

``root@srv1:/usr/local/bin# /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username="snapshot@pve" --password="mypass" --vmid=5020 snap --label="daily" --keep=6 --debug
Method: POST, Url: https://127.0.0.1:8006/api2/json/access/ticket
Parameters:
password : mypass
username : snapshot
realm : pve
StatusCode: OK
ReasonPhrase: OK
IsSuccessStatusCode: True
{
"data": {
"CSRFPreventionToken": "61C44923:83IcfAEX0xLSEtgC3l1FPctsp86ts9L+6ooBlGWEaEE",
"cap": {
"nodes": {},
"dc": {},
"storage": {},
"access": {},
"vms": {
"VM.Snapshot": 1,
"VM.Audit": 1,
"VM.Snapshot.Rollback": 1
},
"sdn": {}
},
"username": "snapshot@pve",
"ticket": "PVE:snapshot@pve:61C44923::jTuYiasr0R6RoUyC0KpLDpN8Ydk9C+4D3yvfIs8AcfQzUGijoPRc0PqjGrqvGwL6f1TTpOeYNlLzJqHsrPIpt+dAGory2EjgnE5R46t9M9PNL1ccKp5XadcbhWribicc4JPQMvUU9HqEhrl80apkMLiuTgdg9VdBmLVM/+kKY98/soMsBMaaVhssE3Tnj8L4233XiutgV6HUfdfInX/AeaLVWURrWGJZMo/WhvZrbio3lgN34IQmfEoul8eUrZdYAcYewiSP8gNUu3sUDq75hz5kt3FLxWOg3LjfWVIdAEgS/IM7kchxRUZ7dO0Gf2Gz1N7JZHxv/iq+i7355CskTw=="
}
}

ACTION Snap
VMs: 5020
Label: daily
Keep: 6
State: False
Timeout: 30000
Timestamp format: yyMMddHHmmss
Max % Storage : 95%
Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=vm
StatusCode: OK
ReasonPhrase: OK
IsSuccessStatusCode: True
{
"data": [
{
"name": "ano-pfsense",
"netin": 20613081521,
"diskwrite": 30332746240,
"netout": 13493524657,
"type": "qemu",
"mem": 1365996020,
"template": 0,
"vmid": 5001,
"diskread": 176566742,
"node": "srv1",
"cpu": 0.00590965218071446,
"maxcpu": 4,
"id": "qemu/5001",
"status": "running",
"disk": 0,
"maxmem": 4194304000,
"maxdisk": 6442450944,
"uptime": 1452533
},
etc more vms...
]
}

Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=storage
StatusCode: OK
ReasonPhrase: OK
IsSuccessStatusCode: True
{
"data": []
}

================ EXCEPTION ================
System.IndexOutOfRangeException
Index was outside the bounds of the array.
at BetterConsoleTables.Table.ToString(Int32[] columnLengths)
at BetterConsoleTables.Table.ToString()
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable1 columns, IEnumerable1 rows, TableOutputType outputType, Boolean hasInnerRows)
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable1 columns, IEnumerable1 rows, TableOutputType outputType, Boolean hasInnerRows)
at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.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 ================
System.IndexOutOfRangeException
Index was outside the bounds of the array.
at BetterConsoleTables.Table.ToString(Int32[] columnLengths)
at BetterConsoleTables.Table.ToString()
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable1 columns, IEnumerable1 rows, TableOutputType outputType, Boolean hasInnerRows)
at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable1 columns, IEnumerable1 rows, TableOutputType outputType, Boolean hasInnerRows)
at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.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)``

<!-- gh-comment-id:1000187184 --> @sgtpepperaut commented on GitHub (Dec 23, 2021): here is the output: ``root@srv1:/usr/local/bin# /usr/local/bin/cv4pve-autosnap --host=127.0.0.1 --username="snapshot@pve" --password="mypass" --vmid=5020 snap --label="daily" --keep=6 --debug Method: POST, Url: https://127.0.0.1:8006/api2/json/access/ticket Parameters: password : mypass username : snapshot realm : pve StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": { "CSRFPreventionToken": "61C44923:83IcfAEX0xLSEtgC3l1FPctsp86ts9L+6ooBlGWEaEE", "cap": { "nodes": {}, "dc": {}, "storage": {}, "access": {}, "vms": { "VM.Snapshot": 1, "VM.Audit": 1, "VM.Snapshot.Rollback": 1 }, "sdn": {} }, "username": "snapshot@pve", "ticket": "PVE:snapshot@pve:61C44923::jTuYiasr0R6RoUyC0KpLDpN8Ydk9C+4D3yvfIs8AcfQzUGijoPRc0PqjGrqvGwL6f1TTpOeYNlLzJqHsrPIpt+dAGory2EjgnE5R46t9M9PNL1ccKp5XadcbhWribicc4JPQMvUU9HqEhrl80apkMLiuTgdg9VdBmLVM/+kKY98/soMsBMaaVhssE3Tnj8L4233XiutgV6HUfdfInX/AeaLVWURrWGJZMo/WhvZrbio3lgN34IQmfEoul8eUrZdYAcYewiSP8gNUu3sUDq75hz5kt3FLxWOg3LjfWVIdAEgS/IM7kchxRUZ7dO0Gf2Gz1N7JZHxv/iq+i7355CskTw==" } } ============================= ACTION Snap VMs: 5020 Label: daily Keep: 6 State: False Timeout: 30000 Timestamp format: yyMMddHHmmss Max % Storage : 95% Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=vm StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [ { "name": "ano-pfsense", "netin": 20613081521, "diskwrite": 30332746240, "netout": 13493524657, "type": "qemu", "mem": 1365996020, "template": 0, "vmid": 5001, "diskread": 176566742, "node": "srv1", "cpu": 0.00590965218071446, "maxcpu": 4, "id": "qemu/5001", "status": "running", "disk": 0, "maxmem": 4194304000, "maxdisk": 6442450944, "uptime": 1452533 }, etc more vms... ] } ============================= Method: GET, Url: https://127.0.0.1:8006/api2/json/cluster/resources?type=storage StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [] } ============================= ================ EXCEPTION ================ System.IndexOutOfRangeException Index was outside the bounds of the array. at BetterConsoleTables.Table.ToString(Int32[] columnLengths) at BetterConsoleTables.Table.ToString() at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage) 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 ================ System.IndexOutOfRangeException Index was outside the bounds of the array. at BetterConsoleTables.Table.ToString(Int32[] columnLengths) at BetterConsoleTables.Table.ToString() at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.Api.Extension.Helpers.TableHelper.Create(IEnumerable`1 columns, IEnumerable`1 rows, TableOutputType outputType, Boolean hasInnerRows) at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout, String timestampFormat, Int32 optMaxPercentageStorage) 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)``
Author
Owner

@franklupo commented on GitHub (Dec 24, 2021):

Permission problem read documentation

<!-- gh-comment-id:1000927874 --> @franklupo commented on GitHub (Dec 24, 2021): Permission problem read documentation
Author
Owner

@bwmravec commented on GitHub (Dec 27, 2021):

Your user snapshot@pve doesn't have access to storage where you are storing snapshots. Simply add this user with permissions "Datastore.Audit Pool.Audit VM.Audit VM.Snapshot" also to your storage, not only to VM 5020.

<!-- gh-comment-id:1001632020 --> @bwmravec commented on GitHub (Dec 27, 2021): Your user snapshot@pve doesn't have access to storage where you are storing snapshots. Simply add this user with permissions "Datastore.Audit Pool.Audit VM.Audit VM.Snapshot" also to your storage, not only to VM 5020.
Author
Owner

@thunfischbrot commented on GitHub (Jan 2, 2022):

The error message could provide a hint to the permission problem. This might also save you from answering these questions in the future :-)

<!-- gh-comment-id:1003766573 --> @thunfischbrot commented on GitHub (Jan 2, 2022): The error message could provide a hint to the permission problem. This might also save you from answering these questions in the future :-)
Author
Owner

@franklupo commented on GitHub (Jan 4, 2022):

Fix in new version

<!-- gh-comment-id:1004836682 --> @franklupo commented on GitHub (Jan 4, 2022): Fix in new version
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#54
No description provided.