poetry: Poetry 1.3 dies when run with a TTY reporting size 0/0

  • Poetry version: 1.3.1
  • Python version: 3.10
  • OS version and name: Ubuntu 20.04
  • pyproject.toml: pyproject.toml
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Running as part of a circle ci workflow. Steps below. The command poetry install identifies the Package Operations and then exits with code 1. (output below) SSH into the box and running poetry install produces the normal expected behavior.

workflow steps

...
pyenv global 3.10.2
pip install poetry==1.2.2
export PATH="/home/circleci/.local/bin:$PATH"

poetry install -vvv
...

###Poetry Install Step

#!/bin/bash -eo pipefail
poetry install -vvv

Creating virtualenv fastapi-template-repository-3aSsmiER-py3.10 in /home/circleci/.cache/pypoetry/virtualenvs
Using virtualenv: /home/circleci/.cache/pypoetry/virtualenvs/fastapi-template-repository-3aSsmiER-py3.10
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 71 installs, 1 update, 0 removals


Exited with code exit status 1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 48
  • Comments: 39 (9 by maintainers)

Commits related to this issue

Most upvoted comments

FYI a workaround is to run with --no-ansi as I stumbled upon this error and then while debugging used that option to clear up some of the output and things ran succesfully.

--no-ansi worked for me too.

I’m testing a github action workflow and the poetry installation failed when this flag is not passed in. Surprisingly, it worked fine in github CI, but failed when testing this workflow locally using act.

After hours of debugging poetry install --no-ansi

--no-ansi solved our issue.

For current status, we’ve got a proposed fix here from me that won’t get accepted as per @neersighted 's comment and a better fix here from the cleo maintainer @Secrus , that unfortunately doesn’t yet solve the problem. As I understand, we’re waiting on @Secrus to fix and then merge&release that PR.

Until then, all versions of Poetry v1.3+ on CircleCI and Buildkite (maybe others?) are broken for any commands not using the --no-ansi flag.

Just confirming that I also faced this bug and that using poetry install --no-ansi did the trick.

@rlgomes you’ve fixed our work deployment pipeline! Thanks. --no-ansi makes poetry install work as intended, on the cimg/python:3.8 docker image at least.

A user on Discord has been debugging this as well, it appears to only happen in CircleCI when using the same base image. I’ve asked that user to post the debugging they’ve done here, but the basic thing we know right now is that Poetry is receiving a SIGINT right after printing the installer summary (determined via an strace).

Had the same problem this morning with the latest poetry. Pinning back to 1.2.2 during the build solves the issue.

@iainelder it was closed because the PR with the solution was merged. It will be visible after Cleo gets a new release (it’s close, probably sometime in mid-July).

We’ve been experiencing this issue with poetry install and poetry update (and self update) on circleci. I just tested out a self update to use Poetry version 1.4, and it seems the issue still exists. (The release notes didn’t indicate otherwise, but in case that confirmation is helpful)

FWIW, I ran into this issue when using ray which runs some setup commands. The resulting command looked like the following:

ssh -tt -i ~/ray_bootstrap_key.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ExitOnForwardFailure=yes -o ServerAliveInterval=5 -o ServerAliveCountMax=3 -o ControlMaster=auto -o ControlPath=/tmp/ray_ssh_X/Y/%C -o ControlPersist=10s -o ConnectTimeout=120s ubuntu@WORKER_IP 'bash --login -c -i '"'"'true && source ~/.bashrc && export OMP_NUM_THREADS=1 PYTHONWARNINGS=ignore && (export RAY_HEAD_IP=HEAD_IP; cd /tmp/library; POETRY_VIRTUALENVS_CREATE=0 /home/ubuntu/.local/bin/poetry install)'"'"

When executed by ray, it would fail. If I executed the same thing from a shell on the head node it would be successful.

--no-ansi resolved the issue.

–no-ansi to the rescue, worked for us

This is an old work account. Please reference @brandonchinn178 for all future communication


I also see this happen in python versions 3.8 to 3.10, but it doesn’t happen on 3.11 (both cimg/python:3.x and python:3.x). It also succeeds if you SSH in and manually run poetry install. I’m also unable to repro with Docker. Overall, very frustrating to debug 😢