REST 2.0: Intermittent 403 Forbidden

This is so bizarre that I feel it must be something on my end, but I don’t have a clue what it might be.

For testing, I created a loop that iterates five times. It does a GET on the same URL, token, etc. I get different results every time I run it. Sometimes, it will successfully return user data, while others it returns a 403. I put a one second delay between each request, but that didn’t seem to have an effect on the results. The user that I’m looking up is different from the user token that I’m using in the API. I can understand if there aren’t privileges for this lookup, but I don’t understand the inconsistency.

Any idea on why a token would react this way? Is the 403 telling me something other than an ACL problem? I know that an invalid token will correctly generate a 401 Unauthorized, so my token appears to be accepted.

Here is the error that I receive:

Error: 403 Forbidden from http://localhost/rt/REST/2.0/user/carl: {“message”:“Forbidden”} at t/20-object.t line 100.

And here is when it succeeds:

GET http://localhost/rt/REST/2.0/user/carl
Authorization: token
User-Agent: libwww-perl/6.15

{
“Privileged” : 1,
“id” : “27”,
“EmailAddress” : “”,
“Created” : “2018-02-03T00:27:00Z”,
“WorkPhone” : “”,
“Creator” : {
“_url” : “http://localhost/rt/REST/2.0/user/root”,
“id” : “root”,
“type” : “user”
},
“LastUpdatedBy” : {
“_url” : “http://localhost/rt/REST/2.0/user/carl”,
“id” : “carl”,
“type” : “user”
},
“MobilePhone” : “”,
“AuthToken” : “”,
“Lang” : “”,
“Country” : “”,
“_hyperlinks” : [
{
“_url” : “http://localhost/rt/REST/2.0/user/27”,
“id” : “27”,
“ref” : “self”,
“type” : “user”
},
{
“_url” : “http://localhost/rt/REST/2.0/user/27/history”,
“ref” : “history”
}
],
“HomePhone” : “”,
“PagerPhone” : “”,
“Organization” : “”,
“Gecos” : “carl”,
“Zip” : “”,
“City” : “”,
“Disabled” : “0”,
“Comments” : “”,
“RealName” : “Carl Carstenson”,
“CustomFields” : {},
“NickName” : “”,
“FreeformContactInfo” : “”,
“Address1” : “”,
“Timezone” : “”,
“Address2” : “”,
“LastUpdated” : “2018-02-19T15:11:47Z”,
“State” : “”,
“Name” : “carl”
}

SOLVED: It turns out a good old Apache reload fixed this problem. I must have had a broken process out there.