ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

"_tkinter.TclError: couldn't connect to display" and MPLBACKEND="Agg" missing in re-run command #549

Closed katjaweigel closed 4 years ago

katjaweigel commented 4 years ago

Describe the bug I'm actually not sure if this is a ESMValCore or an ESMValTool issue: I switched to the latest version of ESMValCore and ESMValTool yesterday and since then I get a error related to the x-server, if I try to run a diagnostic in the queue on Mistral in the log file of the diagnostic: "self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display "localhost:40.0"" at the same time I saw, that "MPLBACKEND="Agg"" is missing in the "re-run" command in main_log.txt Also including: import matplotlib matplotlib.use('Agg') in the diagnostic helped to run it in the queue again, but I thought this was not the way we should solve it? I don't think it is related to the recipe/diagnostic I used, I'll try another soon. If I do the re-run including "MPLBACKEND="Agg"" it works (possibly also without, I have to try, on mistralpp it has access to the x-server, but not in the queue). I don't really know where to start searching for the reason of this issue? main_log_debug.txt

Please attach

katjaweigel commented 4 years ago

Another recipe I tried: https://github.com/ESMValGroup/ESMValTool/blob/deangelis_for_gmdpart4/esmvaltool/recipes/recipe_deangelis15nat.yml Stops with the same error on Mistral in the queue, i.e. without available x-Server.

katjaweigel commented 4 years ago

The same error also occurs for: https://github.com/ESMValGroup/ESMValTool/blob/master/esmvaltool/recipes/examples/recipe_python.yml Therefore, it seems to be a general issue at least for python diagnostics if no x-Server is available and not related to certain diagnostics.

valeriupredoi commented 4 years ago

cheers @katjaweigel looking into this right now :beer:

katjaweigel commented 4 years ago

ok, great!

bouweandela commented 4 years ago

Thank you for reporting. I introduced the bug in #528. It should be fixed by #550.