Skip to content

couldn't connect to display error for smallbaselineApp.py batch job from tmux #928

@falkamelung

Description

@falkamelung

Description of the problem
I am getting this error when submitting a smallbaselineApp,py jobs as SLURM batch job from a tmux shell. I don't get it when running the job on a regular terminal nor when submitting a batch job from terminal. This seem to be related to a recent update as I never saw this before.

Traceback (most recent call last):
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/cli/smallbaselineApp.py", line 213, in <module>
    main(sys.argv[1:])
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/smallbaselineApp.py", line 1117, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/smallbaselineApp.py", line 907, in run
    self.run_residual_phase_rms(sname)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/smallbaselineApp.py", line 708, in run_residual_phase_rms
    mintpy.cli.timeseries_rms.main(iargs)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/cli/timeseries_rms.py", line 75, in main
    run_timeseries_rms(inps)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/timeseries_rms.py", line 92, in run_timeseries_rms
    pp.plot_timeseries_rms(
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/sources/MintPy/src/mintpy/utils/plot.py", line 1018, in plot_timeseries_rms
    fig, ax = plt.subplots(figsize=fig_size)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/cbook/deprecation.py", line 451, in wrapper
    return func(*args, **kwargs)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/pyplot.py", line 1287, in subplots
    fig = figure(**fig_kw)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/pyplot.py", line 687, in figure
    figManager = new_figure_manager(num, figsize=figsize,
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/pyplot.py", line 315, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 3494, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/site-packages/matplotlib/backends/_backend_tk.py", line 885, in new_figure_manager_given_figure
    window = tk.Tk(className="matplotlib")
  File "/work2/05861/tg851601/stampede2/code/rsmas_insar/3rdparty/miniconda3/lib/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "localhost:38.0"

Googling it, I saw to use matplotlib.use('Agg') and/or playing with xhost + but I did not try yet. I am happy to try things if you have ideas.

Full script that generated the error
It happened here:

******************** step - residual_RMS ********************

timeseries_rms.py timeseriesResidual.h5 -t /scratch/05861/tg851601/qMiamiSenAT48/miaplpy/network_single_reference/smallbaselineApp.cfg
read options from template file: smallbaselineApp.cfg
remove quadratic ramp from file: timeseriesResidual.h5
read mask file: maskTempCoh.h5
--------------------------------------------------
grab metadata from ref_file: timeseriesResidual.h5
grab dataset structure from ref_file: timeseriesResidual.h5
create HDF5 file: timeseriesResidual_ramp.h5 with w mode
create dataset  : bperp      of float32                   in size of (11,)                with compression = None
create dataset  : date       of |S8                       in size of (11,)                with compression = None
create dataset  : timeseries of float32                   in size of (11, 630, 1297)      with compression = None
close  HDF5 file: timeseriesResidual_ramp.h5
estimating phase ramp one date at a time ...
[==================================================] 11/11    1s /     0s
finished writing to file: timeseriesResidual_ramp.h5
time used: 00 mins 2.1 secs.

calculating residual RMS for each epoch from file: timeseriesResidual_ramp.h5
read mask from file: maskTempCoh.h5
reading timeseries data from file: timeseriesResidual_ramp.h5 ...
[==================================================] 11/11    0s /     0s
save timeseries RMS to text file: /scratch/05861/tg851601/qMiamiSenAT48/miaplpy/network_single_reference/rms_timeseriesResidual_ramp.txt
read timeseries residual RMS from file: /scratch/05861/tg851601/qMiamiSenAT48/miaplpy/network_single_reference/rms_timeseriesResidual_ramp.txt
--------------------------------------------------
date with min RMS: 20160412 - 71605264.0000
save date to file: reference_date.txt
--------------------------------------------------
date(s) with RMS > 3.0 * median RMS (144891103.5461)
None.
PASTE CODE HERE

Full error message

PASTE ERROR MESSAGE HERE

System information

I on Linux CentOS using the development version.

 git log
commit d8b74c67c0bddd9cdc6000b7476a681c74766308
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Mon Nov 28 17:11:04 2022 -0800

    pre-commit: v4.3.0 → v4.4.0 (#921)
    
    updates:
    - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)

commit 9941b20a69bde09b89452dde8085cc108588a4ae
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Nov 28 09:06:45 2022 -0800

    build(deps): bump akhilerm/tag-push-action from 2.0.0 to 2.1.0 (#917)
  • Operating system:
  • Python environment:
  • MintPy version:
  • Your custom / default template file (if the bug is related to a specific dataset):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions