Skip to content

Add error trace to invalid package format#15626

Merged
konstin merged 1 commit intomainfrom
konsti/show-error-trace-for-broken-package-layout
Sep 2, 2025
Merged

Add error trace to invalid package format#15626
konstin merged 1 commit intomainfrom
konsti/show-error-trace-for-broken-package-layout

Conversation

@konstin
Copy link
Member

@konstin konstin commented Sep 2, 2025

In #11636, we're getting reports for installation flakes that report an invalid package format for what appears to be a network problem. Since we're cutting the error reporting to the first error message in the chain, we're not reporting the actual network error underneath it.

This PR displays the whole error chain for invalid package format errors, so we can debug and eventually catch-and-retry #11636.

In #11636, we're getting reports for installation flakes that report an invalid package format for what appears to be a network problem. Since we're cutting the error reporting to the first error message in the chain, we're not reporting the actual network error underneath it.

This PR displays the whole error chain for invalid package format errors, so we can debug and eventually catch-and-retry #11636.
@konstin konstin requested a review from zanieb September 2, 2025 11:47
@konstin konstin added the error messages Messaging when something goes wrong label Sep 2, 2025

/// Display the error chain for unavailable packages.
#[derive(Debug, Clone)]
pub struct UnavailableErrorChain(Arc<dyn std::error::Error + Send + Sync + 'static>);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name and location of the type is up for bikeshedding. Maybe we want a generic version in uv-warnings?

Comment on lines +2625 to +2627
hint: The structure of `foo` was invalid
Caused by: Failed to read from zip file
Caused by: unable to locate the end of central directory record
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a chance here that user's mistake this hint for an error message (since we're using the familiar error format), not sure if we can make it clearer that the resolution error trace above is the actual error.

@konstin konstin merged commit 19e19d5 into main Sep 2, 2025
180 of 181 checks passed
@konstin konstin deleted the konsti/show-error-trace-for-broken-package-layout branch September 2, 2025 13:22
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 5, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.14` -> `0.8.15` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.8.15`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0815)

[Compare Source](astral-sh/uv@0.8.14...0.8.15)

##### Python

- Upgrade SQLite 3.50.4 in CPython builds for [CVE-2025-6965](GHSA-2m69-gcr7-jv3q) (see also [python/cpython#137134](python/cpython#137134))

##### Enhancements

- Add `uv auth` commands for credential management ([#&#8203;15570](astral-sh/uv#15570))
- Add pyx support to `uv auth` commands ([#&#8203;15636](astral-sh/uv#15636))
- Add `uv tree --show-sizes` to show package sizes ([#&#8203;15531](astral-sh/uv#15531))
- Add `--python-platform riscv64-unknown-linux` ([#&#8203;15630](astral-sh/uv#15630))
- Add `--python-platform` to `uv run` and `uv tool` ([#&#8203;15515](astral-sh/uv#15515))
- Add `uv publish --dry-run` ([#&#8203;15638](astral-sh/uv#15638))
- Add zstandard support for wheels ([#&#8203;15645](astral-sh/uv#15645))
- Allow registries to pre-provide core metadata ([#&#8203;15644](astral-sh/uv#15644))
- Retry streaming Python and binary download errors ([#&#8203;15567](astral-sh/uv#15567))

##### Bug fixes

- Fix settings rendering for `extra-build-dependencies` ([#&#8203;15622](astral-sh/uv#15622))
- Skip non-existent directories in bytecode compilation ([#&#8203;15608](astral-sh/uv#15608))

##### Error messages

- Add error trace to invalid package format ([#&#8203;15626](astral-sh/uv#15626))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45My4zIiwidXBkYXRlZEluVmVyIjoiNDEuOTMuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Messaging when something goes wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants