poetry: Potential thread safety issue under certain environments: Incorrectly nested style tag found
In certain environments, specifically CI environments, this issue occurs randomly. It would seem that when using the new executor for installation the io
being used is not thread safe and pastel
fails attempting to pop the wrong stack.
• Installing glob2 (0.6)
ValueError
Incorrectly nested style tag found.
• Installing httpretty (0.9.7)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 33 (14 by maintainers)
Commits related to this issue
- Test workflow: pin Poetry to 1.0.10 ... until the issues with 1.1.x have been resolved. See https://github.com/python-poetry/poetry/issues/3010 — committed to brechtm/rinohtype by brechtm 4 years ago
- disable poetry new installer https://github.com/python-poetry/poetry/issues/3010 — committed to brettlangdon/sysaudit by brettlangdon 3 years ago
- disable poetry new installer (#6) https://github.com/python-poetry/poetry/issues/3010 — committed to brettlangdon/sysaudit by brettlangdon 3 years ago
- Disabled poetry experimental new installer Workaround of https://github.com/python-poetry/poetry/issues/3010 — committed to honnix/dependabot-core by honnix 3 years ago
- ci: disable poetry installer.parallel Doing poetry install causes CPU usage to reach ~100% for an instance that has only one CPU. Possible relevant issues https://github.com/python-poetry/poetry/iss... — committed to paxcodes/portfolio_api by paxcodes 3 years ago
- ci: disable poetry installer.parallel Doing poetry install causes CPU usage to reach ~100% for an instance that has only one CPU. Possible relevant issues https://github.com/python-poetry/poetry/iss... — committed to paxcodes/dicery_backend by paxcodes 3 years ago
- Workaround thread safety issue by limiting worker count The original intent of this code was to workaround a thread safety issue. However, according to the `poetry` maintainer, the more "future proof... — committed to jeffwidman/dependabot-core by jeffwidman 2 years ago
- Workaround thread safety issue by limiting worker count The original intent of this code was to workaround a thread safety issue. However, according to the `poetry` maintainer, the more "future proof... — committed to jeffwidman/dependabot-core by jeffwidman 2 years ago
- Workaround thread safety issue by limiting worker count The original intent of this code was to workaround a thread safety issue. However, according to the `poetry` maintainer, the more "future proof... — committed to jeffwidman/dependabot-core by jeffwidman 2 years ago
- Remove workaround that's now ignored This was added in https://github.com/dependabot/dependabot-core/pull/3459/ to workaround the underlying issue of https://github.com/python-poetry/poetry/issues/30... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Stop disabling new `poetry` installer This was added in https://github.com/dependabot/dependabot-core/pull/3459/ to workaround the underlying issue of https://github.com/python-poetry/poetry/issues/3... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Stop disabling new `poetry` installer This was added in https://github.com/dependabot/dependabot-core/pull/3459/ to workaround the underlying issue of https://github.com/python-poetry/poetry/issues/3... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Stop disabling new `poetry` installer This was added in https://github.com/dependabot/dependabot-core/pull/3459/ to workaround the underlying issue of https://github.com/python-poetry/poetry/issues/3... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
- Revert "Python: skip flaky poetry spec with issue comment" The associated ticket on Poetry (https://github.com/python-poetry/poetry/issues/3010) was closed because the underlying triggers were mostly... — committed to dependabot/dependabot-core by jeffwidman 2 years ago
I also have this problem when doing poetry (1.1.2) install in gitlab. The workaround is to disable the new installer:
poetry config experimental.new-installer false
it seems to fail at a random point or sometimes not at all.
The installer is better in a few aspects outside of performance. Using
installer.max-workers=1
would be what I recommend since the old one is due to be removed. And realistically, I do not think these edge cases can be handled at poetry level outside of a retry logic somewhere (which can lead to other issues) untill we droppip
as the wheel installer. That said, this particular issue, iirc has been fixed in newer versions ofpip
, so either doingpoetry run python -m pip --upgrade pip
or using1.2
should resolve the issue. Feel free to reach out on discord if that helps.@michalszelagsonos the issue is likely due to the parallel execution of multiple
pip
instances. In your casepygments
being updated means the existing directory was deleted during the update, but before that it was listed as an existing path in another instance of pip (installation oftraitlets
) executing a callfind_distributions
which then tries to list files in this path.You can workaround this by setting workers to 1. Also, try updating
pip
.PS: I would recommend not disabling virtual environment creation, as sharing the system environment with poetry and other installations will only cause headaches. Besides, having a venv should reduce the probability of this collission.
Further,
1.2
should also improve this situation by not relying on system environmentpip
versions.