Corsinvest / cv4pve-autosnap

Automatic snapshot tool for Proxmox VE
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
403 stars 50 forks source link

errors in various actions "Unhandled exception " #61

Closed snetat closed 2 years ago

snetat commented 2 years ago

What happened?

errors in various actions "Unhandled exception"

Expected behavior

that it works

Relevant log output

`cv4pve-autosnap-new status`

Unhandled exception: Corsinvest.ProxmoxVE.Api.Shared.PveException: Problem connection!
 ---> Corsinvest.ProxmoxVE.Api.Shared.PveException: Error: host 
 ---> System.ArgumentException: The parameter 'host' cannot be an empty string.
   at System.Net.DnsEndPoint..ctor(String host, Int32 port, AddressFamily addressFamily)
   at System.Net.DnsEndPoint..ctor(String host, Int32 port)
   at System.Net.Sockets.Socket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at Corsinvest.ProxmoxVE.Api.Extension.Utils.ClientHelper.TryHostAndPort(String hostsAndPorts, Int32 defaultPort, Boolean checkPort, Int32 timeout, String& host, Int32& port)
   --- End of inner exception stack trace ---
   at Corsinvest.ProxmoxVE.Api.Extension.Utils.ClientHelper.TryHostAndPort(String hostsAndPorts, Int32 defaultPort, Boolean checkPort, Int32 timeout, String& host, Int32& port)
   at Corsinvest.ProxmoxVE.Api.Extension.Utils.ClientHelper.GetClientFromHA(String hostsAndPortHA, Int32 timeout)
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.CommandOptionExtension.ClientTryLogin(Command command, ILoggerFactory loggerFactory)
   --- End of inner exception stack trace ---
   at Corsinvest.ProxmoxVE.Api.Shell.Helpers.CommandOptionExtension.ClientTryLogin(Command command, ILoggerFactory loggerFactory)
   at Corsinvest.ProxmoxVE.AutoSnap.Commands.CreateApp(RootCommand command)
   at Corsinvest.ProxmoxVE.AutoSnap.Commands.<>c__DisplayClass10_0.<<Status>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()

cv4pve-autosnap-new --host=x.x.x.x --username=xxxxxxx@pam --password=xxxxxxxxx --vmid 123 --timestamp-format=yyyyMMdd_HHmmss snap --label=_hourly_ --keep=12

Unhandled exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'data'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Corsinvest.ProxmoxVE.Api.ResultExtension.ToData(Result result)
   at Corsinvest.ProxmoxVE.Api.ResultExtension.ToModel[T](Result result)
   at Corsinvest.ProxmoxVE.Api.Extension.ModelsExtensionsAutoGen.Get(PveResources item, String type)
   at Corsinvest.ProxmoxVE.Api.Extension.ModelsExtensions.Get(PveResources item, ClusterResourceType resourceType)
   at Corsinvest.ProxmoxVE.Api.Extension.ClientExtension.GetResources(PveClient client, ClusterResourceType resourceType)
   at Corsinvest.ProxmoxVE.Api.Extension.ClientExtension.GetVms(PveClient client)
   at Corsinvest.ProxmoxVE.Api.Extension.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, String timestampFormat, Int32 maxPercentageStorage)
   at Corsinvest.ProxmoxVE.AutoSnap.Commands.<>c__DisplayClass12_0.<<Snap>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()


### Proxmox VE Version

7.1-12

### Version (bug)

1.14.1

### Version (working)

1.13.3

### On what operating system are you experiencing the issue?

Linux

### Pull Request

- [ ] I would like to do a Pull Request
franklupo commented 2 years ago

HI, can you try to execute command line

cv4pve-autosnap-new --host=x.x.x.x --username=xxxxxxx@pam --password=xxxxxxxxx --vmid 123 --timestamp-format=yyyyMMdd_HHmmss snap --label=_hourly_ --keep=12

with --debug option and attach log?

best regards

snetat commented 2 years ago
=============================
Method: GET, Url: https://x.x.x.x:8006/api2/json/cluster/resources?type=storage
StatusCode:          Unauthorized
ReasonPhrase:        permission denied - invalid PVE ticket
IsSuccessStatusCode: False
null
=============================
================ EXCEPTION ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'data'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at CallSite.Target(Closure , CallSite , Object )
   at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.ToEnumerable(Result result)
   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 ================ 
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
'System.Dynamic.ExpandoObject' does not contain a definition for 'data'
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at CallSite.Target(Closure , CallSite , Object )
   at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.ToEnumerable(Result result)
   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)
franklupo commented 2 years ago

The use not have a permission to execute

franklupo commented 2 years ago

news?

snetat commented 2 years ago

maybe i have entered a wrong password. now i have the following problem: i start 1.13.3 and 1.14.1 identically, with 1.14.1 i get this error when snapshotting a lxc

Max % Storage :   95%
                  Storage      Type     Valid   Used %    Disk Size  Disk Usage
          srv-3ea/srv-7d2       nfs        Ok      31.8     5.46 TB     1.74 TB
          srv-3ea/srv-7d4       nfs        Ok      15.1    20.95 TB     3.16 TB
            srv-3ea/tank1   zfspool        Ok      11.4    922.5 GB   104.78 GB
----- VM 128 lxc -----
Skip VM problem storage space out of 95%
Total execution 00:00:00.1684170

the container is located on the local storage srv-3ea/tank1

franklupo commented 2 years ago

Found error. Fixed in new release

franklupo commented 2 years ago

Hi @snetat , the new version is available.

Best reagrds

snetat commented 2 years ago

i can confirm that snapshotting from lxc container is working again. thanks for the quick fix.

franklupo commented 2 years ago

You are welcome