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

BUG: OSError: Handle is invalid during execution. #271

Open
tobiasraabe opened this issue May 5, 2022 · 22 comments
Open

BUG: OSError: Handle is invalid during execution. #271

tobiasraabe opened this issue May 5, 2022 · 22 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@tobiasraabe
Copy link
Member

tobiasraabe commented May 5, 2022

Code Sample, a copy-pastable example

image

Problem description

I don't know how this error can be reproduced, but it occurred

  • while running workflows with many tasks
  • on Windows
  • with and without pytask-parallel
  • even with pytask -v0

Work-around

Run pytask in the Windows Subsystem for Linux (WSL).

Reports

To collect information on this issue, please report the packages in your environment and run python -m rich.diagnose.

@tobiasraabe tobiasraabe added bug Something isn't working help wanted Extra attention is needed labels May 5, 2022
@vsondergeld
Copy link

vsondergeld commented Jun 17, 2022

Hi, I had the same problem and could work around it only by modifying the environment. I set pytask back to 0.0.14. Then everything worked again.

@tobiasraabe
Copy link
Member Author

Hi @vsondergeld, thank you for the confirmation and sorry for the inconvenience. v0.0.14 is pretty old. Which versions have you tested until you settled on this one? It could help me to track down the problem.

@vsondergeld
Copy link

Yeah I assumed it was the oldest one possible since it said one needs >= 0.0.14. I had tried setting <0.2 before which gave me 0.1.9, but that didnt work. So I just went for the oldest one for now and have not systematically tried out those between. If I do this in the next days, I will let you know.

@tobiasraabe
Copy link
Member Author

I tried to replicate the issue with an artificial and the project mentioned above. In a freshly set up environment, the issue does not occur anymore. Maybe a newer version of rich or some other dependency might have fixed the problem? Do you still experience the issue when you start with a new env, @vsondergeld? 🤞

@ChristianZimpelmann
Copy link
Contributor

ChristianZimpelmann commented Aug 29, 2022

I also have the same error occasionally (roughly every 15th-30th run).

  • os: Microsoft Windows 10 Pro (Version 10.0.19044 Build 19044)
  • Console: Terminal (for windows)
  • conda environment: see below

Let me know if you need any further information.

conda environment

_r-mutex 1.0.1 anacondar_1 conda-forge
abseil-cpp 20211102.0 h7e5c4e1_2 conda-forge
alabaster 0.7.12 py_0 conda-forge
anyio 3.6.1 pyhd8ed1ab_1 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py39hb82d6ee_2 conda-forge
arrow-cpp 9.0.0 py39h7fadbf2_1_cpu conda-forge
astor 0.8.1 pypi_0 pypi
asttokens 2.0.8 pyhd8ed1ab_0 conda-forge
atomicwrites 1.4.1 pyhd8ed1ab_0 conda-forge
attrs 22.1.0 pyh71513ae_1 conda-forge
aws-c-cal 0.5.11 he19cf47_0 conda-forge
aws-c-common 0.6.2 h8ffe710_0 conda-forge
aws-c-event-stream 0.2.7 h70e1b0c_13 conda-forge
aws-c-io 0.10.5 h2fe331c_0 conda-forge
aws-checksums 0.1.11 h1e232aa_7 conda-forge
aws-sdk-cpp 1.8.186 hb0612c5_3 conda-forge
babel 2.10.3 pyhd8ed1ab_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
black 22.6.0 py39hcbf5309_2 conda-forge
bleach 5.0.1 pyhd8ed1ab_0 conda-forge
bokeh 2.4.3 pyhd8ed1ab_3 conda-forge
brotli 1.0.9 h8ffe710_7 conda-forge
brotli-bin 1.0.9 h8ffe710_7 conda-forge
brotlipy 0.7.0 py39hb82d6ee_1004 conda-forge
bzip2 1.0.8 h8ffe710_4 conda-forge
c-ares 1.18.1 h8ffe710_0 conda-forge
ca-certificates 2022.6.15 h5b45459_0 conda-forge
certifi 2022.6.15 pyhd8ed1ab_1 conda-forge
cffi 1.15.1 py39h0878f49_0 conda-forge
cfgv 3.3.1 pypi_0 pypi
chardet 5.0.0 py39hcbf5309_0 conda-forge
charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge
click 8.1.3 py39hcbf5309_0 conda-forge
click-default-group 1.2.2 pyhd8ed1ab_1 conda-forge
cloudpickle 2.1.0 pyhd8ed1ab_0 conda-forge
colorama 0.4.5 pyhd8ed1ab_0 conda-forge
commonmark 0.9.1 py_0 conda-forge
conda 4.14.0 py39hcbf5309_0 conda-forge
conda-build 3.22.0 py39hcbf5309_2 conda-forge
conda-package-handling 1.8.1 py39hb3671d1_1 conda-forge
cryptography 37.0.4 py39h7bc7c5c_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
cython 0.29.32 pypi_0 pypi
dataclasses 0.8 pyhc8e2a94_3 conda-forge
debugpy 1.6.3 py39h415ef7b_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
dill 0.3.5.1 pypi_0 pypi
distlib 0.3.6 pypi_0 pypi
docutils 0.19 py39hcbf5309_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
et_xmlfile 1.0.1 py_1001 conda-forge
executing 0.10.0 pyhd8ed1ab_0 conda-forge
fancycompleter 0.9.1 py39hcbf5309_1003 conda-forge
filelock 3.8.0 pyhd8ed1ab_0 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
fonttools 4.37.1 py39hb82d6ee_0 conda-forge
formulaic 0.3.4 pypi_0 pypi
freetype 2.12.1 h546665d_0 conda-forge
future 0.18.2 py39hcbf5309_5 conda-forge
fuzzywuzzy 0.18.0 pyhd8ed1ab_0 conda-forge
gflags 2.2.2 ha925a31_1004 conda-forge
glob2 0.7 py_0 conda-forge
glog 0.6.0 h4797de2_0 conda-forge
greenlet 1.1.3 py39h415ef7b_0 conda-forge
grpc-cpp 1.46.4 hdcb116f_3 conda-forge
identify 2.5.3 pypi_0 pypi
idna 3.3 pyhd8ed1ab_0 conda-forge
imagesize 1.4.1 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.4 py39hcbf5309_0 conda-forge
importlib_metadata 4.11.4 hd8ed1ab_0 conda-forge
importlib_resources 5.9.0 pyhd8ed1ab_0 conda-forge
iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge
intel-openmp 2022.1.0 h57928b3_3787 conda-forge
interface-meta 1.3.0 pypi_0 pypi
ipykernel 6.15.1 pyh025b116_0 conda-forge
ipython 8.4.0 pyh08f2357_1 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.18.1 pyhd8ed1ab_2 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9e h8ffe710_2 conda-forge
json5 0.9.5 pyh9f0ad1d_0 conda-forge
jsonschema 4.14.0 pyhd8ed1ab_0 conda-forge
jupyter_client 7.3.5 pyhd8ed1ab_0 conda-forge
jupyter_core 4.11.1 py39hcbf5309_0 conda-forge
jupyter_server 1.18.1 pyhd8ed1ab_0 conda-forge
jupyterlab 3.4.5 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.15.1 pyhd8ed1ab_0 conda-forge
kiwisolver 1.4.4 py39h2e07f2f_0 conda-forge
klepto 0.2.2 pypi_0 pypi
kmodes 0.12.1 pyhd8ed1ab_0 conda-forge
krb5 1.19.3 h1176d77_0 conda-forge
latex-dependency-scanner 0.1.1 pyhd8ed1ab_1 conda-forge
latexcodec 2.0.1 pyh9f0ad1d_0 conda-forge
lcms2 2.12 h2a16943_0 conda-forge
lerc 4.0.0 h63175ca_0 conda-forge
libabseil-static 20211102.0 cxx11_h253ae9c_2 conda-forge
libarchive 3.5.2 hb45042f_3 conda-forge
libblas 3.9.0 16_win64_mkl conda-forge
libbrotlicommon 1.0.9 h8ffe710_7 conda-forge
libbrotlidec 1.0.9 h8ffe710_7 conda-forge
libbrotlienc 1.0.9 h8ffe710_7 conda-forge
libcblas 3.9.0 16_win64_mkl conda-forge
libcrc32c 1.1.2 h0e60522_0 conda-forge
libcurl 7.83.1 h789b8ee_0 conda-forge
libdeflate 1.13 h8ffe710_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libgoogle-cloud 1.40.2 hbb088ed_0 conda-forge
libiconv 1.16 he774522_0 conda-forge
liblapack 3.9.0 16_win64_mkl conda-forge
liblief 0.12.1 h0e60522_0 conda-forge
libpng 1.6.37 h1d00b33_4 conda-forge
libprotobuf 3.20.1 h7755175_1 conda-forge
libsodium 1.0.18 h8d14728_1 conda-forge
libsqlite 3.39.2 h8ffe710_1 conda-forge
libssh2 1.10.0 h680486a_3 conda-forge
libthrift 0.16.0 h636ae23_1 conda-forge
libtiff 4.4.0 h92677e6_3 conda-forge
libutf8proc 2.7.0 hcb41399_0 conda-forge
libwebp-base 1.2.4 h8ffe710_0 conda-forge
libxcb 1.13 hcd874cb_1004 conda-forge
libxml2 2.9.14 hf5bbc77_4 conda-forge
libxslt 1.1.35 h34f844d_0 conda-forge
libzlib 1.2.12 h8ffe710_2 conda-forge
linearmodels 4.27 pypi_0 pypi
llvmlite 0.38.1 py39ha0cd8c8_0 conda-forge
loky 3.1.0 pyhd8ed1ab_0 conda-forge
lxml 4.9.1 py39hb82d6ee_0 conda-forge
lz4-c 1.9.3 h8ffe710_1 conda-forge
lzo 2.10 he774522_1000 conda-forge
m2-msys2-runtime 2.5.0.17080.65c939c 3 conda-forge
m2-patch 2.7.5 2 conda-forge
m2w64-bwidget 1.9.10 2 conda-forge
m2w64-bzip2 1.0.6 6 conda-forge
m2w64-expat 2.1.1 2 conda-forge
m2w64-fftw 3.3.4 6 conda-forge
m2w64-flac 1.3.1 3 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gettext 0.19.7 2 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-gsl 2.1 2 conda-forge
m2w64-icu 58.2 2 conda-forge
m2w64-libiconv 1.14 6 conda-forge
m2w64-libjpeg-turbo 1.4.2 3 conda-forge
m2w64-libogg 1.3.2 3 conda-forge
m2w64-libpng 1.6.21 2 conda-forge
m2w64-libsndfile 1.0.26 2 conda-forge
m2w64-libtiff 4.0.6 2 conda-forge
m2w64-libvorbis 1.3.5 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
m2w64-libxml2 2.9.3 3 conda-forge
m2w64-mpfr 3.1.4 4 conda-forge
m2w64-nlopt 2.4.2 3 conda-forge
m2w64-pcre2 10.34 0 conda-forge
m2w64-speex 1.2rc2 3 conda-forge
m2w64-speexdsp 1.2rc3 3 conda-forge
m2w64-tcl 8.6.5 3 conda-forge
m2w64-tk 8.6.5 3 conda-forge
m2w64-tktable 2.10 5 conda-forge
m2w64-wineditline 2.101 5 conda-forge
m2w64-xz 5.2.2 2 conda-forge
m2w64-zlib 1.2.8 10 conda-forge
markupsafe 2.1.1 py39hb82d6ee_1 conda-forge
matplotlib-base 3.5.3 py39he03a255_2 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
menuinst 1.4.19 py39hcbf5309_0 conda-forge
mistune 2.0.4 pyhd8ed1ab_0 conda-forge
mkl 2022.1.0 h6a75c08_874 conda-forge
mpmath 1.2.1 pypi_0 pypi
msys2-conda-epoch 20160418 1 conda-forge
multiprocess 0.70.13 pypi_0 pypi
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mypy_extensions 0.4.3 py39hcbf5309_5 conda-forge
mystic 0.3.9 pypi_0 pypi
nb_black 1.0.7 py_0 conda-forge
nbclassic 0.4.3 pyhd8ed1ab_0 conda-forge
nbclient 0.6.7 pyhd8ed1ab_0 conda-forge
nbconvert 7.0.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.0.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 7.0.0 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
networkx 2.8.6 pyhd8ed1ab_0 conda-forge
nodeenv 1.7.0 pypi_0 pypi
nodejs 18.8.0 h57928b3_0 conda-forge
notebook 6.4.12 pyha770c72_0 conda-forge
notebook-shim 0.1.0 pyhd8ed1ab_0 conda-forge
numba 0.55.2 py39hb8cd55e_0 conda-forge
numpy 1.22.4 py39h0948cea_0 conda-forge
openjpeg 2.5.0 hc9384bd_1 conda-forge
openpyxl 3.0.9 pyhd8ed1ab_0 conda-forge
openssl 1.1.1q h8ffe710_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.3 py39h2e25243_0 conda-forge
pandoc 2.19.2 h57928b3_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parquet-cpp 1.5.1 2 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pathos 0.2.9 pypi_0 pypi
pathspec 0.9.0 pyhd8ed1ab_0 conda-forge
patsy 0.5.2 pyhd8ed1ab_0 conda-forge
pdbpp 0.10.3 pyhd8ed1ab_0 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.2.0 py39hcef8f5f_2 conda-forge
pip 22.2.2 pyhd8ed1ab_0 conda-forge
pkginfo 1.8.3 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
platformdirs 2.5.2 pyhd8ed1ab_1 conda-forge
plotly 5.10.0 pyhd8ed1ab_0 conda-forge
pluggy 1.0.0 py39hcbf5309_3 conda-forge
pony 0.7.16 pyhd8ed1ab_0 conda-forge
pox 0.3.1 pypi_0 pypi
ppft 1.7.6.5 pypi_0 pypi
pre-commit 2.20.0 pypi_0 pypi
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.30 pyha770c72_0 conda-forge
property-cached 1.6.4 pypi_0 pypi
psutil 5.9.1 py39hb82d6ee_0 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
py 1.11.0 pyh6c4a22f_0 conda-forge
py-lief 0.12.1 py39h415ef7b_0 conda-forge
pyarrow 9.0.0 py39h0aced47_1_cpu conda-forge
pybaum 0.1.2 pyhd8ed1ab_0 conda-forge
pybtex 0.24.0 pyhd8ed1ab_2 conda-forge
pybtex-docutils 1.0.2 py39hcbf5309_1 conda-forge
pycosat 0.6.3 py39hb82d6ee_1010 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.13.0 pyhd8ed1ab_0 conda-forge
pyhdfe 0.1.0 pypi_0 pypi
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyreadline 2.1 py39hcbf5309_1006 conda-forge
pyrsistent 0.18.1 py39hb82d6ee_1 conda-forge
pysocks 1.7.1 py39hcbf5309_5 conda-forge
pytask 0.2.5 pyhd8ed1ab_0 conda-forge
pytask-latex 0.2.1 pyhd8ed1ab_0 conda-forge
pytask-parallel 0.2.1 pyhd8ed1ab_0 conda-forge
pytask-r 0.2.0 pyhd8ed1ab_0 conda-forge
pytest 7.1.2 py39hcbf5309_0 conda-forge
python 3.9.13 h9a09f29_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.16.1 pyhd8ed1ab_0 conda-forge
python-levenshtein 0.12.2 py39hb82d6ee_2 conda-forge
python-libarchive-c 4.0 py39hcbf5309_1 conda-forge
python-tzdata 2022.2 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.2.1 pyhd8ed1ab_0 conda-forge
pytz-deprecation-shim 0.1.0.post0 py39hcbf5309_2 conda-forge
pywin32 303 py39hb82d6ee_0 conda-forge
pywinpty 2.0.7 py39h99910a6_0 conda-forge
pyyaml 6.0 py39hb82d6ee_4 conda-forge
pyzmq 23.2.1 py39he46f08e_0 conda-forge
r-abind 1.4_5 r41hc72bb7e_1003 conda-forge
r-aer 1.2_10 r41hc72bb7e_0 conda-forge
r-arrow 9.0.0 r41h57928b3_0 conda-forge
r-askpass 1.1 r41h6d2157b_2 conda-forge
r-assertthat 0.2.1 r41hc72bb7e_2 conda-forge
r-backports 1.4.1 r41h6d2157b_0 conda-forge
r-base 4.1.3 hddad469_1 conda-forge
r-bit 4.0.4 r41h6d2157b_0 conda-forge
r-bit64 4.0.5 r41h6d2157b_0 conda-forge
r-boot 1.3_28 r41hc72bb7e_0 conda-forge
r-brio 1.1.3 r41h6d2157b_0 conda-forge
r-broom 1.0.0 r41hc72bb7e_0 conda-forge
r-callr 3.7.2 r41hc72bb7e_0 conda-forge
r-car 3.1_0 r41hc72bb7e_0 conda-forge
r-cardata 3.0_5 r41hc72bb7e_0 conda-forge
r-caret 6.0_93 r41h6d2157b_0 conda-forge
r-cellranger 1.1.0 r41hc72bb7e_1004 conda-forge
r-class 7.3_20 r41h6d2157b_0 conda-forge
r-cli 3.3.0 r41ha856d6a_0 conda-forge
r-clipr 0.8.0 r41hc72bb7e_0 conda-forge
r-codetools 0.2_18 r41hc72bb7e_0 conda-forge
r-colorspace 2.0_3 r41h6d2157b_0 conda-forge
r-conquer 1.3.0 r41h01f9f87_0 conda-forge
r-cpp11 0.4.2 r41hc72bb7e_0 conda-forge
r-crayon 1.5.1 r41hc72bb7e_0 conda-forge
r-curl 4.3.2 r41h6d2157b_0 conda-forge
r-data.table 1.14.2 r41h6d2157b_0 conda-forge
r-desc 1.4.1 r41hc72bb7e_0 conda-forge
r-desctools 0.99.45 r41h96779af_0 conda-forge
r-diffobj 0.3.5 r41h6d2157b_0 conda-forge
r-digest 0.6.29 r41ha856d6a_0 conda-forge
r-dplyr 1.0.9 r41ha856d6a_0 conda-forge
r-e1071 1.7_11 r41ha856d6a_0 conda-forge
r-ellipsis 0.3.2 r41h6d2157b_0 conda-forge
r-evaluate 0.16 r41hc72bb7e_0 conda-forge
r-exact 3.1 r41hc72bb7e_0 conda-forge
r-expm 0.999_6 r41hb106f1f_0 conda-forge
r-fansi 1.0.3 r41h6d2157b_0 conda-forge
r-farver 2.1.1 r41ha856d6a_0 conda-forge
r-forcats 0.5.2 r41hc72bb7e_0 conda-forge
r-foreach 1.5.2 r41hc72bb7e_0 conda-forge
r-foreign 0.8_81 r41h6d2157b_0 conda-forge
r-formula 1.2_4 r41hc72bb7e_0 conda-forge
r-fs 1.5.2 r41ha856d6a_1 conda-forge
r-future 1.27.0 r41hc72bb7e_0 conda-forge
r-future.apply 1.9.0 r41hc72bb7e_0 conda-forge
r-generics 0.1.3 r41hc72bb7e_0 conda-forge
r-ggplot2 3.3.6 r41hc72bb7e_0 conda-forge
r-gld 2.6.5 r41h6d2157b_0 conda-forge
r-globals 0.16.0 r41hc72bb7e_0 conda-forge
r-glue 1.6.2 r41h6d2157b_0 conda-forge
r-gower 1.0.0 r41h6d2157b_0 conda-forge
r-gtable 0.3.0 r41hc72bb7e_3 conda-forge
r-hardhat 1.2.0 r41hc72bb7e_0 conda-forge
r-haven 2.5.0 r41ha856d6a_0 conda-forge
r-highr 0.9 r41hc72bb7e_0 conda-forge
r-hms 1.1.2 r41hc72bb7e_0 conda-forge
r-httr 1.4.4 r41hc72bb7e_0 conda-forge
r-ipred 0.9_13 r41h6d2157b_0 conda-forge
r-isoband 0.2.5 r41ha856d6a_0 conda-forge
r-iterators 1.0.14 r41hc72bb7e_0 conda-forge
r-jsonlite 1.8.0 r41h6d2157b_0 conda-forge
r-kernsmooth 2.23_20 r41h090b817_0 conda-forge
r-knitr 1.40 r41hc72bb7e_0 conda-forge
r-labeling 0.4.2 r41hc72bb7e_1 conda-forge
r-lattice 0.20_45 r41h6d2157b_0 conda-forge
r-lava 1.6.10 r41hc72bb7e_0 conda-forge
r-lifecycle 1.0.1 r41hc72bb7e_0 conda-forge
r-listenv 0.8.0 r41hc72bb7e_1 conda-forge
r-lme4 1.1_30 r41ha856d6a_0 conda-forge
r-lmom 2.9 r41he816bda_0 conda-forge
r-lmtest 0.9_40 r41he816bda_0 conda-forge
r-lubridate 1.8.0 r41ha856d6a_0 conda-forge
r-magrittr 2.0.3 r41h6d2157b_0 conda-forge
r-maptools 1.1_4 r41h6d2157b_0 conda-forge
r-mass 7.3_58.1 r41h6d2157b_0 conda-forge
r-matrix 1.4_1 r41hd2e18ed_0 conda-forge
r-matrixmodels 0.5_0 r41hc72bb7e_0 conda-forge
r-matrixstats 0.62.0 r41h6d2157b_0 conda-forge
r-mgcv 1.8_40 r41hd2e18ed_0 conda-forge
r-mime 0.12 r41h6d2157b_0 conda-forge
r-minqa 1.2.4 r41h96779af_1006 conda-forge
r-modelmetrics 1.2.2.2 r41ha856d6a_1 conda-forge
r-multcomp 1.4_20 r41hc72bb7e_0 conda-forge
r-munsell 0.5.0 r41hc72bb7e_1004 conda-forge
r-mvtnorm 1.1_3 r41he816bda_0 conda-forge
r-nlme 3.1_159 r41he816bda_0 conda-forge
r-nloptr 2.0.3 r41h96779af_0 conda-forge
r-nnet 7.3_17 r41h6d2157b_0 conda-forge
r-numderiv 2016.8_1.1 r41hc72bb7e_3 conda-forge
r-openssl 2.0.2 r41hc08181c_0 conda-forge
r-openxlsx 4.2.5 r41ha856d6a_0 conda-forge
r-parallelly 1.32.1 r41hc72bb7e_0 conda-forge
r-pbkrtest 0.5.1 r41hc72bb7e_0 conda-forge
r-pillar 1.8.1 r41hc72bb7e_0 conda-forge
r-pkgconfig 2.0.3 r41hc72bb7e_1 conda-forge
r-pkgload 1.3.0 r41hc72bb7e_0 conda-forge
r-plyr 1.8.7 r41ha856d6a_0 conda-forge
r-praise 1.0.0 r41hc72bb7e_1005 conda-forge
r-prettyunits 1.1.1 r41hc72bb7e_1 conda-forge
r-proc 1.18.0 r41ha856d6a_0 conda-forge
r-processx 3.7.0 r41h6d2157b_0 conda-forge
r-prodlim 2019.11.13 r41ha856d6a_1 conda-forge
r-progress 1.2.2 r41hc72bb7e_2 conda-forge
r-progressr 0.10.1 r41hc72bb7e_0 conda-forge
r-proxy 0.4_27 r41h6d2157b_0 conda-forge
r-ps 1.7.1 r41h6d2157b_0 conda-forge
r-purrr 0.3.4 r41h6d2157b_1 conda-forge
r-quantreg 5.94 r41hed7de19_0 conda-forge
r-r6 2.5.1 r41hc72bb7e_0 conda-forge
r-rcolorbrewer 1.1_3 r41h785f33e_0 conda-forge
r-rcpp 1.0.9 r41ha856d6a_1 conda-forge
r-rcpparmadillo 0.11.2.3.1 r41h78deb2a_0 conda-forge
r-rcppeigen 0.3.3.9.2 r41h399f8d5_0 conda-forge
r-readr 2.1.2 r41ha856d6a_0 conda-forge
r-readxl 1.4.1 r41h09f486c_0 conda-forge
r-recipes 1.0.1 r41hc72bb7e_0 conda-forge
r-rematch 1.0.1 r41hc72bb7e_1004 conda-forge
r-rematch2 2.1.2 r41hc72bb7e_1 conda-forge
r-reshape2 1.4.4 r41ha856d6a_1 conda-forge
r-rio 0.5.29 r41hc72bb7e_0 conda-forge
r-rlang 1.0.4 r41ha856d6a_0 conda-forge
r-rootsolve 1.8.2.3 r41he816bda_0 conda-forge
r-rpart 4.1.16 r41h6d2157b_0 conda-forge
r-rprojroot 2.0.3 r41hc72bb7e_0 conda-forge
r-rstudioapi 0.14 r41hc72bb7e_0 conda-forge
r-sandwich 3.0_2 r41hc72bb7e_0 conda-forge
r-scales 1.2.1 r41hc72bb7e_0 conda-forge
r-sp 1.5_0 r41h6d2157b_0 conda-forge
r-sparsem 1.81 r41he816bda_0 conda-forge
r-squarem 2021.1 r41hc72bb7e_0 conda-forge
r-statmod 1.4.37 r41hd5c7e75_0 conda-forge
r-stringi 1.7.8 r41ha856d6a_0 conda-forge
r-stringr 1.4.1 r41hc72bb7e_0 conda-forge
r-survival 3.4_0 r41h6d2157b_0 conda-forge
r-sys 3.4 r41h6d2157b_0 conda-forge
r-testthat 3.1.4 r41ha856d6a_0 conda-forge
r-th.data 1.1_1 r41hc72bb7e_0 conda-forge
r-tibble 3.1.8 r41h6d2157b_0 conda-forge
r-tidyr 1.2.0 r41ha856d6a_0 conda-forge
r-tidyselect 1.1.2 r41h6addd8b_0 conda-forge
r-timedate 4021.104 r41hc72bb7e_0 conda-forge
r-tzdb 0.3.0 r41ha856d6a_0 conda-forge
r-utf8 1.2.2 r41h6d2157b_0 conda-forge
r-vctrs 0.4.1 r41ha856d6a_0 conda-forge
r-viridislite 0.4.1 r41hc72bb7e_0 conda-forge
r-vroom 1.5.7 r41ha856d6a_0 conda-forge
r-waldo 0.4.0 r41hc72bb7e_0 conda-forge
r-withr 2.5.0 r41hc72bb7e_0 conda-forge
r-xfun 0.32 r41ha856d6a_0 conda-forge
r-yaml 2.3.5 r41h6d2157b_0 conda-forge
r-zip 2.2.0 r41h6d2157b_0 conda-forge
r-zoo 1.8_10 r41h6d2157b_0 conda-forge
re2 2022.06.01 h0e60522_0 conda-forge
requests 2.28.1 pyhd8ed1ab_0 conda-forge
rich 12.5.1 pyhd8ed1ab_0 conda-forge
ripgrep 13.0.0 h7f3b576_2 conda-forge
rpy2 3.4.5 py39r41hdb1e8fc_3 conda-forge
ruamel_yaml 0.15.80 py39hb82d6ee_1007 conda-forge
scikit-fuzzy 0.4.2 py_1 conda-forge
scikit-learn 1.1.2 py39hfd4428b_0 conda-forge
scipy 1.9.0 py39h316f440_0 conda-forge
seaborn 0.11.2 hd8ed1ab_0 conda-forge
seaborn-base 0.11.2 pyhd8ed1ab_0 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 65.3.0 pyhd8ed1ab_1 conda-forge
setuptools-scm 6.4.2 pypi_0 pypi
simplegeneric 0.8.1 py_1 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
snappy 1.1.9 h82413e6_1 conda-forge
sniffio 1.2.0 py39hcbf5309_3 conda-forge
snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
sphinx 5.1.1 pyhd8ed1ab_1 conda-forge
sphinxcontrib-applehelp 1.0.2 py_0 conda-forge
sphinxcontrib-bibtex 2.4.2 pyhd8ed1ab_0 conda-forge
sphinxcontrib-devhelp 1.0.2 py_0 conda-forge
sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge
sphinxcontrib-jsmath 1.0.1 py_0 conda-forge
sphinxcontrib-qthelp 1.0.3 py_0 conda-forge
sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge
sqlalchemy 1.4.40 py39hb82d6ee_0 conda-forge
sqlite 3.39.2 h8ffe710_1 conda-forge
stack_data 0.4.0 pyhd8ed1ab_0 conda-forge
statsmodels 0.12.2 py39h5d4886f_0 conda-forge
sympy 1.11 pypi_0 pypi
tbb 2021.5.0 h2d74725_1 conda-forge
tenacity 8.0.1 pyhd8ed1ab_0 conda-forge
terminado 0.15.0 py39hcbf5309_0 conda-forge
threadpoolctl 3.1.0 pyh8a188c0_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h8ffe710_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tomli-w 1.0.0 pyhd8ed1ab_0 conda-forge
toolz 0.12.0 pyhd8ed1ab_0 conda-forge
tornado 6.2 py39hb82d6ee_0 conda-forge
tqdm 4.64.0 pyhd8ed1ab_0 conda-forge
traitlets 5.3.0 pyhd8ed1ab_0 conda-forge
typing_extensions 4.3.0 pyha770c72_0 conda-forge
tzdata 2022c h191b570_0 conda-forge
tzlocal 4.2 py39hcbf5309_1 conda-forge
ucrt 10.0.20348.0 h57928b3_0 conda-forge
unicodedata2 14.0.0 py39hb82d6ee_1 conda-forge
urllib3 1.26.11 pyhd8ed1ab_0 conda-forge
vc 14.2 hb210afc_6 conda-forge
virtualenv 20.16.3 pypi_0 pypi
vs2015_runtime 14.29.30037 h902a5da_6 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.4.0 pyhd8ed1ab_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
win_inet_pton 1.1.0 py39hcbf5309_4 conda-forge
winpty 0.4.3 4 conda-forge
wmctrl 0.4 pyhd8ed1ab_0 conda-forge
wrapt 1.14.1 pypi_0 pypi
xorg-libxau 1.0.9 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xz 5.2.6 h8d14728_0 conda-forge
yaml 0.2.5 h8ffe710_2 conda-forge
zeromq 4.3.4 h0e60522_1 conda-forge
zipp 3.8.1 pyhd8ed1ab_0 conda-forge
zlib 1.2.12 h8ffe710_2 conda-forge
zstd 1.5.2 h7755175_4 conda-forge

@tobiasraabe
Copy link
Member Author

Can you run python -m rich.diagnose as well? I am trying to get back to this issue after my vacation.

@ChristianZimpelmann
Copy link
Contributor

ChristianZimpelmann commented Sep 4, 2022

Sure,

See here

╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface.                                                  │
│                                                                                  │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=120 ColorSystem.TRUECOLOR>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                  │
│     color_system = 'truecolor'                                                   │
│         encoding = 'utf-8'                                                       │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│           height = 30                                                            │
│    is_alt_screen = False                                                         │
│ is_dumb_terminal = False                                                         │
│   is_interactive = True                                                          │
│       is_jupyter = False                                                         │
│      is_terminal = True                                                          │
│   legacy_windows = False                                                         │
│         no_color = False                                                         │
│          options = ConsoleOptions(                                               │
│                        size=ConsoleDimensions(width=120, height=30),             │
│                        legacy_windows=False,                                     │
│                        min_width=1,                                              │
│                        max_width=120,                                            │
│                        is_terminal=True,                                         │
│                        encoding='utf-8',                                         │
│                        max_height=30,                                            │
│                        justify=None,                                             │
│                        overflow=None,                                            │
│                        no_wrap=False,                                            │
│                        highlight=None,                                           │
│                        markup=None,                                              │
│                        height=None                                               │
│                    )                                                             │
│            quiet = False                                                         │
│           record = False                                                         │
│         safe_box = True                                                          │
│             size = ConsoleDimensions(width=120, height=30)                       │
│        soft_wrap = False                                                         │
│           stderr = False                                                         │
│            style = None                                                          │
│         tab_size = 8                                                             │
│            width = 120                                                           │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭── <class 'rich._windows.WindowsConsoleFeatures'> ───╮
│ Windows features available.                         │
│                                                     │
│ ╭─────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=True, truecolor=True) │ │
│ ╰─────────────────────────────────────────────────╯ │
│                                                     │
│ truecolor = True                                    │
│        vt = True                                    │
╰─────────────────────────────────────────────────────╯
╭────── Environment Variables ───────╮
│ {                                  │
│     'TERM': None,                  │
│     'COLORTERM': None,             │
│     'CLICOLOR': None,              │
│     'NO_COLOR': None,              │
│     'TERM_PROGRAM': None,          │
│     'COLUMNS': None,               │
│     'LINES': None,                 │
│     'JUPYTER_COLUMNS': None,       │
│     'JUPYTER_LINES': None,         │
│     'JPY_PARENT_PID': None,        │
│     'VSCODE_VERBOSE_LOGGING': None │
│ }                                  │
╰────────────────────────────────────╯
platform="Windows"

@tobiasraabe
Copy link
Member Author

tobiasraabe commented Oct 5, 2022

I still had no time to further look into this issue. Apologies!

In the meantime, if you still experience this error, can you test this fix? Add these lines of code to some module that is imported somewhere in the beginning. For example, your project config.py. Add

from pytask import console


console.legacy_windows = True

@ChristianZimpelmann
Copy link
Contributor

Thanks! I tested the fix. Unfortunately, I still get the error every few runs.

@raholler
Copy link

raholler commented Nov 19, 2022

I get the error as well on my windows 11. I do not get it on my windows 10 computer. Suggested fixes do not work for me.

pytask                    0.2.6              pyhd8ed1ab_0    conda-forge
pytask-latex              0.2.1              pyhd8ed1ab_0    conda-forge
pytask-r                  0.2.0              pyhd8ed1ab_0    conda-forge

@tobiasraabe
Copy link
Member Author

Can I ask you to list both environments and run python -m rich.diagnose? I am sorry for the hassle, but I am really at a loss about what is causing this bug. Unfortunately, I don't have a machine/environment that is currently affected.

@raholler
Copy link

┌───────────────────────── <class 'rich.console.Console'> ─────────────────────────┐
│ A high level console interface.                                                  │
│                                                                                  │
│ ┌──────────────────────────────────────────────────────────────────────────────┐ │
│ │ <console width=119 ColorSystem.WINDOWS>                                      │ │
│ └──────────────────────────────────────────────────────────────────────────────┘ │
│                                                                                  │
│     color_system = 'windows'                                                     │
│         encoding = 'utf-8'                                                       │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│           height = 30                                                            │
│    is_alt_screen = False                                                         │
│ is_dumb_terminal = False                                                         │
│   is_interactive = True                                                          │
│       is_jupyter = False                                                         │
│      is_terminal = True                                                          │
│   legacy_windows = True                                                          │
│         no_color = False                                                         │
│          options = ConsoleOptions(                                               │
│                        size=ConsoleDimensions(width=119, height=30),             │
│                        legacy_windows=True,                                      │
│                        min_width=1,                                              │
│                        max_width=119,                                            │
│                        is_terminal=True,                                         │
│                        encoding='utf-8',                                         │
│                        max_height=30,                                            │
│                        justify=None,                                             │
│                        overflow=None,                                            │
│                        no_wrap=False,                                            │
│                        highlight=None,                                           │
│                        markup=None,                                              │
│                        height=None                                               │
│                    )                                                             │
│            quiet = False                                                         │
│           record = False                                                         │
│         safe_box = True                                                          │
│             size = ConsoleDimensions(width=119, height=30)                       │
│        soft_wrap = False                                                         │
│           stderr = False                                                         │
│            style = None                                                          │
│         tab_size = 8                                                             │
│            width = 119                                                           │
└──────────────────────────────────────────────────────────────────────────────────┘
┌─── <class 'rich._windows.WindowsConsoleFeatures'> ────┐
│ Windows features available.                           │
│                                                       │
│ ┌───────────────────────────────────────────────────┐ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ └───────────────────────────────────────────────────┘ │
│                                                       │
│ truecolor = False                                     │
│        vt = False                                     │
└───────────────────────────────────────────────────────┘
┌────── Environment Variables ───────┐
│ {                                  │
│     'TERM': None,                  │
│     'COLORTERM': None,             │
│     'CLICOLOR': None,              │
│     'NO_COLOR': None,              │
│     'TERM_PROGRAM': None,          │
│     'COLUMNS': None,               │
│     'LINES': None,                 │
│     'JPY_PARENT_PID': None,        │
│     'VSCODE_VERBOSE_LOGGING': None │
│ }                                  │
└────────────────────────────────────┘
platform="Windows"

@tobiasraabe
Copy link
Member Author

You are probably not running your powershell within Windows Terminal, aren't you? Could you try it with Windows Terminal https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de?

@raholler
Copy link

You are probably not running your powershell within Windows Terminal, aren't you? Could you try it with Windows Terminal https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de?

I ran it on cmd, but it does not make a difference (btw when I open windows terminal, it just opens a powershell tab, so not sure what this supposed to happen)

@tobiasraabe
Copy link
Member Author

Windows Terminal gives the shells run inside more color support, character support, etc.. I thought this might help.

@tobiasraabe
Copy link
Member Author

tobiasraabe commented Dec 18, 2022

If someone could test this potential workaround, that would be awesome. Please, install rich=11.2 and try again. This is the last version without their win32 renderer released in v12 (https://github.com/Textualize/rich/releases/tag/v12.0.0).

@ChristianZimpelmann
Copy link
Contributor

Please, install rich=11.2 and try again.

Thanks for the idea! I tried it out and unfortunately got the same error again :/

@janosg
Copy link

janosg commented Mar 1, 2023

A student of mine has the same problem. If I understand previous posters correctly, it occurs randomly and not too often. For my student it occurs each and every time. We made sure that the project itself runs on other computers. We tried PowerShell and AnacondaPrompt.

Here are some screenshots in case it helps:

Output of rich.diagnose:

image

image

Error message:

image

@tobiasraabe
Copy link
Member Author

I am sorry to hear that. What version of rich are you using? Is it Powershell 7 (blue) or Powershell Core? Have you tried running pwsh inside Terminal https://www.microsoft.com/store/apps/9n0dx20hk701?

@janosg
Copy link

janosg commented Mar 1, 2023

I know that we did not run it inside Terminal, but I can't answer the other questions.

I'll inquire about the other things.

@buddejul
Copy link

buddejul commented Mar 28, 2023

I ran into the same issue when I used pytask for the first time today. For me the error occurs every time as well. I tried the fixes mentioned above but none of them worked for me.

Error message

(base) PS C:\Users\budde\testpr> pytask
Traceback (most recent call last):
File "C:\Users\budde\anaconda3\lib\site-packages_pytask\build.py", line 114, in main
session.hook.pytask_log_session_header(session=session)
File "C:\Users\budde\anaconda3\lib\site-packages\pluggy_hooks.py", line 265, in call
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\budde\anaconda3\lib\site-packages\pluggy_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\budde\anaconda3\lib\site-packages\pluggy_callers.py", line 60, in _multicall
return outcome.get_result()
File "C:\Users\budde\anaconda3\lib\site-packages\pluggy_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Users\budde\anaconda3\lib\site-packages\pluggy_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\budde\anaconda3\lib\site-packages_pytask\logging.py", line 61, in pytask_log_session_header
console.rule("Start pytask session", style=None)
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 1496, in rule
self.print(rule)
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 1637, in print
self._buffer.extend(new_segments)
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 837, in exit
self._exit_buffer()
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 795, in _exit_buffer
self._check_buffer()
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 1927, in _check_buffer
write(line)
OSError: [WinError 6] The handle is invalid

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\budde\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\budde\anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\budde\anaconda3\Scripts\pytask.exe_main
.py", line 7, in
File "C:\Users\budde\anaconda3\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "C:\Users\budde\anaconda3\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\budde\anaconda3\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\budde\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\budde\anaconda3\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\budde\anaconda3\lib\site-packages_pytask\build.py", line 183, in build
session = main(raw_config)
File "C:\Users\budde\anaconda3\lib\site-packages_pytask\build.py", line 132, in main
console.print(traceback)
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 1637, in print
self._buffer.extend(new_segments)
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 837, in exit
self._exit_buffer()
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 795, in _exit_buffer
self._check_buffer()
File "C:\Users\budde\anaconda3\lib\site-packages\rich\console.py", line 1927, in _check_buffer
write(line)
OSError: [WinError 6] The handle is invalid
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
OSError: [WinError 6] The handle is invalid

And the rich.diagnose:

pytask_bug2_diagnose

@brunoVeltri
Copy link

brunoVeltri commented Oct 9, 2023

I have the same issue on Windows 11 when I run pytask, both from VS code terminal and fromt the Anaconda shell. So far it has occured every time.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants