1 Reply Latest reply on Jan 13, 2017 4:49 AM by tomas.vrabel

    CreateLimitation not working

    jorgdc

      Hi,

       

      For internal use i have created a gui where my colleagues can create accounts and assign groups of nodes to that account without having to login via the admin panel.
      This has been in use for roughly a year now, but recently, as in today, a issue has come up where the create limitation function called via rest suddenly stopped working correctly.

       

      Example of the data for the rest call :

       

                  $action = 'https://exampleserverip:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Limitations/CreateLimitation';

                  $data = [18, null, [$assignmentId], null, $accountId];

       

       

      This creates a group of groups limitation for a specified account.

      When i check on the admin panel is see that under the account the limitation gets correctly created. But when i login with the created user all the nodes are visible.

      When i simply edit and save the limitation via the admin panel without changing anything the account can only see the nodes that are in the limitation.

      I know that there is a delay when creating the limitation via rest before the changes applies, but my colleagues made a account before lunch and when they returned the limitation was still not applied

       

      The strange thing is that deletelimitation and updatelimition both work fine.

       

      I'm a bit stuck now so i don't know if anyone has a idea what the issue may be?

        • Re: CreateLimitation not working
          tomas.vrabel

          Hello,

          At first, could you please provide your list of installed products and theirs versions?

          I tried to reproduce your issue and LimitationTypeID=18 is "Single group" limitation type in my environment, not group of groups. GroupOfGroups has LimitationTypeID=19. (see table LimitationTypes in OrionDB)

           

           

          When new limitation is created it triggers recalculation of limitation snapshot but seems not to be true in your environment so we should narrow down the problem.

          I put together steps that should help us to narrow the problem down:

          1. set log level to TRACE for SWIS using SolarWinds Log Adjuster. TRACE level generates quite a big amount of log data so please put log levels back to your original level when finished with investigation.

          2. create limitation using your script and note new ID of limitaton down. Let's say it's 100 in instructions below so replace 100 with your limitationID

          3. check that limitationID was added to account in OrionDB table Accounts (LimitationID1, LimitationID2 or LimitationID3 columns) for specified accountID

          4. check that limitationID was inserted into OrionDB table [Limitations]. New row with LimitationID=100 should be visible

          5. check that limitation snapshot was re-calculated - check OrionDB table [LimitationSnapshots], there should be rows with LimitationID=100

           

           

          As you mentioned, new limitation is not reflected in your environment so check in step 5) will not be successful. Limitation snaphot is evaluated based on limitations and is used to limit visible set of objects

          for limited accounts.

          Let's investigate in SWIS log files what happened. SWIS log files are by default in following location: c:\ProgramData\Solarwinds\InformationService\v3.0 and should be set to TRACE level.

           

          1. Try to find following string in SWIS log files: "Refresh Limitation 100 via Orion.Limitations System.InstanceCreated" (replace 100 with your limitationID)

          If you find this message it indicates that limitation creation message was received by subscriber and limitation snaphost recalculation will be triggered

           

          Example log message:

          2017-01-13 11:15:20,298 [5] DEBUG SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationChangeSubscriber - (null) (null)  Refresh Limitation 100 via Orion.Limitations System.InstanceCreated

           

           

          2. Try to find following message in SWIS log files: "Refresh Limitation Snapshot (" (include left bracket in the end, this will filter out not interesting log messages)

          This log message indicates that limitation snapshot is being recalculated. Log message should contain limitationID of recalculated limitations - 100 in our case.

           

          Example log message:

          2017-01-13 11:15:20,299 [5] TRACE SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationSnapshotService - (null) (null)  Refresh Limitation Snapshot (1) {Limitation[ID=100](LimitationType[ID=19,Table=Orion.Groups,Field=ContainerID,Entity=Orion.Groups,Method=1,IsSwis=1,IsGroup=1])}

           

           

          3 Try to find any error or warning messages from classes that are responsible for limitation recalculation. Interesting log messages contain:

            WARN SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationSnapshotService

            ERROR SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationSnapshotService

            WARN SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationChangeSubscriber

            ERROR SolarWinds.Data.Providers.Orion.Containers.LimitationSnapshotService.LimitationChangeSubscriber

           

          Please try suggested steps and let us know which one failed and if mentioned log messages were find.

           

          I have one additional questions: When do you observe mentioned issue - is it related with heavy pressure on the system or also right after restart? Is it related to some specific group/container?

           

          Thank you

          Tomas