Rest api returns stale results

Has anyone ever seen an issue where calling the REST API with the “/query=relevance=blah” returns stale results? I’ve bounced the Root Server service and even restarted the Root server, but the call still returns old values (specifdally, i’m trying to return all fixlets with a name that contain “test”. WhenI login to the console as the same user as the one making the rest call, I can see the “test” task in the Console, but I get no results in the Rest API results.

Root server version 9.2.3.

It is my understanding that the REST API “/query” comes from WebReports, not the root server.

Investigate issues with your primary WebReports server. Make sure it is pulling data from the root on a regular enough basis.

Really? I didn’t know that. I did check WebReports and it it showing the desired fixlet, so I’m at a loss.

1 Like

If you try to use the REST API “/query” without a Web Reports server reachable from the root, then you get an error message saying no Web Reports server could be contacted or something like that.

All REST API calls go to the root, but at least in the case of /query it seems to get passed on to Web Reports. All other REST calls get processed by the root as far as I know.

I was getting results, but like I said, they were stale, Even a query like “number of bes computers” was returning an incorrect number that didn’t agree with the console.

Even now, my sample task shows up in WebReports > Explore Data > Content, but not in a crafted query "(name of it) of bes fixlets whose (name of it as lowercase contains “test”)…

1 Like

Do you have multiple Web Reports servers? Is there one that is not being used anymore, but still up?

I think the Root contacts a particular Web Reports server based upon settings on the root server. You can have multiple WebReports servers, but one in particular is used for REST API /query

I think it is in this analysis: https://bigfix.me/analysis/details/2994614

While we do have multiple webreports servers, this root server is pulling from its locally installed WR instance.

Is that the one you checked to make sure it’s data isn’t stale?

yes. the task shows in that WR content section, but still doesn’t appear in the query results.

Here’s another example of different results. I used the same Master Operator account when calling each command.

REST API:
https://root-server:52311/api/query?relevance=number%20of%20bes%20computers

<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="number of bes computers">
<Result>
<Answer type="integer">4628</Answer>
</Result>
<Evaluation>
<Time>0.974ms</Time>
<Plurality>Singular</Plurality>
</Evaluation>
</Query>
</BESAPI>

WR:

<?Relevance number of bes computers ?>

4473

1 Like

Well this is definitely weird.

I would recommend opening a PMR: How to ask for IBM product help: PMRs, RFEs, and more

I would provide a link to this post in the PMR as well as much info as you can about the issue.


I’d be curious if rebooting the root would do anything.

Were any updates applied recently?

How far off was the number of bes computers ? Was it 100’s? 1000’s?

I rebooted the root with no change. No recent updates applied that wasn’t applied on our other IEM deployment root servers. They were off by a couple hundred (which was because I deleted a bunch of inactive clients in order to get different computer counts). I edited my previous post to show the different results.

Yes, i’ll have to open a PMR I suppose. Will reply back with their findings.

thanks

Can you try running that query directly from web reports and compare the results?

To bring up web reports QNA:

Go to administration -> Scheduled Activities -> Create scheduled activity

Click “Test” under “Match Relevance conditions”

1 Like

Still different results. QnA in WR is right (agrees with the computer count in the console), but the Query results are old.

Q: number of bes computers
A: 4481

https://root-iem:52311/api/query?relevance=number%20of%20bes%20computers

<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<Query Resource="number of bes computers">
<Result>
<Answer type="integer">4628</Answer>
</Result>
<Evaluation>
<Time>0.954ms</Time>
<Plurality>Singular</Plurality>
</Evaluation>
</Query>
</BESAPI>
1 Like

That’s pretty strange. We do API queries very frequently and haven’t had any issues with stale data.

Maybe try restarting the root server services, including web reports and see if that helps.

This sounds potentially related: Webreports Caching Issues

Yes, it does. Good catch. I wish my forum.bigfix.com google search would have been smart enough to correlate “out-of’-date” with “stale” :smile:

1 Like

Well I got no progress on my issue, the only thing that seemed to correct anything for us was to reboot the WR server, so we just have an open action to reboot the server nightly. Not ideal.

Our next step is to try to install WR on a separate server and see if the co-location was causing some sort of lock. Will report back once we get some results from that.

1 Like