-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
NotificationTriggerTranslator: Sequence contains more than one matching element #145
Comments
Hi @paulkva,
|
In addition to the above, I just tried creating a second notification action called Ticket Notification and that doesn't appear to have caused any issues. Are you able to provide a stack trace? |
Ah yes, sorry for the lack of stack trace, and sorry it wasn't clear that PrtgAPI was throwing an exception. Here's the stack trace:
I ran locally in debug mode (with 0.9.13-pre) and found the exception was thrown at I believe these are the specific steps to re-create:
For what it's worth, we did steps 1 and 2 a long time ago with earlier versions of our code (and earlier versions of PrtgAPI), but it doesn't matter -- you could even do them manually on PRTG's front-end. I'm guessing when you created a second Ticket Notification action, it didn't throw an error because by default, nobody has any access rights to the Ticket Notification action that PRTG provides by default. Maybe try granting full access to both for whichever account you use to login via PrtgAPI? |
Hi @paulkva, What is the display language you are using in PRTG? It sounds like it is not English |
…ation Action items, resulting in crash when multiple actions exist with the same name (#145)
…ation Action items, resulting in crash when multiple actions exist with the same name (#145)
Hi @paulkva, This issue should now be resolved. Please check out the latest pre-release build and let me know how you go Out of interest, I see you mentioned you compiled PrtgAPI yourself to get more information from a debug build. Did you have any issues getting PrtgAPI to compile, and which method of compilation did you use? I find a lot of projects on the internet are an absolute nightmare to compile for some inexplicable reason, so one of my goals is to make compiling PrtgAPI "just work" as much as possible. |
Thanks for the resolution. For what it's worth, I am indeed using English. The main reason I compiled 0.9.13-pre myself was that I wanted it as a .nupkg file to minimize changes to my project's structure. When I previously compiled 0.9.13-pre, here's what I did:
After pulling the latest code, building
Building
I haven't had a chance to try the latest binary yet but can probably do so in the next few hours. |
I can confirm that including the latest binary as a direct reference fixes the exception that prompted me to open this issue. Thanks again! Happy to continue iterating on building locally if you'd like. |
Thanks @paulkva! I see I forgot to include the reference to I had a look at the issues with PrtgAPI/build/CI/CI/New-CSharpPackage.ps1 Lines 50 to 63 in de6fb2c
|
Describe the bug
Upgraded to 0.9.13 (dev build) to try a new enhancement to the
WatchLogs()
method. That worked, but it turns out it breaks some of our other logic for handling triggers. Same problem with 0.9.12.Steps to reproduce
Put the relevant code from your application that caused the issue to happen in the code block below
What is the output of
Get-PrtgClient -Diagnostic
?N/A?
Additional context
The object in question has two Down state triggers plus another inherited one. More importantly, it seems, the name of the NotificationAction for one of the triggers exists twice in PRTG's master list of NotificationActions.
Having two NotificationActions with the same exact name appears to be the result of a bug in our code, and the silver lining here is that this PrtgAPI bug helped us catch our bug. We're fixing our code to stop creating duplicates, so I don't consider the PrtgAPI bug to be high priority.
The text was updated successfully, but these errors were encountered: