Cannot Open the config.ini File During Operator Calling

Symptom

After the custom operator package (OPP) is installed and deployed, the following error message is displayed when the deployed operator is called, indicating that the JSON file fails to be obtained:

1
2
3
[INFO] Start get path and read binary_info_config.json.
[WARNING] Get jsonfile path for */binary_info_config.json failed, errmsg:No such file or directory.
[ERROR] Get path and read binary_info_config.json failed, please check if the opp_kernel package is installed!

According to the preceding error message, the JSON file fails to be obtained because the config.ini file cannot be opened in the preprocessing. The following information is displayed:

1
2
3
[INFO] Start to get opp kernel base path, default custom opp kernel is in ASCEND_OPP_PATH.
[INFO] The real path of config.ini is */opp/vendors/config.ini.
[WARNING]  Can not open file: */opp/vendors/config.ini.

Cause Analysis

The root cause is that the user who calls the operator does not have the read permission on the config.ini (*/opp/vendors/config.ini) file in the OPP deployment directory. The default permission on the config.ini file is 640, which can be accessed only by the deployment user and users in the same group. The current running user is not in the same group as the installation user and does not have the read permission. As a result, the operator fails to be called.

For example, an error is reported when an operator is called in the following scenario: The root user installs and deploys the custom OPP, and a user in the HwHiAiUser group calls the deployed custom operator.

Solution

Contact the CANN package installation user to change the permission on the config.ini file to 644.
1
chmod 644 config.ini