Bug 160250 - allmost no application are starting giving the error Xlib: connection to ":0.0" refused by server Xlib: No protocol specified
allmost no application are starting giving the error Xlib: connection to ":0....
Status: CLOSED DUPLICATE of bug 175783
Product: Fedora
Classification: Fedora
Component: system-config-securitylevel (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
:
: 160251 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-13 16:33 EDT by Ilja Kogan
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-12-20 14:16:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ilja Kogan 2005-06-13 16:33:06 EDT
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 17:06:09 EDT
*** Bug 160251 has been marked as a duplicate of this bug. ***
Comment 2 Ilja Kogan 2005-06-14 08:27:10 EDT
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 10:21:50 EDT
Sounds like it might be an issue with system-config-securitylevel itself.

Reassigning...
Comment 4 Ilja Kogan 2005-06-15 09:22:37 EDT
maybe a general python bug ?
http://forums.fedoraforum.org/showthread.php?t=59407 
Comment 5 Knut J BJuland 2005-06-15 10:42:23 EDT
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 15:30:53 EDT
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 01:07:26 EDT
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 01:13:50 EDT
this might interest you guys :
http://www.fedoraforum.org/forum/showpost.php?p=282367&postcount=2 
Comment 9 Chris Lumens 2005-06-16 11:28:58 EDT
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 08:02:50 EDT
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-17 23:09:33 EDT
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 05:44:36 EDT
I made an update to system-config-securitylevel-1.5.8.1-1 , but it's still there... 
Comment 13 funkyfredmale 2005-07-26 10:15:34 EDT
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 14:16:05 EST

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

Note You need to log in before you can comment on or make changes to this bug.