Background
After OBServer introduced the JNI framework as the bridge for connecting to external data lakes, you may encounter a number of issues related to environment initialization.
Issue 1: An error is reported when creating an HDFS/ODPS JNI external table
Error 1: ERROR 11056: JNI env could not be found
Cause
The JNI environment may fail to initialize for the following reasons:
ob_java_homeis set incorrectly, which prevents thelibjvm.sodynamic library from loading properly. This library is essential for initializing the environment and starting the JVM.ob_java_optsis set incorrectly. Because there are certain limitations in the integration between the CPP framework and the JNI framework, the relevant property parameters must be explicitly set to start the JVM process, so as to avoid various configuration issues. For parameter settings, see ob_java_opts.The
libhdfs.solibrary file that the JNI environment depends on (the communication bridge between OceanBase Database and the JVM) is placed in a path that does not match_ob_additional_lib_path. It must be set correctly.
Solution
Manually verify whether the current
java homesetting exists, and pay particular attention to whether the current user has access permissions to that path. It is possible thatjava homeexists but the user who starts OBServer does not have access permissions to that path.Check against ob_java_opts whether any required items in
ob_java_optsare missing.Check whether the path set in
_ob_additional_lib_pathexists and whether the user who starts OBServer has access permissions to that path.
Error 2: ERROR 11032: HDFS: path not found
Cause
The HDFS: path not found error usually occurs in the following scenarios:
In an HDFS environment with Kerberos authentication enabled, when accessing an HDFS external table, the -11032 error occurs if insufficient permissions prevent access.
If Kerberos authentication is configured correctly but HDFS: path not found still occurs, the external table path specified in the CREATE statement may be incorrect and point to a nonexistent path.
If the external table can be accessed normally at first but the 11032 error occurs after running queries for some time, a file under the HDFS path corresponding to the external table may have a bad block. That is, the HDFS DataNode reports that the data block is corrupted and cannot be accessed, which triggers the error.
Solution
Confirm that the Kerberos keytab and principal are valid and that the corresponding user has access permissions to the HDFS cluster. Reconfigure the external table permissions and set up Kerberos authentication.
Confirm that the corresponding HDFS path is correct and exists, and re-establish the HDFS path mapping for the external table.
Report the issue to the customer's O&M team. After confirming the bad block, you can choose to fix the bad block or switch to another environment to continue verification.
Error 3: ERROR 4016: Internal Error
Cause
An Internal Error may occur for the following reasons:
- An Internal Error occurs when running an external table query. This may be because the actual type set for the external table does not match the expected type. For example, mapping a
Stringcolumn to theInttype causes data conversion to fail for some fields. - Other unexpected program execution paths trigger the Internal Error.
Solution
Check whether the external table CREATE statement and the metadata type mapping of the corresponding external table data file are correct.
Check the related logs, capture the error log stack, and review and confirm the specific details that triggered the error.
