CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
405 stars 233 forks source link

Wrong version of circleci inside local execution env #1017

Closed SeanHayes closed 7 months ago

SeanHayes commented 7 months ago

Meta:

CircleCI CLI Version: 0.1.29314+148495a (homebrew)

Operating System: macOS Sonoma Version 14.1.1 (23B81)

CircleCI CLI Diagnostic:


---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/redacted/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API... 
Ok.
Hello, Seán Hayes.

Current behavior:

Error happens when running circleci local execute my-job. Execution works fine remotely on the Circle CI service, it only fails locally.

To debug I added these steps:


      - run:
          name: Sanity check for circleci env subst
          command: |
              circleci version
      - run:
          name: Sanity check for circleci env subst
          command: |
              # Without circleci-cli/install this fails locally.
              AWS_FOO="$(echo "${AWS_FOO}" | circleci env subst)"

Which gives this error:

====>> Sanity check for circleci env subst
  #!/bin/bash -eo pipefail
circleci version

Build Agent version: 1.0.105680-924e1373
Built: 2022-01-31T21:01:13+0000
====>> Sanity check for circleci env subst
  #!/bin/bash -eo pipefail
# Without circleci-cli/install this fails locally.
AWS_FOO="$(echo "${AWS_FOO}" | circleci env subst)"

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\""
Error: 
Exited with code exit status 1

Step failed

Expected behavior:

The latest cli should automatically be used so that Orbs will continue to run after update. It's really odd that the most recent version of the CLI would use a 2 year old version of the CLI inside Docker containers.

Also, ideally Orbs would be able to define a minimum supported version.

When did this begin / Was this previously working?:

I updated from circleci/aws-cli@3.2.0 to circleci/aws-cli@4.1.1 and the new version uses the circleci env subst command.

Additional Information:

If I include the Orb circleci-cli: circleci/circleci-cli@0.1.9 and add this step:

      - circleci-cli/install

The latest CLI is installed and everything works.

jvincent42 commented 7 months ago

Thanks for reporting this issue. It is a known behaviour and we are trying to find a solution.

jvincent42 commented 7 months ago

Unfortunately we can not fix this behaviour, we are exploring more solutions involving the future of this feature but a fix won't be provided soon.