This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Orion SDK: Object reference not set to an instance of an object when executing Groups.ps1

Greetings Thwack!

On the github page there is a sample script that serves as an example for adding groups to Orion: OrionSDK/Groups.ps1 at master · solarwinds/OrionSDK · GitHub

When I try running that script as a test (with only editing the connection details) I get the following error:

Invoke-SwisVerb : Object reference not set to an instance of an object.

At D:\OrionScripts\Dependencies.ps1:35 char:13

+ $groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1

+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Invoke-SwisVerb : Object reference not set to an instance of an object.

At D:\OrionScripts\Dependencies.ps1:74 char:1

+ Invoke-SwisVerb $swis "Orion.Container" "AddDefinition" @(

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1

+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Peculiar! Another thread on thwack Need help trying to add a node to a group container using Perl  recommended looking into the Information Services logs. I've attached the latest output from that log to this question. Sadly my own Orion-Fu isn't quite enough to decipher the XML to see what went wrong, or if I need go deeper.

Currently running NPM 12.01. The script runs a-okay on a testing instance of Orion, but not in our prod environment.

Message was edited by: Ryan Richter - Adding second InformationService.txt log

attachments.zip
  • Hello,

    Script if working for me too. I think this issue is environment releated.

    Following can narrow the problem down:

    1) under which user do you run script in PROD? Is it admin account or some specific account (e.g. with limitations, windows account)

    2) Are you able to create containers and add dynamic definitions in Web UI under same account?

    3) Could you please increase log level of Information Service using LogAdjuster to DEBUG level, run the script and send log files? Provided logs are unfortunately not detailed enough to find some useful information there.

  • So I reran the script as Admin and it added the groups successfully. For my purposes this works, as I now have hundreds of dependency groups to go create. For reference, I can create groups and dependencies in the Web UI, but with what I'd need to do it'd be way too time consuming.

    I've attached the InformationService log from my last attempt to run the script using my regular active directory account if any of the Orion SDK gurus want to dive deeper.

    I owe you a beer! Or whatever your drink of choice would be.

  • I'm happy it helps :-).

    I checked new log and looked into implementation and it seems that we have a bug in the product. Container verbs (CreateContainer, AddDefinition) do not run under Windows account.

    Workaround is to run script under Orion account until this will be fixed.

    edit: typo