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

Cache directories that already exist get an error #167

Closed
lengau opened this issue Jan 2, 2024 · 0 comments · Fixed by #169
Closed

Cache directories that already exist get an error #167

lengau opened this issue Jan 2, 2024 · 0 comments · Fixed by #169

Comments

@lengau
Copy link
Contributor

lengau commented Jan 2, 2024

Bug Description

When a cache directory already exists, pyxdg throws an exception that we don't catch

To Reproduce

See: https://matrix.to/#/!LhFxJIPEcCacgdMghH:ubuntu.com/$kp5AKrB1uWyHgrnl5nFXH-plPE2PXgMpu_YCZLj56pw

part yaml

No response

Relevant log output

2024-01-02 11:27:02.019 Starting charmcraft
2024-01-02 11:27:02.022 Loading project file '/home/runner/work/istio-operators/istio-operators/charms/istio-gateway/charmcraft.yaml'
2024-01-02 11:27:02.023 Setting target machine to x86_64
2024-01-02 11:27:02.026 Running charmcraft:ubuntu-20.04-amd64 in amd64 instance...
2024-01-02 11:27:02.027 Preparing managed instance 'charmcraft-istio-gateway-on-amd64-for-amd64-779228'
2024-01-02 11:27:02.027 Using hostname 'charmcraft-istio-gateway-on-amd64-for-amd64-779228'
2024-01-02 11:27:02.027 Using default provider
2024-01-02 11:27:02.027 Launching managed ubuntu 20.04 instance...
2024-01-02 11:27:02.027 Executing on host: lxc remote list --format=yaml
2024-01-02 11:27:02.063 Executing on host: lxc remote add craft-com.ubuntu.cloud-buildd https://cloud-images.ubuntu.com/buildd/releases --protocol=simplestreams
2024-01-02 11:27:02.098 Remote 'craft-com.ubuntu.cloud-buildd' was successfully added.
2024-01-02 11:27:02.099 Executing on host: lxc project list local: --format=yaml
2024-01-02 11:27:02.139 Executing on host: lxc --project charmcraft project create local:charmcraft
2024-01-02 11:27:02.180 Executing on host: lxc --project default profile show local:default
2024-01-02 11:27:02.233 Executing on host: lxc --project charmcraft profile edit local:default
2024-01-02 11:27:02.285 Set LXD instance name to 'charmcraft-istio-gateway-on-amd64-for-amd64-779228'
2024-01-02 11:27:02.286 Checking for instance 'charmcraft-istio-gateway-on-amd64-for-amd64-779228' in project 'charmcraft' in remote 'local'
2024-01-02 11:27:02.286 Executing on host: lxc --project charmcraft list local: --format=yaml
2024-01-02 11:27:02.331 Instance 'charmcraft-istio-gateway-on-amd64-for-amd64-779228' does not exist.
2024-01-02 11:27:02.331 Set LXD instance name to 'base-instance-charmcraft-buildd-base-v4--b6028d8e72f849bc5897'
2024-01-02 11:27:02.331 Checking for base instance 'base-instance-charmcraft-buildd-base-v4--b6028d8e72f849bc5897' in project 'charmcraft' in remote 'local'
2024-01-02 11:27:02.332 Executing on host: lxc --project charmcraft list local: --format=yaml
2024-01-02 11:27:02.376 Base instance 'base-instance-charmcraft-buildd-base-v4--b6028d8e72f849bc5897' does not exist.
2024-01-02 11:27:02.376 Creating new instance from remote
2024-01-02 11:27:02.376 Creating new base instance from remote
2024-01-02 11:27:02.376 Creating new base instance from image 'core20' from remote 'craft-com.ubuntu.cloud-buildd'
2024-01-02 11:27:02.376 Executing on host: lxc --project charmcraft info local:
2024-01-02 11:27:02.451 Executing on host: lxc --project charmcraft launch craft-com.ubuntu.cloud-buildd:core20 local:base-instance-charmcraft-buildd-base-v4--b6028d8e72f849bc5897 --config 'raw.idmap=both 1001 0' --config security.syscalls.intercept.mknod=true --config user.craft_providers.status=STARTING --config user.craft_providers.timer=2024-01-02T11:27:02.451795+00:00 --config user.craft_providers.pid=16830
2024-01-02 11:27:02.019 Starting charmcraft
2024-01-02 11:27:02.020 charmcraft internal error: FileExistsError(17, 'File exists')
2024-01-02 11:27:02.022 Traceback (most recent call last):
2024-01-02 11:27:02.022   File "/snap/charmcraft/2180/lib/python3.10/site-packages/craft_application/application.py", line 375, in run
2024-01-02 11:27:02.022     self._configure_services(platform, build_for)
2024-01-02 11:27:02.022   File "/snap/charmcraft/2180/lib/python3.10/site-packages/charmcraft/application/main.py", line 107, in _configure_services
2024-01-02 11:27:02.022     cache_dir=self.cache_dir,
2024-01-02 11:27:02.022   File "/snap/charmcraft/2180/lib/python3.10/site-packages/craft_application/application.py", line 185, in cache_dir
2024-01-02 11:27:02.022     return save_cache_path(self.app.name)  # type: ignore[no-any-return]
2024-01-02 11:27:02.022   File "/snap/charmcraft/2180/lib/python3.10/site-packages/xdg/BaseDirectory.py", line 84, in save_cache_path
2024-01-02 11:27:02.022     os.makedirs(path)
2024-01-02 11:27:02.022   File "/snap/charmcraft/2180/bin/../usr/lib/python3.10/os.py", line 225, in makedirs
2024-01-02 11:27:02.022     mkdir(name, mode)
2024-01-02 11:27:02.022 FileExistsError: [Errno 17] File exists: '/home/runner/snap/charmcraft/common/cache/charmcraft'
2024-01-02 11:27:02.022 Full execution log: '/home/runner/.local/state/charmcraft/log/charmcraft-20240102-112702.018439.log'
DnPlas added a commit to canonical/istio-operators that referenced this issue Jan 3, 2024
Use the latest candidate version of charmcraft to avoid potential issues with the
edge version of charmcraft.
This commit is specifically reacting to canonical/craft-application#167
@syu-w syu-w closed this as completed in #169 Jan 3, 2024
DnPlas added a commit to canonical/istio-operators that referenced this issue Jan 4, 2024
* ci: use charmcraft latest/candidate instead of latest/edge

Use the latest candidate version of charmcraft to avoid potential issues with the
edge version of charmcraft.
This commit is specifically reacting to canonical/craft-application#167

NOTE: this change makes sure that the repository is aligned with our other repositories, most of them (with very few exceptions) point to latest/candidate.
lengau pushed a commit that referenced this issue Jul 16, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant