My Oracle Support Banner

APEX Report 500 Internal Server Error / ORA-22921 Error (Doc ID 2748631.1)

Last updated on FEBRUARY 01, 2021

Applies to:

Oracle Application Express (APEX) - Version 19.2 and later
Information in this document applies to any platform.

Symptoms

APEX application has a classic report based on a very complex sql query. When selecting 'Download to Excel', the APEX report returns "500 Internal Server Error".
ORDS log shows ORA-22921: length of input buffer is smaller than amount requested

...
SEVERE: java.sql.SQLException: ORA-22921: length of input buffer is smaller than amount requested
ORA-06512: at "SYS.DBMS_LOB", line 1163
ORA-06512: at line 20

InternalServerException [statusCode=500, reasons=[]]
at oracle.dbtools.apex.ModApexContext.handleError(ModApexContext.java:288)
at oracle.dbtools.apex.OWA.getPage(OWA.java:253)
at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:312)
at oracle.dbtools.apex.ModApex.doGet(ModApex.java:147)
at oracle.dbtools.apex.ModApex.service(ModApex.java:110)
at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(Dispatcher.java:143)
...
...

Issue happens with accented characters.
One of the end users has a special character in her name (ñ) and if they use a replace statement to substitute it out, the report works.

For example this works:
select replace(CONVERT(description, 'US7ASCII', 'AL32UTF8'),'?') from my_table
where col1 in ( 1764,1920) and col2 = 109.15

And this doesn't work:
select description from my_table
where col1 in ( 1764,1920) and col2 = 109.15

 

NOTE: The example(s) provided are for demonstration purposes only and represents fictitious data. Any similarity to actual data, web sites and / or persons, living or dead, is purely coincidental and not intended in any manner.

 

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
Cause
Solution


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