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

pdm update stuck for 17 minutes then raises msgpack.exceptions.ExtraData: unpack(b) received extra data #3319

Closed
1 task
Fak3 opened this issue Nov 29, 2024 · 1 comment · Fixed by #3321
Closed
1 task
Assignees
Labels
🐛 bug Something isn't working

Comments

@Fak3
Copy link
Contributor

Fak3 commented Nov 29, 2024

Describe the bug

Trying to update package causes pdm to loop for 17 minutes, then throws exception msgpack.exceptions.ExtraData: unpack(b) received extra data

Reproducible: always

Logfile: https://github.com/Fak3/pdm_long_loop/blob/main/pdm-lock-u3i0m86p.tar.xz

To reproduce

Prepare:

git clone https://github.com/Fak3/pdm_long_loop.git
cd pdm_long_loop
pdm use
pdm venv create
eval $(pdm venv activate)

run:

pdm update httpx

Expected Behavior

Pdm should update a package or print a message if solution cannot be found.

Environment Information

PDM version:
2.20.1
Python Interpreter:
/home/z/pproj/pdm_msgpack_error/.venv/bin/python (3.12)
Project Root:
/home/z/pproj/pdm_msgpack_error
Local Packages:

{
"implementation_name": "cpython",
"implementation_version": "3.11.10",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_release": "6.11.6-2-default",
"platform_system": "Linux",
"platform_version": "#1 SMP PREEMPT_DYNAMIC Mon Nov 4 08:15:48 UTC 2024 (8545f24)",
"python_full_version": "3.12.7",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "linux"
}

pdm -v output

pdm -v
Usage: pdm [-h] [-V] [-c CONFIG] [-v | -q] [--no-cache] [-I] [--pep582 [SHELL]] [-n] ...

____  ____  __  ___

/ __ / __ / |/ /
/ // / / / / /|/ /
/ / // / / / /
/
/ /_____/
/ /
/

Options:
-h, --help Show this help message and exit.
-V, --version Show the version and exit
-c CONFIG, --config CONFIG
Specify another config file path [env var: PDM_CONFIG_FILE]
-v, --verbose Use -v for detailed output and -vv for more detailed
-q, --quiet Suppress output
--no-cache Disable the cache for the current command. [env var: PDM_NO_CACHE]
-I, --ignore-python Ignore the Python path saved in .pdm-python. [env var: PDM_IGNORE_SAVED_PYTHON]
--pep582 [SHELL] Print the command line to be eval'd by the shell for PEP 582
-n, --non-interactive
Don't show interactive prompts but use defaults. [env var: PDM_NON_INTERACTIVE]

Commands:
add Add package(s) to pyproject.toml and install them
build Build artifacts for distribution
cache Control the caches of PDM
completion Generate completion scripts for the given shell
config Display the current configuration
export Export the locked packages set to other formats
fix Fix the project problems according to the latest version of PDM
import Import project metadata from other formats
info Show the project information
init Initialize a pyproject.toml for PDM. Built-in templates: - default: pdm init, A simple template with a
basic structure. - minimal: pdm init minimal, A minimal template with only pyproject.toml.
install Install dependencies from lock file
list List packages installed in the current working set
lock Resolve and lock dependencies
outdated Check for outdated packages and list the latest versions on indexes.
publish Build and publish the project to PyPI
python (py) Manage installed Python interpreters
remove Remove packages from pyproject.toml
run Run commands or scripts with local packages loaded
search Search for PyPI packages
self (plugin) Manage the PDM program itself (previously known as plugin)
show Show the package information
sync Synchronize the current working set with lock file
update Update package(s) in pyproject.toml
use Use the given python version or path as base interpreter. If not found, PDM will try to install one.
venv Virtualenv management
shell Set PATH and PYTHONPATH in the current shell

Additional Context

After the pdm cache is filled, the command pdm update httpx immediately fails with exception msgpack.exceptions.ExtraData: unpack(b) received extra data

If you clear cache as described in #2745, then command pdm update httpx will again fill cache for 17 minutes, then fail with error: msgpack.exceptions.ExtraData: unpack(b) received extra data

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@Fak3 Fak3 added the 🐛 bug Something isn't working label Nov 29, 2024
@frostming frostming self-assigned this Nov 29, 2024
frostming added a commit that referenced this issue Nov 29, 2024
@frostming
Copy link
Collaborator

You encountered a bad case in resolution performance that would be improved by #3321

frostming added a commit that referenced this issue Nov 29, 2024
frostming added a commit that referenced this issue Nov 29, 2024
…ssible (#3321)

* fix: Speed up the resolution by only resolving wheel candidates if possible
Fixes #3319

Signed-off-by: Frost Ming <[email protected]>

* fix news

Signed-off-by: Frost Ming <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants