Invalid MIT-MAGIC-COOKIE-1 when I run mpirun

Asked by Marten

Suddenly whenever I run mpirun I get the error Invalid MIT-MAGIC-COOKIE-1 key . I think this might have started after I killed a command using mpirun that had been launched from a python console.
I looked at $XAUTHORITY and found noXauthority file. I also tried xhost +local: in the terminal since it was suggested somewhere but the problem remains.
I have only used mpirun to run things locally on my pc.
For the most part mpirun does still seem to do what it is supposed to, but I believe it also now creates errors in things that were working perfectly before.
Simply running the below shows the warning for example (nonsense minimal example):

/usr/bin/mpirun -n 1 echo "bla"

I tried many things suggested on various websites such as creating a new .Xauthority file by the steps described in https://superuser.com/a/941244/728074 and setting the $DISPLAY value to :0 or :1. Nothing helped. When I created a new .Xauthority file and then deleted it did give me instead the error "No protocol specified" instead. I can go back to the magic cookie error by recreating the .Xauthority according to the steps in the above link.

System: Ubuntu 20.04 LTS

P.S.: I also asked the question on https://unix.stackexchange.com/questions/630428/invalid-mit-magic-cookie-1-when-i-run-mpirun

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the full output that you receive for the commands

uname -a
lsb_release -crid
apt-cache policy openmpi-bin
/usr/bin/mpirun -n 1 echo "bla"

Revision history for this message
Marten (kvothetheraven) said :
#2

I hope you don't mind I redacted some identification information in uname.

uname -a

Linux redacted_pc_name 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

apt-cache policy openmpi-bin

openmpi-bin:
  Installed: 4.0.3-0ubuntu1
  Candidate: 4.0.3-0ubuntu1
  Version table:
 *** 4.0.3-0ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status

/usr/bin/mpirun -n 1 echo "bla"

Invalid MIT-MAGIC-COOKIE-1 keybla

Should I edit the question or is it okay to leave it here in a message?

Revision history for this message
Bernard Stafford (bernard010) said :
#3

Can you help with this problem?

Provide an answer of your own, or ask Marten for more information if necessary.

To post a message you must log in.