Corsinvest / cv4pve-api-dotnet

Proxmox VE Client API .Net C#
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
58 stars 15 forks source link

Exception at Corsinvest.ProxmoxVE.Api.Shared.Models.Vm.VmConfig.OnSerializedMethod #25

Open redbits-temp opened 6 days ago

redbits-temp commented 6 days ago

What happened?

Used CV4PVE-ADMIN v1.1.2

A lot of things don't worк...

If configuration VM has:

scsi2: /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC,size=2930266584K

Or, configuration CT has:

mp1: /mnt/pve/ext4-backup,mp=/ext4-backup

The configuration line does not have ":".

https://github.com/Corsinvest/cv4pve-api-dotnet/blob/ae5669237f5f577b665876815cd3fa8ec5f6a393/src/Corsinvest.ProxmoxVE.Api.Shared/Models/Vm/VmConfig.cs#L118

https://github.com/Corsinvest/cv4pve-api-dotnet/blob/ae5669237f5f577b665876815cd3fa8ec5f6a393/src/Corsinvest.ProxmoxVE.Api.Shared/Models/Vm/VmConfig.cs#L124

2024-09-12 23:22:26.115 +05:00 [ERR] Failed to process the job '18': an exception occurred.   <s:Hangfire.AutomaticRetryAttribute>
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
   at Corsinvest.ProxmoxVE.Api.Shared.Models.Vm.VmConfig.OnSerializedMethod(StreamingContext context)
 ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at InvokeStub_VmConfig.OnSerializedMethod(Object, Span`1)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Expected behavior

I expect there will be no exceptions.

Relevant log output

No response

Net Version

3.0.0

Proxmox VE Version

5.0.0

Version (bug)

8.2.4

Version (working)

No response

On what operating system are you experiencing the issue?

Linux

Pull Request

franklupo commented 5 days ago

can you attach the VM/CT configuration file?

best regards

redbits-temp commented 4 days ago

No. It's just one line in the config.

This error is obvious.

Requires disk (VM) or directory (CT) passthrough.

There is a solution for CT... I'll comment later.

VM: https://pve.proxmox.com/wiki/Passthrough_Physical_Disk_to_Virtual_Machine_(VM)

scsi2: /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC,size=2930266584K

CT: https://pve.proxmox.com/wiki/Linux_Container

mp0: /mnt/bindmounts/shared,mp=/shared

There is no colon symbol in these lines, which leads to an error.