My Oracle Support Banner

OUD 12c REST API Timeout Error: HTTP 503 Service Unavailable Error (Doc ID 2880761.1)

Last updated on APRIL 19, 2023

Applies to:

Oracle Unified Directory - Version 12.2.1.4.0 and later
Information in this document applies to any platform.

Symptoms

Oracle Unified Directory (12c) using REST API.

Unable to retrieve a larger resultset for the OUD REST API because the OUD API sends a response as 503 Service Unavailable:

HTTP ERROR 503

Problem accessing /rest/v1/directory. Reason:

  Service Unavailable

Powered by Jetty:// 9.4.14.v20181114


The user performing the REST API search has been granted access to search and retrieve ~300k users, while the result set is ~200k. There are about ~200K users in OUD matching the search filter.

The LDAP based command line search takes about 145 seconds to return all records with the required attributes.

However, when performing the same search with the user-search REST API, the API times out after 30 seconds and sends an HTTP 503 "Service Unavailable" message.

Since the result-set is large, looking to increase the API waiting time / response timeout value for the OUD REST APIs to a value higher than 30 seconds.

Already reviewed the "timeLimit" query parameter in the documentation:

REST API for Oracle Unified Directory Data Management E98017-02
Section View the Directory Entries

Section Find OUD entries

But it is a timelimit set by the client, and it states that if this attribute is not sent: "If this is not provided, no time limit is imposed by the client."
Tried by setting a value like 900, 9000000, and even without setting a value.
But still the API times out after 30 seconds.

Have no problem in the OUD out-of-the-box API taking more than 30 seconds, so no tuning in needed. Simply need to increase the OUD's default API timeout value so that the backend Jetty server does not close the server after 30 seconds.

Also already reviewed:

Oracle® Fusion Middleware Configuration Reference for Oracle Unified Directory 12c (12.2.1.4.0)
REST Web Service Extension
Item Advanced Properties: filter-max-results

REST Server Extension
Item Advanced Properties: lock-timeout

The access log shows:

...
[01/Feb/2022:20:02:57 -0500] SEARCH RES conn=23 op=1 msgID=2 result=11 message="An unexpected error was encountered while processing a search in one of the Directory Server backends:
NullPointerException(HTTPClientConnection.java:483) Client Unbind" nentries=162371 etime=29961
...

The server.out shows:

...
Feb 01, 2022 8:02:58 PM org.glassfish.jersey.server.ServerRuntime$Responder writeResponse
SEVERE: Error while closing the output stream in order to commit response.
java.lang.IllegalStateException: WRITER
 at org.eclipse.jetty.server.Response.getOutputStream(Response.java:715)
 at org.glassfish.jersey.servlet.internal.ResponseWriter.writeResponseStatusAndHeaders(ResponseWriter.java:180)
 at org.glassfish.jersey.server.ServerRuntime$Responder$1.getOutputStream(ServerRuntime.java:701)
 at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200)
 at org.glassfish.jersey.message.internal.CommittingOutputStream.flushBuffer(CommittingOutputStream.java:305)
 at org.glassfish.jersey.message.internal.CommittingOutputStream.commit(CommittingOutputStream.java:261)
 at org.glassfish.jersey.message.internal.CommittingOutputStream.close(CommittingOutputStream.java:276)
......
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
 at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
 at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781)
 at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)
 at java.lang.Thread.run(Thread.java:748)

found httpOp as null for message id null
...

 

Another scenario:

Running Postman Get to list all the user entries, for example:

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.