13

All of a sudden, whenever I call matplotlib.pyplot.plot (within a unix OS), the following error is printed to the screen:

Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed

This error does not interrupt the function; the plot is created successfully. But what does this error mean?

A user on linuxforums.org was able to find a way to prevent the error:

"I don't know exactly why, but giving permissions to the user in the sudoers file, and then running the program with the sudo command, fixes the error."

This, however, leaves unresolved the cause of the error and whether it influences at all the ongoing process.

Is there a solution that doesn't require editing the sudoers file?

NB: I'm doing this work on a shared computing cluster.

abcd
  • 10,215
  • 15
  • 51
  • 85
  • The 'related question' link is broken. – titusjan May 06 '15 at 14:12
  • @titusjan the question was removed, apparently. – abcd May 06 '15 at 21:08
  • 1
    Comment to check whether this matches your circumstances: This error means that your program doesn't have permissions to connect to the current `X` Session. Are you using a remote terminal (via `X` Window) to work on the cluster? The error usually means the `X` server on the remote system is either mis-configured or over-cautious on security. As you've found, you can ignore the message. Interesting that deleting `.cache` resolved it. Points to a stale reference to a session IMHO. If this helps at all, I can post as an answer. – J Richard Snape May 07 '15 at 15:23
  • 1
    You could look at `.xsession-errors` file - If it exists and contains an error and if you can relate that to the time you saw the error message, that could confirm that this is the problem and we might be able to dig into the underlying mechanism – J Richard Snape May 07 '15 at 15:32
  • @JRichardSnape this sounds right to me. i am using an `X` window to work on a cluster. is the `.xsession-errors` file supposed to be in my home directory? i don't have one there. but even if we can't get to the cause of this particular instance of the error, at least now i have some ideas about where to look first if this happens again in the future. – abcd May 07 '15 at 15:57
  • I'd expect it to be in home. Otherwise, you could try a find e.g. `find / -iname .xsession-errors`. It's possible it gets cleared sometimes, not 100% sure. If you find it, let me know what's in it and maybe we'll get to an answer. If it doesn't exist on your machine, never mind. – J Richard Snape May 07 '15 at 16:09

2 Answers2

10

The answer to the question is, yes, there is a solution that doesn't require editing the sudoers file. I noticed that in the .cache directory of my home directory, there was a matplotlib directory and a sessions directory.

I deleted these.

The problem was resolved.

I remain unsure why the error arose in the first place.

abcd
  • 10,215
  • 15
  • 51
  • 85
2

Make sure you use "su -" and not just "su"

Lex
  • 29
  • 1