I am trying to run IDL from remote in terminal window. I would like to produce an image in a png file from remote without the pop-up window in my terminal (for some reasons that I do not know pop-up window plots do not work well in my computer). I have been using both ssh -X and ssh -Y and received the same errors. The script is as follows
set_plot,'ps'
device,/color,bits=8,xs=80,ys=60
device,filename=‘test.eps'
loadct, 4
!p.charsize = 1.2
!p.color = 120
lfile = FILE_LINES(filename1)
openr,1,filename1
ar1=fltarr(6,lfile)
readf,1,ar1
close,1
Xcoord=ar1[0,*]
Ycoord=ar1[1,*]
h2d=hist_2d(Xcoord,Ycoord,bin1=5, bin2=5)
h2d = CONGRID(h2d, MAX(Xcoord), MAX(Ycoord))
g0=image(h2d)
device,/close
end
When I launch this script.pro via .r script
, I receive the error at the line g0=image(h2d)
that is copied below
% Compiled module: $MAIN$.
% LOADCT: Loading table BLUE/GREEN/RED/YELLOW
% Compiled module: HIST_2D.
Invalid MIT-MAGIC-COOKIE-1 key% WIDGET_CONTROL: Unable to connect to X Windows display: localhost:11.0
% IMAGE: WIDGET_CONTROL: Unable to establish X Connection.
% Execution halted at: $MAIN$ 42 /home/script.pro
I believe the line
%Invalid MIT-MAGIC-COOKIE-1 key% WIDGET_CONTROL: Unable to connect to X Windows display: localhost:11.0
points to a different issue than the line
% IMAGE: WIDGET_CONTROL: Unable to establish X Connection
.
Following the suggestions at (a similar Stackexchange question)[https://unix.stackexchange.com/questions/199891/invalid-mit-magic-cookie-1-key-when-trying-to-run-program-remotely], I tried to troubleshoot as follows but have not solved the issue:
- The DISPLAY environment variable seems correctly set up:
env | grep DISPLAY
givesDISPLAY=localhost:11.0
- The line
export DISPLAY=desktop:0.
gives errorexport: Command not found
. - The line
xhost +local:
before running it givesInvalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display "localhost:11.0
. - I tried also
ps aux | grep bin/X | grep -v grep
and receive
root 1745 0.0 0.1 323536 22172 tty1 Ssl+ Feb06 1:43 /usr/bin/X :0 -background none -noreset -audit 4 -verbose -auth /run/gdm/auth-for-gdm-DUUgHB/database -seat seat0 -nolisten tcp vt1
- I tried also
ps aux | grep /Xorg | grep -v grep
and receive
root 758 0.0 0.0 225860 2872 ? Ss Feb06 0:00 /usr/bin/abrt-watch-log -F Backtrace /var/log/Xorg.0.log -- /usr/bin/abrt-dump-xorg -xD
When I try to run the same script from another computer, (connecting again via a terminal window to the same remote machine), I do not receive the line
%Invalid MIT-MAGIC-COOKIE-1 key% WIDGET_CONTROL: Unable to connect to X Windows display: localhost:11.0
, but I still receive % IMAGE: WIDGET_CONTROL: Unable to establish X Connection
.
So I think the MIT-MAGIC
line is a visualisation problem of my computer but I cannot debug the widget_control
error anyway. If I could at least solve the widget problem, I could maybe produce the plot on another machine. Thanks.
Thank you so much for the thorough explanation, telcoM. Something is more clear to me now. I have re-installed XQuartz on my Mac (XQuartz 2.7.11). The error on MIT-MAGIC-COOKIE seems to have disappeared but I receive with the same script an error related, I think, to IDL libraries (execution haled at the same line as before, namely the image command):
% Compiled module: $MAIN$.
% LOADCT: Loading table BLUE/GREEN/RED/YELLOW
% Compiled module: HIST_2D.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
% Loaded DLM: PNG.
% WIDGET_EVENT: Failure to acquire window rendering context.
% IMAGE: WIDGET_EVENT: Unable to acquire device context.
% Execution halted at: $MAIN$
An Idl pop-up window opens (black) and the saved file (45 kb) is a (blank instead) page. Googling led me to https://www.l3harrisgeospatial.com/Support/Forums/aft/4922 but I do not have access to IDL libraries. Should I ask the system administrators to change the IDL preferences?
sysctl -p --system
. Also,cat .Xauthority
to check what is the hostname given there. – Estatistics Dec 31 '23 at 14:43