conan: [bug] Upload package to 'remote' failed: Expecting value: line 1 column 1 (char 0)

Environment Details (include every applicable attribute)

  • Operating System+version: Linux (inside docker image)
  • Conan version: 1.22.1
  • Python version: 3.8

Steps to reproduce (Include if Applicable)

Happens at random during package compression step:

conan upload <myPackage> --skip-upload --all --confirm --parallel
Uploading to remote '<myRemote>':

Uploading NeuralNetwork/14.1.1@microblink/stable to remote '<myRemote>'                  
Compressing recipe...
Uploading package 1/8: 34cf41d8536732c39e77abede8a2f8f82360863e to '<myRemote>'          
Uploading package 2/8: 5b0d4db60f149a45902c2c09867ed9921f9c00f6 to '<myRemote>'          
Uploading package 3/8: 10e03617df46d6a92dd8e46f9a9b1abe05258aa9 to '<myRemote>'          
Uploading package 4/8: 68848f6b4e38f59d152c5eda2d34a0a2af670df4 to '<myRemote>'          
Uploading package 5/8: e74de748c5b8acdb8431ab8f6e3d50c4ffed4a3f to '<myRemote>'          
Uploading package 7/8: eb8b555c8f3187ca65fc23829fec49b5dca9c5d9 to '<myRemote>'          
Uploading package 8/8: 3e1cacf354c1822e4ec7ea975bc5c142f3f2460d to '<myRemote>'          
Uploading package 6/8: 7ae9b8d69f35a00e06249b099db206560310ce6d to '<myRemote>'          
Compressing package...
Compressing package...
Compressing package...
Compressing package...
Compressing package...
Compressing package...
Compressing package...
Compressing package...
ERROR: <myPackage>:eb8b555c8f3187ca65fc23829fec49b5dca9c5d9: Upload package to '<myRemote>' failed: Expecting value: line 1 column 1 (char 0)

ERROR: Errors uploading some packages
Conan build failed

With conan v1.22.0 this didn’t happen, but caused dirty packages that then failed to upload, as described in issue #6330.

I’d guess this could be related to the issue that sometimes occur on my CI during package upload, which also contains stack trace:

[b] $ cmd.exe /C "conan upload "*" --confirm --all --no-overwrite --parallel && exit %%ERRORLEVEL%%"
ERROR: Extra data: line 1 column 4508 (char 4507)
Traceback (most recent call last):
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\command.py", line 1969, in run
    method(args[0][1:])
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\command.py", line 1410, in upload
    parallel_upload=args.parallel)
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\conan_api.py", line 81, in wrapper
    return f(api, *args, **kwargs)
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\conan_api.py", line 887, in upload
    parallel_upload=parallel_upload)
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\cmd\uploader.py", line 87, in upload
    query, package_id)
  File "e:\j\e1\b\venv\lib\site-packages\conans\client\cmd\uploader.py", line 145, in _collect_packages_to_upload
    metadata = self._cache.package_layout(ref).load_metadata()
  File "e:\j\e1\b\venv\lib\site-packages\conans\paths\package_layouts\package_cache_layout.py", line 171, in load_metadata
    return PackageMetadata.loads(text)
  File "e:\j\e1\b\venv\lib\site-packages\conans\model\package_metadata.py", line 95, in loads
    data = json.loads(content)
  File "C:\Program Files\Python37\Lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python37\Lib\json\decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4508 (char 4507)

Conan build failed

But it’s also possible that those are different issues. (I see some similarities with #3985 and #6482).

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

@czoido , I’ve got 3 consecutive builds of my library on my CI with your fix that were successful. For comparison, 4 consecutive with stable 1.22.1 failed at some step (either compressing or uploading).

So, from my point of view, even though I cannot be absolutely certain that your fix is always correct (due to the concurrent nature of the bug), I am absolutely certain that it works much much better than v1.22.1.

So, please, ship it ASAP 😃

Thank you so much for your help with the issue @DoDoENT !