Failing in pipeline without input specified
See original GitHub issueWhen running the command in gitlab-ci I got the following output:
cyclonedx-bom --pip --format json -o bom.json
Traceback (most recent call last):
File "/usr/local/bin/cyclonedx-bom", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/cyclonedx_py/client.py", line 259, in main
CycloneDxCmd(args).execute()
File "/usr/local/lib/python3.10/site-packages/cyclonedx_py/client.py", line 113, in execute
output = self.get_output()
File "/usr/local/lib/python3.10/site-packages/cyclonedx_py/client.py", line 63, in get_output
parser = self._get_input_parser()
File "/usr/local/lib/python3.10/site-packages/cyclonedx_py/client.py", line 247, in _get_input_parser
return PipEnvParser(pipenv_contents=input_data)
File "/usr/local/lib/python3.10/site-packages/cyclonedx_py/parser/pipenv.py", line 35, in __init__
pipfile_lock_contents = json.loads(pipenv_contents)
File "/usr/lib64/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Using sys.stdin.isatty()
in the following context will cause the file to be read automatically from stdin:
And this will be followed by the above non descriptive error message.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
Learn how to troubleshoot pipeline runs in Azure Pipelines and Team Foundation Server.
Read more >Azure DevOps pipeline release Error: No package found with ...
First, you could make sure you have generated the artifact for your build pipeline, check it from the build history in the build...
Read more >Troubleshooting CI/CD - GitLab Docs
GitLab determines if a job is added to a pipeline based on the only/except or rules defined for the job. If it didn't...
Read more >Pipeline Syntax - Jenkins
Unsupported credentials type causes the pipeline to fail with the message: org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: No ...
Read more >Resolving Common Problems - AWS Data Pipeline
If both values are empty or missing, the task cannot start because there is no association between the task and a worker to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
totally agree. 👍
would you be okay to open another Issue with exactly this topic as a feature request, and describe expectations, benefits, risks etc?
That is correct. I would have expected the same behaviour within the pipeline as outside. But would be fine with a more descriptive error message - “I read from stdin and failed to find json”.
In general I do prefer a cli that does explizit stdin setups using
-
as file indicator though. To elaborate:cyclonedx-bom --pip --format json -o bom.json
cyclonedx-bom --pip --format json -o bom.json -i MY_INPUT
cyclonedx-bom --pip --format json -o bom.json -i -
Regardless whether there is a terminal connected or not.