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

JSONDecodeError whenever communicating with Buildsense after acquire-auth #14222

Closed
wimax-grapl opened this issue Jan 20, 2022 · 1 comment
Closed
Labels

Comments

@wimax-grapl
Copy link
Contributor

Describe the bug

Hi! I've acquired auth but Pants seem to be having a hard time talking with Buildsense.

Any time I run any Pants command it spews out a JSON error:

./pants filter --target-type=python_sources,python_tests :: | xargs ./pants lint
16:06:44.23 [INFO] Completed: Lint with isort - isort succeeded.
Skipped 47 files


16:06:44.87 [INFO] View on BuildSense: https://app.toolchain.com/organizations/grapl-security/repos/grapl/builds/pants_run_2022_01_20_16_06_43_209_0e550a27bfda4f199e846d8ccfd06ecc/
Exception in thread buildsense-reporter:
Traceback (most recent call last):
  File "/home/wimax/.pyenv/versions/3.7.10/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/home/wimax/.pyenv/versions/3.7.10/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/reporter.py", line 338, in _report_loop
    operation = self._build_state.send_report()
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/state.py", line 151, in send_report
    batch_sent = self._maybe_send_batched_build()
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/state.py", line 248, in _maybe_send_batched_build
    batched_build = self._local_store.get_upload_batch()
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/local_store.py", line 86, in get_upload_batch
    return self._create_batch()
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/local_store.py", line 97, in _create_batch
    batch, files_in_batch = self._get_batched_data()
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/local_store.py", line 118, in _get_batched_data
    batch_data[key] = {build_file.stem: json.loads(build_file.read_bytes()) for build_file in files_batch}  # type: ignore[assignment]
  File "/home/wimax/.cache/pants/named_caches/pex_root/venvs/s/6ae700a8/venv/lib/python3.7/site-packages/toolchain/pants/buildsense/local_store.py", line 118, in <dictcomp>
    batch_data[key] = {build_file.stem: json.loads(build_file.read_bytes()) for build_file in files_batch}  # type: ignore[assignment]
  File "/home/wimax/.pyenv/versions/3.7.10/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/home/wimax/.pyenv/versions/3.7.10/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/wimax/.pyenv/versions/3.7.10/lib/python3.7/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)

16:06:47.78 [INFO] Completed: Lint with Flake8 - Flake8 succeeded.
16:06:47.80 [INFO] Completed: Lint with Black - Black succeeded.
All done! ✨ 🍰 ✨
185 files would be left unchanged.



✓ Black succeeded.
✓ Flake8 succeeded.
✓ isort succeeded.

The token is fresh and has these permissions:
image

Pants version
Which version of Pants are you using?
2.8.0

OS
Are you encountering the bug on MacOS, Linux, or both?
linux

Additional info

@stuhood
Copy link
Sponsor Member

stuhood commented Jan 20, 2022

Thanks for the report! This is related to an independent plugin, so I've transferred it over here: toolchainlabs/issues#11

@stuhood stuhood closed this as completed Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants