CircleCI-Public / circleci-cli

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

Context store-secret and remove-secret fail with Error: invalid character '<' #600

Open mattvanstone opened 3 years ago

mattvanstone commented 3 years ago

Meta:

CircleCI CLI Version: 0.1.15338+850f9ac (release)

Operating System: cimg/base:2020.01

CircleCI CLI Diagnostic:

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

Current behavior:

Running the store-secret or remove-secret commands results in an error message.

echo "test" | circleci context store-secret github myuser mycontext TEST_KEY --token "[REDACTED]"

Results in

Error: invalid character '<' looking for beginning of value

Expected behavior:

The command should complete successfully and a new secret should be added to the context.

When did this begin / Was this previously working?:

Since version 0.1.15338+850f9ac (release) Version v0.1.15224 does not have this issue

Additional Information:

Downgrading to v0.1.15224 resolves the issue.

While troubleshooting this issue I found that in the current version of the circleci-cli orb (0.1.9), the version parameter on the install job does not work. I created a separate issue for that: https://github.com/CircleCI-Public/circleci-cli-orb/issues/13

qbast commented 3 years ago

The same happens for 'list' and 'show' commands - context management is completely broken

markovdigital commented 3 years ago

To rollback to latest working version do curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | sudo VERSION="0.1.15224" bash

esheppa commented 3 years ago

As a workaround for this we started using the API directly. Periodically we receive the following response from the API, so it looks like the error here may be in the underlying API rather than in this CLI:

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>