Help Center> CodeArts Deploy> FAQs> Custom Application Actions> Running Shell Commands> A Message Indicating an Operation Failure Is Displayed During Action Run Shell Commands Deployment
Updated on 2024-07-04 GMT+08:00

A Message Indicating an Operation Failure Is Displayed During Action Run Shell Commands Deployment

Symptoms

During action deployment, an error message is displayed, indicating that the operation fails.

Cause Analysis

Some commands entered in the text box are intercepted by cloud firewalls. As a result, the deployment fails. The following figure uses the shell command as an example.

1
2
3
4
5
6
cat /etc/hosts
cat /etc/passwd
cat /etc/shadow
cat /etc/fstab
mount -l || echo hello world 
...

Solution

Solution 1: Parameterization

  1. Add the parameter Path and set its value to /etc/hosts.
  2. Reference the parameter Path in the Shell Commands text box.
    cat ${Path}
    cat /etc/passwd
    cat /etc/shadow
    cat /etc/fstab
    mount -l || echo hello world 
    ……

Solution 2: Using the Shell Script

  1. Upload the script to CodeArts Artifact.
  2. Use the action Select Deployment Source to download the script to the target host.
  3. Deploy the action Run Shell Script.

Running Shell Commands FAQs

more