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

Error when building charms simultaneously: BadZipFile error #540

Closed
mvlassis opened this issue Sep 2, 2024 · 2 comments
Closed

Error when building charms simultaneously: BadZipFile error #540

mvlassis opened this issue Sep 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mvlassis
Copy link
Contributor

mvlassis commented Sep 2, 2024

Bug Description

This issue is encountered while building charms simultaneously using tox. This unfortunately blocks our CI, as seen in these run logs. It seems that this is related to charmcraft, as this issue was first documented in the charmcraft repository.

To Reproduce

  • Clone the repository with git clone
  • Install charmcraft from latest/candidate
  • Run the integration tests with tox -e integration -- --model kubeflow

Environment

Charmcraft version: latest/candidate which is currently 3.2.0
Juju version: 3.4.5
Python version: 3.8.19

Relevant Log Output

=================================== FAILURES ===================================
______________________ test_build_and_deploy_istio_charms ______________________
Traceback (most recent call last):
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 532, in inner
    _loop.run_until_complete(task)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/runner/work/istio-operators/istio-operators/tests/test_bundle.py", line 83, in test_build_and_deploy_istio_charms
    istio_charms = await ops_test.build_charms(f"{charms_path}-gateway", f"{charms_path}-pilot")
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pytest_operator/plugin.py", line 1021, in build_charms
    charms = await asyncio.gather(
  File "/home/runner/work/istio-operators/istio-operators/.tox/integration/lib/python3.8/site-packages/pytest_operator/plugin.py", line 1004, in build_charm
    raise RuntimeError(
RuntimeError: Failed to build charm charms/istio-gateway:
Launching managed ubuntu 20.04 instance...
Creating new instance from remote
::    :: Requirement already satisfied: pip in ./staging-venv/lib/python3.8/site-packages (20.0.2)
::    :: Building wheels for collected packages: wheel
::    ::   Building wheel for wheel (PEP 517): started
::    ::   Building wheel for wheel (PEP 517): finished with status 'done'
::    ::   Created wheel for wheel: filename=wheel-0.44.0-py3-none-any.whl size=67059 sha256=2376a90c98cc337d18623527a97c31797bd02bad0033d41547043a1cbfbe448f
::    ::   Stored in directory: /root/.cache/pip/wheels/e2/ec/77/3b86b29474a5ff9fe2c368abefa00b6cc86dbe6b7db87ffe1e
::    :: Successfully built wheel
::    :: Installing collected packages: wheel
::    :: Successfully installed wheel-0.44.0
:: Installing packages from requirements files and charm lib dependencies.
:: Running external command ['/root/parts/charm/build/staging-venv/bin/pip', 'install', '--no-binary=:all:', '--requirement=requirements.txt']
::    :: Collecting annotated-types==0.7.0
::    ::   Downloading annotated_types-0.7.0.tar.gz (16 kB)
::    ::   Installing build dependencies: started
::    ::   Installing build dependencies: still running...
::    ::   Installing build dependencies: finished with status 'done'
::    ::   Getting requirements to build wheel: started
::    ::   Getting requirements to build wheel: finished with status 'done'
::    ::     Preparing wheel metadata: started
::    ::     Preparing wheel metadata: finished with status 'done'
::    :: Collecting anyio==4.4.0
::    ::   Downloading anyio-4.4.0.tar.gz (163 kB)
::    ::   Installing build dependencies: started
::    ::   Installing build dependencies: finished with status 'done'
::    ::   Getting requirements to build wheel: started
::    ::   Getting requirements to build wheel: finished with status 'done'
::    ::     Preparing wheel metadata: started
::    ::     Preparing wheel metadata: finished with status 'done'
::    :: Collecting attrs==23.2.0
::    ::   Downloading attrs-23.2.0.tar.gz (780 kB)
::    ::   Installing build dependencies: started
::    ::   Installing build dependencies: finished with status 'error'
::    ::   ERROR: Command errored out with exit status 1:
::    ::    command: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-oj1fojp5/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- hatchling hatch-vcs 'hatch-fancy-pypi-readme>=23.2.0'
::    ::        cwd: None
::    ::   Complete output (96 lines):
::    ::   Collecting hatchling
::    ::     Using cached hatchling-1.25.0.tar.gz (64 kB)
::    ::     Getting requirements to build wheel: started
::    ::     Getting requirements to build wheel: finished with status 'done'
::    ::     Installing backend dependencies: started
::    ::     Installing backend dependencies: finished with status 'error'
::    ::     ERROR: Command errored out with exit status 1:
::    ::      command: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-t_x8l1dn/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'pathspec>=0.10.1' 'tomli>=1.2.2; python_version < '"'"'3.11'"'"'' 'packaging>=23.2' trove-classifiers 'pluggy>=1.0.0'
::    ::          cwd: None
::    ::     Complete output (84 lines):
::    ::     Collecting pathspec>=0.10.1
::    ::       Using cached pathspec-0.12.1.tar.gz (51 kB)
::    ::       Installing build dependencies: started
::    ::       Installing build dependencies: finished with status 'done'
::    ::       Getting requirements to build wheel: started
::    ::       Getting requirements to build wheel: finished with status 'done'
::    ::         Preparing wheel metadata: started
::    ::         Preparing wheel metadata: finished with status 'done'
::    ::     Collecting tomli>=1.2.2
::    ::       Using cached tomli-2.0.1.tar.gz (15 kB)
::    ::       Installing build dependencies: started
::    ::       Installing build dependencies: finished with status 'done'
::    ::       Getting requirements to build wheel: started
::    ::       Getting requirements to build wheel: finished with status 'done'
::    ::         Preparing wheel metadata: started
::    ::         Preparing wheel metadata: finished with status 'done'
::    ::     Collecting packaging>=23.2
::    ::       Using cached packaging-24.1.tar.gz (148 kB)
::    ::       Installing build dependencies: started
::    ::       Installing build dependencies: finished with status 'done'
::    ::       Getting requirements to build wheel: started
::    ::       Getting requirements to build wheel: finished with status 'done'
::    ::         Preparing wheel metadata: started
::    ::         Preparing wheel metadata: finished with status 'done'
::    ::     Collecting trove-classifiers
::    ::       Using cached trove_classifiers-2024.7.2.tar.gz (16 kB)
::    ::       Installing build dependencies: started
::    ::       Installing build dependencies: finished with status 'error'
::    ::       ERROR: Command errored out with exit status 2:
::    ::        command: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-9_v2jrlo/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools calver
::    ::            cwd: None
::    ::       Complete output (50 lines):
::    ::       Collecting setuptools
::    ::         Using cached setuptools-74.0.0.tar.gz (1.4 MB)
::    ::         Getting requirements to build wheel: started
::    ::         Getting requirements to build wheel: finished with status 'done'
::    ::           Preparing wheel metadata: started
::    ::           Preparing wheel metadata: finished with status 'done'
::    ::       Collecting calver
::    ::         Using cached calver-2022.6.26.tar.gz (6.7 kB)
::    ::         Installing build dependencies: started
::    ::         Installing build dependencies: finished with status 'done'
::    ::         Getting requirements to build wheel: started
::    ::         Getting requirements to build wheel: finished with status 'done'
::    ::           Preparing wheel metadata: started
::    ::           Preparing wheel metadata: finished with status 'done'
::    ::       Building wheels for collected packages: setuptools, calver
::    ::         Building wheel for setuptools (PEP 517): started
::    ::         Building wheel for setuptools (PEP 517): finished with status 'done'
::    ::         Created wheel for setuptools: filename=setuptools-74.0.0-py3-none-any.whl size=1301729 sha256=1c3e089f869960f45036d8e70fc0d71c333fc5181832029a4474a6e37aededf5
::    ::         Stored in directory: /root/.cache/pip/wheels/1d/17/f1/d2a056eb3ee4fd455893c3fa5b6e5a617d67682a395b82936a
::    ::         Building wheel for calver (PEP 517): started
::    ::         Building wheel for calver (PEP 517): finished with status 'done'
::    ::         Created wheel for calver: filename=calver-2022.6.26-py3-none-any.whl size=7048 sha256=9a8752b49a7107d01c893eb74d754926b153488320933d0dbbd6619586f7b4b1
::    ::         Stored in directory: /root/.cache/pip/wheels/d2/72/95/fb1b0322b36777560ebee2a42d073ef50be13539cfc26856f8
::    ::       Successfully built setuptools calver
::    ::       Installing collected packages: setuptools, calver
::    ::       ERROR: Exception:
::    ::       Traceback (most recent call last):
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
::    ::           status = self.run(options, args)
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 421, in run
::    ::           installed = install_given_reqs(
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 67, in install_given_reqs
::    ::           requirement.install(
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 809, in install
::    ::           install_wheel(
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py", line 606, in install_wheel
::    ::           unpack_file(wheel_path, unpacked_dir.path)
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py", line 249, in unpack_file
::    ::           unzip_file(
::    ::         File "/root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py", line 139, in unzip_file
::    ::           shutil.copyfileobj(fp, destfp)
::    ::         File "/usr/lib/python3.8/shutil.py", line 205, in copyfileobj
::    ::           buf = fsrc_read(length)
::    ::         File "/usr/lib/python3.8/zipfile.py", line 942, in read
::    ::           data = self._read1(n)
::    ::         File "/usr/lib/python3.8/zipfile.py", line 1010, in _read1
::    ::           data += self._read2(n - len(data))
::    ::         File "/usr/lib/python3.8/zipfile.py", line 1045, in _read2
::    ::           raise EOFError
::    ::       EOFError
::    ::       ----------------------------------------
::    ::     ERROR: Command errored out with exit status 2: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-9_v2jrlo/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools calver Check the logs for full command output.
::    ::     ----------------------------------------
::    ::   ERROR: Command errored out with exit status 1: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-t_x8l1dn/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'pathspec>=0.10.1' 'tomli>=1.2.2; python_version < '"'"'3.11'"'"'' 'packaging>=23.2' trove-classifiers 'pluggy>=1.0.0' Check the logs for full command output.
::    ::   ----------------------------------------
::    :: ERROR: Command errored out with exit status 1: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-oj1fojp5/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- hatchling hatch-vcs 'hatch-fancy-pypi-readme>=23.2.0' Check the logs for full command output.
:: Traceback (most recent call last):
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 482, in <module>
::     main()
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 477, in main
::     builder.build_charm()
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 93, in build_charm
::     self.handle_dependencies()
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 353, in handle_dependencies
::     self._install_dependencies(staging_venv_dir)
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/instrum.py", line 152, in _f
::     return func(*args, **kwargs)
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 283, in _install_dependencies
::     _process_run(
::   File "/snap/charmcraft/4684/lib/python3.10/site-packages/charmcraft/charm_builder.py", line 413, in _process_run
::     raise RuntimeError(f"Subprocess command {cmd} execution failed with retcode {retcode}")
:: RuntimeError: Subprocess command ['/root/parts/charm/build/staging-venv/bin/pip', 'install', '--no-binary=:all:', '--requirement=requirements.txt'] execution failed with retcode 1
Failed to run the build script for part 'charm'.
Recommended resolution: Check the build output and verify the project can work with the 'charm' plugin.
Failed to execute charmcraft in instance.
Full execution log: '/home/runner/.local/state/charmcraft/log/charmcraft-20240830-142217.181155.log'


=========================== short test summary info ============================
FAILED tests/test_bundle.py::test_build_and_deploy_istio_charms - RuntimeErro...
============== 1 failed, 1 passed, 6 xfailed in 238.55s (0:03:58) ==============
integration: exit 1 (239.45 seconds) /home/runner/work/istio-operators/istio-operators> pytest --show-capture=no --log-cli-level=INFO -vvs --tb=native --model test-istio tests/test_bundle.py pid=145847
  integration: FAIL code 1 (260.73=setup[21.28]+cmd[239.45] seconds)
  evaluation failed :( (260.83 seconds)

Additional Context

No response

@mvlassis mvlassis added the bug Something isn't working label Sep 2, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-6194.

This message was autogenerated

@mvlassis
Copy link
Contributor Author

mvlassis commented Sep 2, 2024

Closing as I created this issue to track the error in all of our repositories.

@mvlassis mvlassis closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant