FAQs

  1. During inference service startup or certificate import script execution, the KMC initialization random number is blocked but no error is reported. The problem can be resolved after a period of time. The block status is as follows:
    Error 1
    level:3, msg:b"M:WSEC_CBB-F:-L:72(UTC) 2021-06-21 02:09:24 WsecRegFuncEx success\n"
    level:3, msg:b"init kmc with role master"
    level:3, msg:b"create process lock for 538318102"
    level:3, msg:b"get sem 0"
    level:3, msg:b"M:WSEC_CBB-F:-L:101:(UTC) 2021-06-21 02:09:24 WSEC locks initialized successful.\n"
    
    Error 2
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'M:WSEC_CBB-F:-L:196:(UTC) 2022-02-10 08:28:11 Mask initialize failed 1.\n'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'M:WSEC_CBB-F:-L:216:(UTC) 2022-02-10 08:28:11 KmcInitializeEx failed 601, Finalize ret 0.\n'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'M:WSEC_CBB-F:-L:55:(UTC) 2022-02-10 08:28:11 WSEC initialize failed.\n'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'WSEC_InitializeEx failed, ret=601'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'failed to convert error code 601'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'init error code 601'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'M:WSEC_CBB-F:-L:87:(UTC) 2022-02-10 08:28:11 KMC not running.\n'
    INFO 2022-02-10 16:28:11 [kmc.py:72] level:1, msg:b'M:WSEC_CBB-F:-L:68:(UTC) 2022-02-10 08:28:11 KmcCheckKmcCtx fail 155\n'
    INFO 2022-02-10 16:28:11 [kmc.py:260] KeInitialize ret=601
    ERROR 2022-02-10 16:28:11 [kmc.py:262] KeInitialized Failed. ret=601
    close alarm signal.
    ERROR 2022-02-10 16:28:11 [ai_server.py:275] kmc init error.
    ERROR 2022-02-10 16:28:11 [ai_server.py:360] ERROR: kmc init failed!
    ERROR 2022-02-10 16:28:11 [ai_server.py:361] ai_server startup failed.
    • Cause analysis: Random numbers generated by /dev/random are blocked.
    • Solution: Add the haveged service to solve the random number blocking problem. For Ubuntu, run the apt-get install -y haveged command.
    • Suggestion: If the KMC initialization fails, install the haveged service first.
  2. When the inference service is started, the following problems may occur:
    Traceback (most recent call last):  File "service/main.py", line 10, in <module>import ai_server  File "/home/mxAOIService/service/ai_server.py", line 37, in <module>from model_infer_api import ModelInference  File "/home/mxAOIService/service/model_infer_api.py", line 18, in <module>from StreamManagerApi import StreamManagerApi, MxDataInput, RoiBox, RoiBoxVector  File "/home/mxManufacture/python/StreamManagerApi.py", line 17, in <module>import _StreamManagerApiImportError: libstreammanager.so: cannot open shared object file: No such file or directory
    • Cause analysis: The SDK library is not imported to the current environment variable LD_LIBRARY_PATH.
    • Solution: After installing the SDK, go to the SDK installation path and run the following command to make the environment variables of the MindX SDK take effect:
      .  set_env.sh

      Use the actual SDK installation path.

  3. After the inference service is started successfully, the following problems may occur when it is invoked:
    ERROR : Failed getting result with error code [6010], and message [Time out, can not get result in time.]
    • Cause analysis: The inference service times out to obtain the inference result. The default duration is 5 seconds.
    • Solution: You can increase the timeout interval for obtaining the inference result by configuring the following fields in the config.yaml file.
      # Set get model result maximum timeout, default 5000ms.
      get_result_timeout: 5000
  4. When you execute the certificate import script /tools/cert_importer.py, working key update script check_and_update_master_key.py, and root key update script update_root_key.py, the following errors may occur:
    process encrypt begin.
    level:1, msg:b'get sem errno = 13'
    level:1, msg:b'Failed to CreateSem'
    level:1, msg:b'M:WSEC_CBB-F:-L:98:(UTC) 2021-07-26 03:42:19 WsecInitializeLock failed with 1.\n'
    level:1, msg:b'WSEC_InitializeEx failed, ret=1'
    level:1, msg:b'init error code 2001'
    KeInitialize ret=2001
    kmc init error.
    • Cause analysis: The default permission of the KMC key file lock semaphore is 600, and the owner of running KMC is the root user or other users. A non-root user has no permission to access the semaphore created by the root user. As a result, the non-root user cannot access the file lock semaphore (errno=13).
    • Solution: Delete the semaphore created by the user. Run the ipcs -s command to check the semaphore.
      ------ Semaphore Arrays --------
      key        semid      owner      perms      nsems
      0x00105b6b 65536      root       600        1
      0x00105b6c 98305      root       666        1
      0x20161516 524290     root       600        1

      Run the ipcrm command to delete the semaphore (0x2016****) created by the root user:

      ipcrm -s 524290             # Delete the semaphore by entering semid.