After an upgrade of a very old app to APEX 20.2, everything works surprisingly well except for a few pages where all buttons and LOVs throw one of two errors when calling WWV_FLOW_DYNAMIC_EXEC.PARSE_AS_USER:
Could not validate caller for user "" when parsing
select select 1
from TD_PNART
could not validate env for schema "APEX_PUBLIC_USER":context=, parse_as_schema=,
parse_as_schema_override=,sgid=, curr_flow_sgid=994328456202381, flow_id=220,when parsing
I've tried everything from updating the authorization scheme, searching every piece of SQL for something that could have expired the schema user, recreating the object, revalidating ORDS, etc. but the error appears each time and SQL Trace/APEX Trace doesn't provide further information. I can't find the issue on Google or Oracle Support either.
How can I diagnose an internal error such as this?
- error_backtrace: ----- PL/SQL Call Stack -----
object line object
handle number name
0x6d5e0d58 947 package body APEX_200200.WWV_FLOW_ERROR.INTERNAL_GET_ERROR
0x6d5e0d58 1015 package body APEX_200200.WWV_FLOW_ERROR.INTERNAL_ADD_ERROR
0x6d5e0d58 1407 package body APEX_200200.WWV_FLOW_ERROR.RAISE_INTERNAL_ERROR
0x6d5e0d58 1488 package body APEX_200200.WWV_FLOW_ERROR.RAISE_MASKED_INTERNAL_ERROR
0x825ab978 521 package body SYS.WWV_DBMS_SQL_APEX_200200.PARSE_AS_USER
0x73579878 1698 package body APEX_200200.WWV_FLOW_DYNAMIC_EXEC.PARSE_AS_USER
0x73579878 2378 package body APEX_200200.WWV_FLOW_DYNAMIC_EXEC.SELECT_INTO_I
0x73579878 2459 package body APEX_200200.WWV_FLOW_DYNAMIC_EXEC.SELECT_NUM
0x73579878 1263 package body APEX_200200.WWV_FLOW_DYNAMIC_EXEC.DO_ROWS_EXIST
0x8239fac8 290 package body APEX_200200.WWV_FLOW_CONDITIONS.STANDARD_CONDITION
0x851816e0 71 package body APEX_200200.WWV_FLOW_META_UTIL.IS_OK_TO_DISPLAY
An engineer at Oracle was able to solve this issue, which had a completely unexpected solution: