0

We have a cluster with 3 servers with Load Balancer in front (CloudFlare). Things worked well when we had 2 servers (A & B) in the cluster but after we added a 3-rd server (C) we noticed few odd things.

One of them is quite important and I do not understand how it happens at all.

Our web application makes AJAX requests to itself in order to get some JSON data back and if requests hit new server (C) response looks like that:

{
code: 404,
text: "Not Found",
message: "Database context not allowed."
}

Our application does not throw such error and so I searched in google a bit and noticed that it's mentioned on: OpenNTF XPagesExtensionLibrary

However, we do not use XPages at all so I wonder how could it be that our AJAX requests somehow involve that logic.

Any suggestion & tip would be appreciated.

UPDATE

The backend code of my agent is not important (it could be also an empty agent, I checked), because the request does not come to my agent.

The AJAX call is triggered by jQuery

let url = "domain.tld/api/key";
let params = {"a": 1};
$.post(url, params, function (data) {
  // some code
},
"json"
).always(function() {
  // some code
});

The URL, which I suspect is an issue starts with /api/key and I believe it's an issue (because all other ajax calls where endpoint do not start from /api/ work well).

Thanks.

Dmytro Pastovenskyi
  • 5,240
  • 5
  • 37
  • 56
  • 1
    Can you show the code - server-side, plus what your client-side request looks like - for your AJAX request? – Richard Schwartz Jul 28 '21 at 20:37
  • 1
    What Richard said: Show the code. But I think that response is coming from the Domino Access Services data API. Is your client sending requests for URLs with `/api/data` in the path? (Btw, Domino Access Services is included in the XPages extension library. It's not really XPages, but that's why Google sent you there.) – Dave Delay Jul 30 '21 at 23:26
  • @DaveDelay > Is your client sending requests for URLs with /api/data in the path? Yes, the request looks like this: domain.com/api/xxx. Is an /API/ predefined thing? – Dmytro Pastovenskyi Aug 01 '21 at 00:09
  • 1
    @richardSchwartz - I have updated the post, but now I suspect it's because my URL starts with /api/ – Dmytro Pastovenskyi Aug 01 '21 at 00:15
  • 1
    Yes. The DAS servlet handles all requests that start with `/api`. But the original post said the same request works on the other two servers in the cluster. I don't know why that would be true. Are all three servers the same version of Domino? Also, what server component should be handling the `/api/key` request? – Dave Delay Aug 01 '21 at 20:36
  • @DaveDelay > But the original post said the same request works on the other two servers in the cluster. the XPages task was shut down on 2 other servers, so now things look clear to me. Big Thanks to both of you guys. – Dmytro Pastovenskyi Aug 02 '21 at 09:24
  • /api/key suppose to trigger an agent. – Dmytro Pastovenskyi Aug 02 '21 at 09:27

1 Answers1

1

Figured that our with help from comments (which you can see under my original post).

Apparently there is DAS servlet that handles all requests starting from /api/* and it runs if XPages engine is loaded. In my case the 2 servers out of 3 have XPages shut down so the issue happened only on 1 server.

The solution would be:

  1. Shut down XPages (or find a way to shut down DAS).
  2. Alternatively change a URL from /api/path to something else (this is what we will do).
Dmytro Pastovenskyi
  • 5,240
  • 5
  • 37
  • 56
  • Now that makes sense. Unfortunately, it is true that `/api/*` is reserved by the DAS servlet when XPages is running. Glad you decided to go with option #2. – Dave Delay Aug 03 '21 at 23:20