Troubleshooting Oracle REST Data Services

This information on troubleshooting Oracle REST Data Services.

Enabling Detailed Request Error Messages

To enable detailed request error messages, run the following command:

ords config set debug.printDebugToScreen true

Requests that produces an error response includes a detailed message, including a stack trace. This setting must not be enabled on production systems due to the risk of sensitive information being revealed to an attacker.

HTTP 5xx (server error) status codes can suppress stack trace details in the response body by default to avoid exposing sensitive information. This includes errors mapped from internal server exceptions, service unavailability, and database-related failures. Depending on the specific error and its associated mapping, ORDS may return limited diagnostic information or only a generic error message, even when detailed error output is enabled.

Note:

See Also:

Schema Level Configuration Override

ORDS User Defined Service

The following table lists the ORDS user defined services:

Table 1 List of ORDS user defined

Service Response

--HTTP 200 BEGIN ORDS.define_service( p_module_name => 'test1', p_base_path => 'test1/', p_pattern => 'ok/', p_method => 'GET', p_source_type => ORDS.source_type_collection_feed, p_source => 'SELECT * FROM dual', p_items_per_page => 0); COMMIT; END; /

>curl -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test1/ok/ HTTP/1.1 200 OK Date: Thu, 19 Mar 2020 17:18:05 GMT  Content-Type: application/json ETag: "BLNTmyd/ZM889Q0GlgJ1t7lkSYo2kpAVIv4CY5dvtp9NI/Em1DJRzpmE5Bg/4GiKifewtzuJA6i+YCgdxETWWQ==" Transfer-Encoding: chunked 

--HTTP 200 , p_source_type => ORDS.source_type_collection_feed, BEGIN ORDS.define_service(  p_module_name => 'test2',  p_base_path => 'test2/',  p_pattern => 'norows/',  p_method => 'GET',  p_source_type => ORDS.source_type_collection_feed,  p_source => 'SELECT * FROM dual where 1 = 2', p_items_per_page => 0);  COMMIT;  END;  /

>curl --head -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test2/norows/ HTTP/1.1 200 OK Date: Thu, 19 Mar 2020 17:18:28 GMT Content-Type: application/json ETag: "aZVsHTwewrbbkl6wHNcTa3RFFdEsbdtDRBTSlR93r/vBmDvVsgud2rFqLDI65UKxzSElnAAMQdlBj/sB9ywWqQ==" Transfer-Encoding: chunked

 create table no_rows (col1 int);  --HTTP 200 , p_source_type => ORDS.source_type_collection_feed,  BEGIN ORDS.define_service(  p_module_name => 'test2b',  p_base_path => 'test2b/', p_pattern => 'norows/',  p_method => 'GET',  p_source_type => ORDS.source_type_collection_feed,  p_source => 'SELECT * FROM no_rows', p_items_per_page => 0);  COMMIT;  END;  / 

 >curl --head -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test2b/norows/ HTTP/1.1 200 OK Date: Thu, 19 Mar 2020 17:18:34 GMT Content-Type: application/json ETag: "Ns/g/hFxVWYPHUyZT53HNl6EMVlQUXD5wmz3eoO15dlY6nSVkk2FX3sNw3Yvq87SdLYAlCLeuqb4N4DQrcy+0Q==" Transfer-Encoding: chunked 

--HTTP 404 , p_source_type => ORDS.source_type_collection_item,  BEGIN ORDS.define_service(  p_module_name => 'test2c',  p_base_path => 'test2c/',  p_pattern => 'norows/', p_method => 'GET',  p_source_type => ORDS.source_type_collection_item,  p_source => 'SELECT * FROM dual where 1 = 2',  p_items_per_page => 0);  COMMIT;  END;  / 

>curl --head -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test2c/norows/ HTTP/1.1 404 Not Found Content-Type: text/html Content-Length: 16127 

--HTTP 404  BEGIN ORDS.define_service(  p_module_name => 'test3',  p_base_path => 'test3/',  p_pattern => 'doesnotexist/',  p_method => 'GET',  p_source_type => ORDS.source_type_collection_feed,  p_source => 'SELECT 10 as A FROM doesnotexist',  p_items_per_page => 0);  COMMIT;  END;  / 

>curl --head -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test3/doesnotexist/ HTTP/1.1 403 Forbidden Content-Type: text/html Error-Reason: error="missing.object"; error_description*=UTF-8' 'The request could not be processed because a table or view referenced 0by the SQL statement being evaluated is not accessible or does not exist Content-Length: 16327 

--HTTP 555  BEGIN ORDS.define_service( p_module_name => 'test4',  p_base_path => 'test4/',  p_pattern => 'badsyntax/',  p_method => 'GET',  p_source_type => ORDS.source_type_collection_feed,  p_source => 'SELECT 10',  p_items_per_page => 0);  COMMIT;  END;  / 

>curl --head -i -X GET --user DEMO:demo -k http://localhost:8082/ords/demo/test4/badsyntax/ HTTP/1.1 500 Server Error Content-Type: text/html Error-Reason: error="resource.generator.evaluation"; error_description*=UTF-8' 'The request could not be processed because an error occurred whilst attempting to evaluate the SQL statement associated with this resource. Please check the SQL statement is correctly formed and executes without error.  SQL Error Code ORA-00923 FROM keyword not found where expected Error Message. Content-Length: 16514 

Configuring Oracle APEX Static Resources with Oracle REST Data Services

When using Oracle REST Data Services, a blank page might be displayed when attempting to access an Oracle APEX page, for example, when attempting to display https://example/ords/apex. This problem is caused by an improper configuration of Oracle APEX static resources, which causes the JavaScript and CSS resources required by APEX not to be found and the APEX page not to render correctly.

The specific cause can be any of the following:

To help in diagnosing the problem, you can try to access the apex_version.txt file. For example, if your APEX deployment is located at https://example.com/ords/ and your static resources have been deployed at https://example.com/i/, use a browser to access the following URL:

https://example.com/i/apex_version.txt

If you get a 404 Not Found error, then check the preceding list of possible specific causes.

If a plain text file is displayed, it should contain text like the following:

Oracle APEX Version:  24.1

Check that the version number matches the version of APEX that is deployed on the database. If the numbers do not match, check if you have made an error mentioned in the last item in the preceding list of possible specific causes, because Oracle REST Data Services is not configured to use the correct version of the APEX static resources to match the APEX version in the database.

It is recommended that you configure the Oracle APEX instance wherever applicable to use the resources from the Oracle Content Network. The use of the Oracle CDN may not be feasible when using Oracle APEX in a network that restricts internet access. In such a scenario, you must deploy a web application to provide the Oracle APEX image files.

If you need help in solving the problem, check the information in this book about creating and deploying i.war for your environment, such as WebLogic Server.

Resolving 570 Server Error Response Code

This section provides the steps to resolve a 570 Server Error Response code.

This issue is commonly encountered during an upgrade or repair when the ORDS_PUBLIC_USER password has been changed. When ORDS starts, it attempts to connect to the target database using the credentials stored in the associated Wallet (.SSO file).

If the wallet password does not match the database password, ORDS attempts to login three times. Repeated failures locks the account. Perform the following steps to resolve this issue:

Perform the following steps to resolve this issue:

  1. Stop the affected ORDS instance/process.

  2. Unlock the ORDS_PUBLIC_USER account using the following command:

    alter user ORDS_PUBLIC_USER unlock;
    1. Verify the account status using the following command:

      select username, account_status from dba_users where
      username ='ORDS_PUBLIC_USER';
  3. You can either change or update the ORDS_PUBLIC_USER password (to match the current database password) or verify the password that is stored in the ORDS Wallet (.SSO file).

    • To change the ORDS_PUBLIC_USER password, use the following command:

      ords --config <PATH TO ORDS CONFIG> config secret db.password
    • To verify the password, use the following command:

      ords --config <PATH TO ORDS CONFIG> config get --secret db.password
  4. If you change the password in the .SSO wallet, restart your shell or terminal session and then retry the upgrade or repair:

    ords --config <Path to your ORDS configuration folder> install

    When prompted, choose the database pool associated with the mismatched wallet password. Note: During installation, the ORDS installer updates the database password if it detects a difference in the password.