Bug 160250

Summary: allmost no application are starting giving the error Xlib: connection to ":0.0" refused by server Xlib: No protocol specified
Product: [Fedora] Fedora Reporter: Ilja Kogan <news>
Component: system-config-securitylevelAssignee: Chris Lumens <clumens>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: bitrain, gajownik, knutjbj, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-20 19:16:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilja Kogan 2005-06-13 20:33:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-2

Description of problem:
Freshly installed FC4. No changes in xorg.conf made. But when starting a lot of graphical applications from the console as root or as user I get the following error: 
# system-config-securitylevel
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

# system-config-services
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Unable to initialize graphical environment. Most likely cause of failure
is that the tool was not run using a graphical environment. Please either
start your graphical user interface or set your DISPLAY variable.
Caught exception: could not open display
$ glxgears
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

glxgears: Error: couldn't open display '(null)'

If starting from GNOME directly nothing happens at all. 
I am not sure, whether it is xorg or anything else, but it seems to. 
The interesting thing is, that GNOME is working without troubles.

Version-Release number of selected component (if applicable):
xorg-x11-6.8.2-31

How reproducible:
Always

Steps to Reproduce:
1.Install a fresh FC4
2.log-in into GNOME
3.open the terminal
4. start a graphical application
  

Actual Results:  error: 
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Unable to initialize graphical environment. Most likely cause of failure
is that the tool was not run using a graphical environment. Please either
start your graphical user interface or set your DISPLAY variable.


Expected Results:  the app should have been started

Additional info:

Comment 1 Søren Sandmann Pedersen 2005-06-13 21:06:09 UTC
*** Bug 160251 has been marked as a duplicate of this bug. ***

Comment 2 Ilja Kogan 2005-06-14 12:27:10 UTC
Sorry for the doublepost ...

I have found out something interesting: When I reboot everything works fine as
long as I don't start 
# system-config-securitylevel
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Afterwards again most of the applications are giving the same error. 

Comment 3 Mike A. Harris 2005-06-14 14:21:50 UTC
Sounds like it might be an issue with system-config-securitylevel itself.

Reassigning...

Comment 4 Ilja Kogan 2005-06-15 13:22:37 UTC
maybe a general python bug ?
http://forums.fedoraforum.org/showthread.php?t=59407 

Comment 5 Knut J BJuland 2005-06-15 14:42:23 UTC
I get when I try to start system-config-secerity as normal user and give root
password.
Traceback (most recent call last):
  File "/usr/share/system-config-securitylevel/system-config-securitylevel.py",
line 18, in ?
    app.stand_alone()
  File "/usr/share/system-config-securitylevel/securitylevel.py", line 453, in
stand_alone
    self.readFile()
  File "/usr/share/system-config-securitylevel/securitylevel.py", line 353, in
readFile

I can open yumex as noraml user but not as root with su.
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Traceback (most recent call last):
  File "yumex.py", line 23, in ?
  File "yumWrapper.py", line 26, in ?
  File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 37, in ?

RuntimeError: could not open display

[root@knutjorgen knutjbj]# system-config-securitylevel
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key


    protoname = socket.getservbyport(int(service), protocol)
socket.error: port/proto not found

Comment 6 Chris Lumens 2005-06-15 19:30:53 UTC
The message about port/proto not found is going out in an update here within a
day or two.  Look for the announcement on the mailing list and try again to see
if that also fixes this problem.

You can't run yumex just with su.  You have to either go through the desktop's
authorization mechanism or mess with xauth.

Comment 7 Ilja Kogan 2005-06-16 05:07:26 UTC
hmm:
# xhost +
access control disabled, clients can connect from any host
# system-config-securityleve

Now it works like a charm. Let's wait until the next reboot, wether I'll have to
make it everytime I start system-config-services

Comment 8 Ilja Kogan 2005-06-16 05:13:50 UTC
this might interest you guys :
http://www.fedoraforum.org/forum/showpost.php?p=282367&postcount=2 

Comment 9 Chris Lumens 2005-06-16 15:28:58 UTC
The traceback is fixed by an FC4 update I just pushed out.  Curious if there's
something more going on here with this bug, though.

Comment 10 Stefan Geuns 2005-06-17 12:02:50 UTC
I get this when I try to run system-config-network when I su'd. When I didn't
su, the enter your password windows comes and everything works.

[root@localhost ~]# system-config-network
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

ERROR: Unable to initialize graphical environment. Most likely cause of failure
is that the tool was not run using a graphical environment. Please either start
your graphical user interface or set your DISPLAY variable.

Comment 11 Gautam Ghare 2005-06-18 03:09:33 UTC
I am seeing the same issue with no X application working before doing the xhost +
Even xauth does not appear to authenticate the app with the correct cookie.
There may be an issue with xauth as well. Running an app from the Application
menu as root works fine.


Comment 12 Ilja Kogan 2005-06-22 09:44:36 UTC
I made an update to system-config-securitylevel-1.5.8.1-1 , but it's still there... 

Comment 13 funkyfredmale 2005-07-26 14:15:34 UTC
Hey all! new to fedora, and I noticed that while the 
$> xhost + 
did me no good whatsover, this problem only happened when I was root, even if I
$> su -
to keep my environment. However doing this fixes the problem:
(note this IS a HACK!, this still should be fixed)
(some output from env is printed)
HOME=/root
LOGNAME=root
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
_=/bin/env
[root@localhost ~]# export HOME=/home/username
[root@localhost root]# export USER=username
[root@localhost root]# synaptic

Voila!

I guessing this is a configuration mistake somewhere in the default install.
Most likely someone decided it would be more secure if people couldn't run X
programs as root from the terminal? (even though gksu lets me launch X apps as
root anyways...) So looks like a misunderstanding on fc4 crew's part. Especially
since some X apps (e.g. synaptic) need to be run as root to be useful.... 

Comment 14 Chris Lumens 2005-12-20 19:16:05 UTC

*** This bug has been marked as a duplicate of 175783 ***