plantcv icon indicating copy to clipboard operation
plantcv copied to clipboard

ConnectionRefusedError: [Errno 61] Connection refused

Open rodrign2002 opened this issue 2 years ago • 1 comments

Hi everyone,

I have the following problem, I have created a plantcv workflow previously and it worked. Recently it stopped working, and I am getting the error

  • distributed.client - ERROR - ConnectionRefusedError: [Errno 61] Connection refused

I was following this tutorial:

https://plantcv.readthedocs.io/en/stable/tutorials/vis_tutorial/

and converted the jupyter notebook into a workflow script. Then I run with

plantcv-workflow.py --config test.json

where the test.json file is referencing the workflow script.

My Local environment:

  • OS: macOS Big Sur Version 11.6.4
  • Environment: conda
  • PlantCV Version 3.14.1

I don't remember which version I used to create the jupyter notebook and workflow script, but it was probably about one year ago with the then-current version from conda.

Another related problem: I cannot find any information on the web page anymore on how to convert jupyter notebooks into workflow scripts.

rodrign2002 avatar Oct 06 '22 13:10 rodrign2002

Hi @rodrign2002, the documentation for converting from Jupyter to a workflow script is on this page: https://plantcv.readthedocs.io/en/stable/jupyter/

The distributed.client error may not actually indicate that your workflow didn't work - can you confirm you did not get the results you expected?

We have noticed an increase scary sounding errors from the parallelization system (Dask) - but in many cases they occur when the cluster shuts down and don't affect PlantCV. As a side note, we're building a release for PlantCV v4 that will address this issue.

nfahlgren avatar Oct 07 '22 15:10 nfahlgren

Dear @nfahlgren,

thank you for the quick reply! and my apologies for jumping in, @rodrign2002 is pretty busy this week... anyway, thanks also for the link, this is indeed what we were looking for and I am a bit embarrassed that we missed it (I guess we looked under workflow parallelization...)

concerning the connection refused error, we indeed actually get the result (will check later this week if it's the expected one, but it looks fine), also something we missed, didn't even look, my apologies

so we can ignore this error? what I also forgot to mention is, that we only run on localhost for batch processing, so no actual parallelization taking place, here is our configuration json file, maybe we are doing something wrong here (I think we just copied it from some example)?

{ "input_dir": "/Users/theusst/plantcv/images", "json": "result.json", "filename_metadata": ["camera", "timestamp"], "workflow": "/Users/theusst/plantcv/workflowname.py", "img_outdir": "/Users/theusst/plantcv/outdir", "include_all_subdirs": false, "tmp_dir": "/Users/theusst/plantcv/tmp", "start_date": null, "end_date": null, "imgformat": "jpg", "delimiter": "_", "metadata_filters": {}, "timestampformat": "%Y-%m-%d-%H-%M", "writeimg": true, "other_args": ["-D", "print"], "coprocess": null, "cleanup": true, "append": true, "cluster": "LocalCluster", "cluster_config": { "n_workers": 1, "cores": 1, "memory": "1GB", "disk": "1GB", "log_directory": null, "local_directory": null, "job_extra": null }, "metadata_terms": { "camera": { "label": "camera identifier", "datatype": "<class 'str'>", "value": "none" }, "timestamp": { "label": "datetime of image", "datatype": "<class 'datetime.datetime'>", "value": null } } }

theusst avatar Oct 11 '22 08:10 theusst

Hi @theusst, no worries at all! There are a lot of docs, which is good, but also somewhat of a needle in a haystack.

And the errors indeed sound alarming and we have gotten a lot of questions about them because they definitely imply that it's not working. But I believe that in all cases I have looked at the errors are not fatal for the actual data processing and only occurs when we shutdown the Dask cluster (whether LocalCluster or one of the distributed clusters). In #958 I think we fixed this issue and it will be part of the v4.0 release that's upcoming.

For now, I think the errors are safe to ignore as long as the results file (and exported CSV files) contain data. Your configuration definitely looks good to me.

Thanks!

nfahlgren avatar Oct 11 '22 18:10 nfahlgren