Skip to content

Misleading HTTP 403 responses when bulk.limits.max.targets-per-flat-request is exceeded #7997

@nicolapace

Description

@nicolapace

We would like to report what appears to be misleading HTTP status codes returned by dCache when the bulk request size exceeds the configured limit (bulk.limits.max.targets-per-flat-request).

Description

When the number of targets in a bulk request exceeds the configured limit, dCache replies with HTTP 403 – Forbidden. This is extremely confusing for clients, as it strongly suggests an authorization or permission problem, while the real cause is a request size / server-side limit.

We recently spent a significant amount of time debugging permissions, credentials, and authorizations before discovering that the real issue was simply that the request exceeded the configured bulk limit.

Concrete example (IN2P3 tape staging)

During a CMS mini-data challenge, FTS was staging files from tape at CCIN2P3 using the dCache Tape REST API. We observed many failures in FTS with errors like:

STAGING [1] [Tape REST API] Stage call failed: HTTP 403 : Permission refused

Key things:

  • Errors did not appear in dCache logs visible to the site operators.
  • The site initially could not find any trace of the failing requests.
  • The error message strongly suggested an authorization issue, which turned out to be incorrect.

The root cause was later identified as follows:

  • The site was using the default value of
    bulk.limits.max.targets-per-flat-request = 500
  • The FTS instance is configured to submit up to 2000 in a single bulk request.
  • When the limit was exceeded, dCache returned HTTP 403.
  • After increasing the limit to 2000, the errors immediately disappeared.

The problem

Returning 403 Forbidden in this case is misleading because:

  • The client is authorized.
  • The request is syntactically valid.
  • The failure is due to request size / server configuration limits, not permissions.

Suggested improvement

When the bulk request exceeds bulk.limits.max.targets-per-flat-request, dCache should return a more appropriate HTTP status code, for example:

Additionally, returning a clearer error message in the response body (explicitly stating that the bulk request exceeds the configured limit) would greatly improve debuggability.
This issue has occurred before at other sites as well, which suggests this is not site-specific but a general usability issue in dCache’s API behavior.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions