Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: unknown command "env" for "circleci" #117

Closed
Elte156 opened this issue Dec 2, 2024 · 6 comments
Closed

Error: unknown command "env" for "circleci" #117

Elte156 opened this issue Dec 2, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Elte156
Copy link

Elte156 commented Dec 2, 2024

Orb version

1.4.9

What happened

Using sample circle ci config:

    docker:
      - image: cimg/node:18.20-browsers
    steps:
      - browser-tools/install-chrome

Results in:

Error: unknown command "env" for "circleci"
Run 'circleci --help' for usage.
ERRO[0000] Exit with status 1 due to generic error       error="unknown command \"env\" for \"circleci\""

Exited with code exit status 1
CircleCI received exit code 1

Expected behavior

  • It should install chrome without issue
  • Note: 1.4.8 did not have this issue
@marboledacci marboledacci self-assigned this Dec 2, 2024
@marboledacci marboledacci added the bug Something isn't working label Dec 2, 2024
@marboledacci
Copy link
Contributor

Could you provide more more details? Any step previous to that or specific configuration you have made.
I've been running that workflow, with the same image and the same orb version and it always works.

@Elte156
Copy link
Author

Elte156 commented Dec 2, 2024

@marboledacci let me try to recreate the issue with a full config.yml example for you.

@Elte156
Copy link
Author

Elte156 commented Dec 3, 2024

Here's a full config.yml that results in error

version: 2.1

orbs:
  browser-tools: circleci/browser-tools@1

jobs:
  test_job:
    docker:
      - image: cimg/node:18.20-browsers
    steps:
      - run:
          command: |
            circleci --help
            circleci version
      - browser-tools/install-chrome

workflows:
  pull_request:
    jobs:
      - test_job:
          filters:
            branches:
              ignore: [main]

The "compiled source" says:
# Orb 'circleci/browser-tools@1' resolved to 'circleci/[email protected]'

The output is:

The CLI tool to be used in CircleCI.

Usage:
  circleci [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  config      Validate and update the circleCI configuration file
  execute     Run a job in a container on the local machine
  help        Help about any command
  task        Manage tasks
  tests       Collect and split tests so they may be run in parallel.
  version     Output version info

Flags:
  -h, --help      help for circleci
      --verbose   enable verbose logging output

Use "circleci [command] --help" for more information about a command.
INFO[0000] Clean exit without errors                    
Build Agent version: 1.0.213497-server-4.2-0f31974a
Built: 2023-12-14T20:14:42+0000
CircleCI received exit code 0


---


Error: unknown command "env" for "circleci"
Run 'circleci --help' for usage.
ERRO[0000] Exit with status 1 due to generic error       error="unknown command \"env\" for \"circleci\""

Exited with code exit status 1
CircleCI received exit code 1

@marboledacci based on these findings:

@marboledacci
Copy link
Contributor

Are you using a self-hosted runner?

@Elte156
Copy link
Author

Elte156 commented Dec 3, 2024

Yes, it's self hosted. What agent version (circleci version) do you have that allows for circleci env?

@marboledacci
Copy link
Contributor

@Elte156 Your guessing is right, the problem is your agent version. The env command was added in server 4.3 and you are running server 4.2. Updating to server 4.3 should be enough to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants