Troubleshoot error codes

This page describes some common error codes that you might encounter while usingthe Directory API.

503 Service unavailable

While using thenextPageToken method to retrieve a large list of users ordevices, you might encounter this error if the request takes longer than 60minutes. This error is due to a limitation of the Directory API.

The following is the full error response:

{  "error": {    "code": 503,    "message": "Service unavailable. Please try again",    "errors": [      {        "message": "Service unavailable. Please try again",        "domain": "global",        "reason": "backendError"      }    ]  }}

To avoid this error, you can reduce the number of devices or users by queryingwith filters so that the individual operations don't take over an hour tocomplete. This approach requires multiple queries. For more information, seeSearch for devices.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.