Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-3477

cds command executor fails with permission error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: High High
    • Istanbul Release
    • Honolulu Release, Istanbul Release, Honolulu Maintenance Release 1
    • cds
    • Windriver Lab

      During the recent testing done in windriver lab between policy & cds, it was found that cds command executor is failing with permission error during runtime execution of CBA.

      CDS version installed: nexus3.onap.org:10001/onap/ccsdk-commandexecutor:1.1.5

      Request

      {
        "actionIdentifiers": {
          "mode": "sync",
          "blueprintName": "controlloop-hostname-update",
          "blueprintVersion": "1.0.4",
          "actionName": "update-config"
        },
        "payload": {
          "update-config-request": {
            "hostname": "host",
            "IP": "10.43.230.146",
            "pnfName": "simple-cl-pnf"
          }
        },
        "commonHeader": {
          "subRequestId": "8c7935a4-79d8-4ec0-b661-dcca3cd68006",
          "requestId": "f392e439-c176-411b-b972-8acadac0f8df",
          "originatorId": "POLICY"
        }
      }
      

      Response

      {
          "correlationUUID": null,
          "commonHeader": {
              "timestamp": "2021-09-28T20:44:14.240Z",
              "originatorId": "POLICY",
              "requestId": "f392e439-c176-411b-b972-8acadac0f8df",
              "subRequestId": "8c7935a4-79d8-4ec0-b661-dcca3cd68006",
              "flags": null
          },
          "actionIdentifiers": {
              "blueprintName": "controlloop-hostname-update",
              "blueprintVersion": "1.0.4",
              "actionName": "update-config",
              "mode": "sync"
          },
          "status": {
              "code": 500,
              "eventType": "EVENT_COMPONENT_FAILURE",
              "timestamp": "2021-09-28T20:44:21.768Z",
              "errorMessage": "node(modify-config) outgoing edge(FAILURE) is missing.",
              "message": "failure"
          },
          "payload": {
              "update-config-response": {
                  "execute-command-logs": "[]",
                  "prepare-environment-logs": [
                      "",
                      "\n",
                      "WARNING: The directory '/home/onap/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\nERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/onap'\nCheck the permissions.\n\nWARNING: You are using pip version 20.1.1; however, version 21.2.4 is available.\nYou should consider upgrading via the '/opt/app/onap/blueprints/deploy/controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e/bin/python -m pip install --upgrade pip' command.\n"
                  ]
              }
          }
      }

      Command executor logs

      2021-09-28 20:44:14,680|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorServer|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Received prepareEnv request
      2021-09-28 20:44:14,681|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorServer|INFO|identifiers {
        blueprintName: "controlloop-hostname-update"
        blueprintVersion: "1.0.4"
        blueprintUUID: "eca23239-833a-4534-a596-5b10b790585e"
      }
      requestId: "f392e439-c176-411b-b972-8acadac0f8df"
      correlationId: "f392e439-c176-411b-b972-8acadac0f8df"
      packages {
        package: "requirements.txt"
      }
      timeOut: 120
      properties {
      }
      subRequestId: "8c7935a4-79d8-4ec0-b661-dcca3cd68006"
      originatorId: "POLICY"
      
      
      2021-09-28 20:44:14,681|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|CBA directory controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e exists on cmd-exec.
      2021-09-28 20:44:14,681|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Create Python Virtual Environment
      2021-09-28 20:44:19,452|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Creation of Python Virtual Environment finished.
      2021-09-28 20:44:19,452|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Activate Python Virtual Environment
      2021-09-28 20:44:19,458|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|Running with PATH : /opt/app/onap/blueprints/deploy/controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e/bin:/opt/app/onap/blueprints/deploy/controlloop-hostname-update/1.0.4/7ae84500-e446-48e1-9582-8bd866e754b7/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
      2021-09-28 20:44:19,459|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Install Python package(UTILITY) in Python Virtual Environment
      2021-09-28 20:44:19,468|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|install_python_packages UTILITY succeeded
      2021-09-28 20:44:19,468|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Install Python package(requirements.txt) in Python Virtual Environment
      2021-09-28 20:44:21,763|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorHandler|ERROR|install_python_packages requirements.txt failed
      2021-09-28 20:44:21,764|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorServer|INFO|controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e - Failed to prepare python environment. ERROR: failed to prepare environment for request controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e during pip package install.
      2021-09-28 20:44:21,764|f392e439-c176-411b-b972-8acadac0f8df|8c7935a4-79d8-4ec0-b661-dcca3cd68006|POLICY|ThreadPoolExecutor-0_3|CommandExecutorServer|INFO|Prepare Env Response returned : {'cds_is_successful': False, 'results_log': ['', '\n', "WARNING: The directory '/home/onap/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\nERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/onap'\nCheck the permissions.\n\nWARNING: You are using pip version 20.1.1; however, version 21.2.4 is available.\nYou should consider upgrading via the '/opt/app/onap/blueprints/deploy/controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e/bin/python -m pip install --upgrade pip' command.\n"], 'err_msg': 'ERROR: failed to prepare environment for request controlloop-hostname-update/1.0.4/eca23239-833a-4534-a596-5b10b790585e during pip package install.'}
      

       

            jozsef jozsef
            ramverma ramverma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: