[GH-ISSUE #1315] act workflow is complaing about "less" not installed. #714

Closed
opened 2026-03-01 21:45:44 +03:00 by kerem · 3 comments
Owner

Originally created by @vteran93 on GitHub (Aug 24, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1315

Bug report info

DEBU[0014] Wrote command
aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXX/32


 to 'workflow/3'
DEBU[0014] Writing entry to tarball workflow/3 len:127
[Deploy main branch/Setup Environment] Extracting content to '/var/run/act'
[Deploy main branch/Setup Environment]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
[Deploy main branch/Setup Environment] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]'
[Deploy main branch/Setup Environment] Working directory '/home/victor_teran/repositories/yardi-data-egress'
| 
| Unable to redirect output to pager. Received the following error when opening pager:
| [Errno 2] No such file or directory: 'less'
|
| Learn more about configuring the output pager by running "aws help config-vars".
[Deploy main branch/Setup Environment]   ❌  Failure - Add Github Actions IP to Security group
[Deploy main branch/Setup Environment] exit with `FAILURE`: 253


### Command used with act

```sh
act -j deploy --secret-file .secrets -v

Describe issue

Trying to add a rule to the security group I git the message above.

No response

Workflow content

---
name: Deploy main branch
'on':
  push:
    branches:
      - my_branch

jobs:
  setup_environment:
    name: Setup Environment
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        node-version:
          - 16.x
    steps:
      - name: Getting ip address locally
        run: |
          echo "RUNNER_IP=$(curl -s https://icanhazip.com)" >> $GITHUB_ENV

      # - uses: haythem/public-ip@v1.2
      #   name: Get Github action IP
      #   id: ip
      - name: Setting environment variables..
        run: |
          echo "AWS_DEFAULT_REGION=us-east-2" >> $GITHUB_ENV
          echo "AWS_THIRDPARTY_INGRESS_SG_ID=sg-XXXXXXX" >> $GITHUB_ENV
      - name: Install AWS Cli
        id: install-aws-cli
        uses: unfor19/install-aws-cli-action@master
      - name: Add Github Actions IP to Security group
        run: |
          aws ec2 authorize-security-group-ingress --group-id ${{ env.AWS_THIRDPARTY_INGRESS_SG_ID }} --protocol tcp --port 5432 --cidr ${{ env.RUNNER_IP }}/32
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY }}
          AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}

Relevant log output

[Deploy main branch/Setup Environment]   ⚙  ::set-output:: version=aws-cli/2.7.25 Python/3.9.11 Linux/5.10.16.3-microsoft-standard-WSL2 exe/x86_64.ubuntu.18 prompt/off
[Deploy main branch/Setup Environment]   ✅  Success - Install AWS Cli
DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git'
DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git'
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a'
DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] evaluating expression ''
DEBU[0014] expression '' evaluated to 'true'
DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git'
DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git'
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a'
DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git' 
DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git' 
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a'
DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project
DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a
DEBU[0014] expression '${{ secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY }}' rewritten to 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)'
DEBU[0014] evaluating expression 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)'
DEBU[0014] expression 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)' evaluated to '%!t(string=VaKGI9q4l7qLRhazuASrn0aURRhZTpu59ng60NCY)'
DEBU[0014] expression '${{ secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID }}' rewritten to 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)'
DEBU[0014] evaluating expression 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)'
DEBU[0014] expression 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)' evaluated to '%!t(string=AKIAXI7XIKSUPVFHN2UD)'
DEBU[0014] expression '${{ env.AWS_DEFAULT_REGION }}' rewritten to 'format('{0}', env.AWS_DEFAULT_REGION)'
DEBU[0014] evaluating expression 'format('{0}', env.AWS_DEFAULT_REGION)'
DEBU[0014] expression 'format('{0}', env.AWS_DEFAULT_REGION)' evaluated to '%!t(string=us-east-2)'

DEBU[0014] expression 'aws ec2 authorize-security-group-ingress --group-id ${{ env.AWS_THIRDPARTY_INGRESS_SG_ID }} --protocol tcp --port 5432 --cidr ${{ env.RUNNER_IP }}/32
' rewritten to 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32
', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)'
DEBU[0014] evaluating expression 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32
', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)'
DEBU[0014] expression 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32
', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)' evaluated to '%!t(string=aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXXX/32
)'
DEBU[0014] Wrote command

aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXXX/32


 to 'workflow/3'
DEBU[0014] Writing entry to tarball workflow/3 len:127
[Deploy main branch/Setup Environment] Extracting content to '/var/run/act'
[Deploy main branch/Setup Environment]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
[Deploy main branch/Setup Environment] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]'
[Deploy main branch/Setup Environment] Working directory '/home/victor_teran/repositories/some-project'
| 
| Unable to redirect output to pager. Received the following error when opening pager:
| [Errno 2] No such file or directory: 'less'
|
| Learn more about configuring the output pager by running "aws help config-vars".

Additional information

No response

Originally created by @vteran93 on GitHub (Aug 24, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1315 ### Bug report info ```plain text DEBU[0014] Wrote command aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXX/32 to 'workflow/3' DEBU[0014] Writing entry to tarball workflow/3 len:127 [Deploy main branch/Setup Environment] Extracting content to '/var/run/act' [Deploy main branch/Setup Environment] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= [Deploy main branch/Setup Environment] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]' [Deploy main branch/Setup Environment] Working directory '/home/victor_teran/repositories/yardi-data-egress' | | Unable to redirect output to pager. Received the following error when opening pager: | [Errno 2] No such file or directory: 'less' | | Learn more about configuring the output pager by running "aws help config-vars". [Deploy main branch/Setup Environment] ❌ Failure - Add Github Actions IP to Security group [Deploy main branch/Setup Environment] exit with `FAILURE`: 253 ``` ``` ### Command used with act ```sh act -j deploy --secret-file .secrets -v ``` ### Describe issue Trying to add a rule to the security group I git the message above. ### Link to GitHub repository _No response_ ### Workflow content ```yml --- name: Deploy main branch 'on': push: branches: - my_branch jobs: setup_environment: name: Setup Environment runs-on: ubuntu-18.04 strategy: matrix: node-version: - 16.x steps: - name: Getting ip address locally run: | echo "RUNNER_IP=$(curl -s https://icanhazip.com)" >> $GITHUB_ENV # - uses: haythem/public-ip@v1.2 # name: Get Github action IP # id: ip - name: Setting environment variables.. run: | echo "AWS_DEFAULT_REGION=us-east-2" >> $GITHUB_ENV echo "AWS_THIRDPARTY_INGRESS_SG_ID=sg-XXXXXXX" >> $GITHUB_ENV - name: Install AWS Cli id: install-aws-cli uses: unfor19/install-aws-cli-action@master - name: Add Github Actions IP to Security group run: | aws ec2 authorize-security-group-ingress --group-id ${{ env.AWS_THIRDPARTY_INGRESS_SG_ID }} --protocol tcp --port 5432 --cidr ${{ env.RUNNER_IP }}/32 env: AWS_ACCESS_KEY_ID: ${{ secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} ``` ### Relevant log output ```sh [Deploy main branch/Setup Environment] ⚙ ::set-output:: version=aws-cli/2.7.25 Python/3.9.11 Linux/5.10.16.3-microsoft-standard-WSL2 exe/x86_64.ubuntu.18 prompt/off [Deploy main branch/Setup Environment] ✅ Success - Install AWS Cli DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a' DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] evaluating expression '' DEBU[0014] expression '' evaluated to 'true' DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a' DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] Loading slug from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Loading revision from git directory '/home/victor_teran/repositories/some-project/.git' DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] HEAD points to '213eb5c201387895453b08c0cd9482005c58986a' DEBU[0014] using github ref: refs/heads/PMINT-104-separate-deployment-dev-and-staging-environments-for-some-project DEBU[0014] Found revision: 213eb5c201387895453b08c0cd9482005c58986a DEBU[0014] expression '${{ secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY }}' rewritten to 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)' DEBU[0014] evaluating expression 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)' DEBU[0014] expression 'format('{0}', secrets.SLS_DEPLOY_AWS_SECRET_ACCESS_KEY)' evaluated to '%!t(string=VaKGI9q4l7qLRhazuASrn0aURRhZTpu59ng60NCY)' DEBU[0014] expression '${{ secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID }}' rewritten to 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)' DEBU[0014] evaluating expression 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)' DEBU[0014] expression 'format('{0}', secrets.SLS_DEPLOY_AWS_ACCESS_KEY_ID)' evaluated to '%!t(string=AKIAXI7XIKSUPVFHN2UD)' DEBU[0014] expression '${{ env.AWS_DEFAULT_REGION }}' rewritten to 'format('{0}', env.AWS_DEFAULT_REGION)' DEBU[0014] evaluating expression 'format('{0}', env.AWS_DEFAULT_REGION)' DEBU[0014] expression 'format('{0}', env.AWS_DEFAULT_REGION)' evaluated to '%!t(string=us-east-2)' DEBU[0014] expression 'aws ec2 authorize-security-group-ingress --group-id ${{ env.AWS_THIRDPARTY_INGRESS_SG_ID }} --protocol tcp --port 5432 --cidr ${{ env.RUNNER_IP }}/32 ' rewritten to 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32 ', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)' DEBU[0014] evaluating expression 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32 ', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)' DEBU[0014] expression 'format('aws ec2 authorize-security-group-ingress --group-id {0} --protocol tcp --port 5432 --cidr {1}/32 ', env.AWS_THIRDPARTY_INGRESS_SG_ID, env.RUNNER_IP)' evaluated to '%!t(string=aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXXX/32 )' DEBU[0014] Wrote command aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXX --protocol tcp --port 5432 --cidr XXXXXXXXXXXXXX/32 to 'workflow/3' DEBU[0014] Writing entry to tarball workflow/3 len:127 [Deploy main branch/Setup Environment] Extracting content to '/var/run/act' [Deploy main branch/Setup Environment] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= [Deploy main branch/Setup Environment] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]' [Deploy main branch/Setup Environment] Working directory '/home/victor_teran/repositories/some-project' | | Unable to redirect output to pager. Received the following error when opening pager: | [Errno 2] No such file or directory: 'less' | | Learn more about configuring the output pager by running "aws help config-vars". ``` ### Additional information _No response_
kerem 2026-03-01 21:45:44 +03:00
Author
Owner

@Antvirf commented on GitHub (Aug 25, 2022):

Your workflow's runs-on specifies the container image as ubuntu-18.04, which doesn't have less installed by default.

Replicating using that image:

# run ubuntu-18.04 as container
> docker run -it ubuntu:18.04 

# try to use less
> root@7533659e3824:/# less
bash: less: command not found

As a solution, there is a suggestion in this stackoverflow reply about setting AWS_PAGER to an empty string to avoid the issue, which you could try.

Alternatively, you could install less as part of your Action script, which should hopefully resolve the issue :)

<!-- gh-comment-id:1226796489 --> @Antvirf commented on GitHub (Aug 25, 2022): Your workflow's ```runs-on``` specifies the container image as ```ubuntu-18.04```, which doesn't have ```less``` installed by default. Replicating using that image: ``` # run ubuntu-18.04 as container > docker run -it ubuntu:18.04 # try to use less > root@7533659e3824:/# less bash: less: command not found ``` As a solution, there is a suggestion [in this stackoverflow reply](https://stackoverflow.com/a/68361849) about setting ```AWS_PAGER``` to an empty string to avoid the issue, which you could try. Alternatively, you could install ```less``` as part of your Action script, which should hopefully resolve the issue :)
Author
Owner

@github-actions[bot] commented on GitHub (Sep 25, 2022):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1257088151 --> @github-actions[bot] commented on GitHub (Sep 25, 2022): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@catthehacker commented on GitHub (Oct 3, 2022):

Image software disparity has been explained already in the README

<!-- gh-comment-id:1266028880 --> @catthehacker commented on GitHub (Oct 3, 2022): Image software disparity has been explained already in the README
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#714
No description provided.