Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-ObjectLog - Could not deserialize value #214

Closed
mup07 opened this issue Apr 21, 2021 · 3 comments
Closed

Get-ObjectLog - Could not deserialize value #214

mup07 opened this issue Apr 21, 2021 · 3 comments
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version

Comments

@mup07
Copy link

mup07 commented Apr 21, 2021

Bug description
We have problem while running the command "Get-ObjectLog". We get the error:

Get-ObjectLog : Could not deserialize value '406' as it is not a valid member of type 'PrtgAPI.LogStatus'. Could not process XML '<status>FTP Connection Mode</status><status_raw>406</status_raw><message><div 
class="logmessage">Connection established using implicit mode.<div class="moreicon"></div></div></message>'.
At line:1 char:1
+ Get-ObjectLog -StartDate $(get-date("13.04.2021 01:42:00")) -EndDate  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ObjectLog], XmlDeserializationException
    + FullyQualifiedErrorId : PrtgAPI.XmlDeserializationException,PrtgAPI.PowerShell.Cmdlets.GetObjectLog

Steps to reproduce
While the analysis, we could reproduce the error by filter the Logs to the specific sensor and datetime:

Get-ObjectLog -StartDate $(get-date("13.04.2021 01:42:00")) -EndDate $(get-date("11.04.2021 01:00:00")) -Object (Get-Sensor -Id 3561)

The sensor is a default type of FTP Sensor on PRTG:

DisplayLastValue   : 125 msec
LastValue          : 125
BaseType           : Sensor
Url                : /sensor.htm?id=3561
Interval           : 00:15:00
InheritInterval    : False
Access             : Inherited
Position           : 7
Status             : Up
Message            : OK (221 - Session Ended. Downloaded 0KB, Uploaded 0KB. Goodbye abc from x.x.x.x.)
Id                 : 3561
ParentId           : 3530
Tags               : {ftpsensor}
DisplayType        : FTP
Type               : Sensor (ftp)
Active             : True

We were able to limit this period to a single log entry. It is an entry with the status "FTP Connection Mode".
No such status name or status ID 406 (from the error message) is listed in the PRTG manuals.
(Source: PRTG Manual: Single Object Status)

What is the output of Get-PrtgClient -Diagnostic?

PSVersion      : 5.1.19041.906
PSEdition      : Desktop
OS             : Microsoft Windows 10 Pro
PrtgAPIVersion : 0.9.14
Culture        : de-CH
CLRVersion     : 528372
PrtgVersion    : 21.1.65.1767
PrtgLanguage   : Unknown

Can you reproduce this situation? Or exists already a solution for this?

@mup07 mup07 added the alleged-bug Bugs raised by people helpfully using the Bug Report template! label Apr 21, 2021
@lordmilko
Copy link
Owner

lordmilko commented Apr 21, 2021

Hi @mup07,

In LogStatus.cs we have the following:

[XmlEnum("405")]
UsePerfCounters,
//todo: apparently theres a 406 ftp mode?
/// <summary>
/// An FTP connection could not be established using the specified mode.
/// </summary>
[XmlEnum("407")]
FtpMode,

Evidently, at some point I became aware of the fact there was a 406 FTP Mode, but I had no idea what it was, how to generate it, or how it differed from the other 407 FTP Mode! Several years later, we finally have the answer!

I have pushed a commit for a pre-release version of the next version of PrtgAPI; if it successfully builds in the next 30 minutes, you'll be able to manually download the PrtgAPI.zip artifact that is created as per the manual installation instructions

Regards,
lordmilko

@lordmilko lordmilko added bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version and removed alleged-bug Bugs raised by people helpfully using the Bug Report template! labels Apr 21, 2021
lordmilko added a commit that referenced this issue Apr 21, 2021
@mup07
Copy link
Author

mup07 commented Apr 22, 2021

Hi @lordmilko

It worked very good. Thanks for the fast reply.

Regards,
mup07

@lordmilko
Copy link
Owner

Hi @mup07,

Please be advised PrtgAPI 0.9.15 has now been released which includes a fix for this issue

To update PrtgAPI, please run Update-Module PrtgAPI and reopen PowerShell

Regards,
lordmilko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version
Projects
None yet
Development

No branches or pull requests

2 participants