Rapache freezes when creating a new virtual host

Bug #346788 reported by Sense Egbert Hofstede
98
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Remote Apache Management tool
Fix Released
Undecided
Unassigned
rapache (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: rapache

On an up-to-date version of 9.04 alpha Rapache freezes when creating a new virtual host.
No gksu dialogue is launched and if Compiz is enabled the main window gets the gray look busy applications get from Compiz. The Virtual Host editor doesn't.

rapache:
  Installed: 0.7-0ubuntu4
  Candidate: 0.7-0ubuntu4
  Version table:
 *** 0.7-0ubuntu4 0
        500 http://archive.ubuntu.com jaunty/universe Packages
        100 /var/lib/dpkg/status

Attached is the output of Rapache in the terminal.

Revision history for this message
Sense Egbert Hofstede (sense) wrote :
Revision history for this message
Thomas Templin (coastgnu) wrote :

Same behaviour on _every_ action
Same error message as reported by Sense Hofstede

Revision history for this message
Lucian Pacurar (lucassp) wrote :

Same behaviour on 9.04 RC.

Revision history for this message
niels68 (rapache) wrote :

I do have also the same problem, pleace tell us how to fix. thanks

Revision history for this message
dk_luis (mzn) wrote :

I do have also the same problem.

Revision history for this message
Fabian Büchler (fabian-buechler) wrote :

I've the same problem (freeze on every action) on 9.04 final

Revision history for this message
TAC one (tacone) wrote : Re: [Bug 346788] Re: Rapache freezes when creating a new virtual host

>
Thanks everyone for the reports. Please don't report any other "me
too". I'm one of the devs, and currently I'm away from home. I'll be
back likely at the beginning of the next week - so it will be possible
for me to gave a look only next week.

Revision history for this message
papampi (gbox-superpart) wrote :

so ?
doesnt any one going to fix this problem ?

Revision history for this message
TAC one (tacone) wrote : Re: [Rapache-devel] [Bug 346788] Re: Rapache freezes when creating a new virtual host

On Tue, May 19, 2009 at 8:13 PM, papampi <email address hidden> wrote:
> so ?
> doesnt any one going to fix this problem ?

I'm looking and still I can't find the solution to this.
It looks to be an issue with the gksu2 python extension. Everything
works but gksu.ask_password_full() function freeze rapache even before
showing the password dialog.

One would think it's thread related, but it used to work pretty well
with Intrepid (which runs python 2.5 btw).

Any help would be appreciated.

Revision history for this message
DWeol (dw-waanco) wrote :

I found a little hack that makes rapache workable again.

When you comment out the line ctx.set_grab(True)
(around line 212 of Shell.py in function __get_password ) things stop freezing...

This is no real fix of course! but it worked for me but i don't know phyton or ubuntu very well (just installed it)

So i thought i'd share for the impatient and hopefully it gives a clue to the people that do know what they are doing.

if you installed it on ubuntu 9.04 the file Shell.py is in:
/usr/lib/python2.6/dist-packages/RapacheCore/

just put a # sign before the line ctx.set_grab(True)
And move Shell.pyc out of the way: mv Shell.pyc Shellorg.pyc

again I am completely new to phyton, so please correct me if i'm wrong...

Revision history for this message
papampi (gbox-superpart) wrote :

Nop !
its not workin !!!

Revision history for this message
TAC one (tacone) wrote :

It's not working for everyone.
Seems like thread stuff, but I really can't isolate the right fix.
This hack works, though.

add this to line 80 of RapacheGui.py
# HACK : work around bug
if not Shell.command.ask_password(): sys.exit(1)

this will make rapache ask for password at the launch, or quit if the password is wrong.
this will be the default behaviour in the coming upstream versions by the way.

Subscribing Emgent.

Revision history for this message
TAC one (tacone) wrote :

Emgent, could you fix this ?
I think it could qualify to be an SRU, since it doesn't affect the stability of other applications and rapache is unusable right now for Jaunty users.

Revision history for this message
papampi (gbox-superpart) wrote :

with this one :
add this to line 80 of RapacheGui.py
# HACK : work around bug
if not Shell.command.ask_password(): sys.exit(1)

Rapache does not start any more !!!!!

Revision history for this message
DWeol (dw-waanco) wrote :

TAC one: Thanx, this workaround also works for me.

papami: this is propably the indenting, try typing 8 spaces before the lines.

Revision history for this message
TAC one (tacone) wrote : Re: [Bug 346788] Re: Rapache freezes when creating a new virtual host

Pamapi I believe you just got the identation wrong. I suggest you wait
for the fix to cone out.

Il giorno May 22, 2009, alle ore 12:12 AM, papampi
<email address hidden> ha scritto:

> with this one :
> add this to line 80 of RapacheGui.py
> # HACK : work around bug
> if not Shell.command.ask_password(): sys.exit(1)
>
> Rapache does not start any more !!!!!
>
> --
> Rapache freezes when creating a new virtual host
> https://bugs.launchpad.net/bugs/346788
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
papampi (gbox-superpart) wrote :

yes it was the identation !
thanks !
at last !!!

Revision history for this message
antrecu (antrecu-yahoo) wrote :

what's the status on this if u dont mind??

Revision history for this message
TAC one (tacone) wrote :

Antrecu: I'm the upstream developer, not the Ubuntu packager. I have
no access to the repositories.
I've already subscribed emgent, feel also free to bring this to the
attention of any Ubuntu developer or Motu that you trust. A SRU is
needed to get the fix in the Jaunty repositories and I believe the bug
and the fix fully qualify for an SRU.

Revision history for this message
antrecu (antrecu-yahoo) wrote :

thanks !

Revision history for this message
spartan.the (spartan-the) wrote :

Thanks everybody for helping to solve problem!

I installed Ubuntu 9.04 on Amd64 box, installed apache2 using Synaptic package manager. I didn't find rapache installed as it was described in youtube video describing how to install apache2 on Ubuntu 8.04. That was not a big issue and I installed rapache using Synaptic again. But rapache could do any read-only operation (display config and log files) but not write operation. It froze any time I tried to save any changes (not only creating a new virtual host). Seems the problem is due to "smart root account" in Ubuntu (similar implemented in Windows Vista) asking for password every time you want to do an administrative task.

So here are step by step instructions to fix a problem for newbees like me.

1. Make sure rapache version is 0.7 (rapache about box)

2. Check file we need to fix is there using Nautilus (aka Places, aka File explorer):

3. Open for editing using "Text editor" (gedit)

4. Goto line 80 and add new lines as TAC one described:

After lines:
    def __init__(self, *args, **kwargs):
        super (MainWindow, self).__init__ (*args, **kwargs)
        Master.register(self)

and before lines
        self.denormalized_virtual_hosts = {}
        self.plugin_manager = PluginManager()
        self.apache = Apache2()

insert lines:
        # HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
        if not Shell.command.ask_password(): sys.exit(1)
        # HACK END

NB! Carefully add 8 spaces before new lines because proper identationis important to Python.

5. Save file. Not so easy again: Ubuntu will prevent you from overriding "system file".
Select File | Save As...
Save in your Documents folder

6. Replace original file with modified one making a backup of original file in your Documents folder:
In terminal type following commands:
cd ~/Documents
sudo bash
{enter password}
cp /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py ./RapacheGui.py.original
cp ./RapacheGui.py /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py

The End.

Revision history for this message
spartan.the (spartan-the) wrote :

For steps 2 and 3 name of the file I was talking is:
/usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py

Revision history for this message
Andy (andy-localwebspace) wrote :

Thanks for this workaround folks, works a treat for me.
You can avoid the need to use save as and copying files by starting gedit with sudo and then opening the file you want to edit.

Alt-F2 to bring up run command
tick the "run in terminal" box
Type this into the command box

sudo gedit /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py

Type in your password

Scroll down to Line 79 (line number is displayed at the bottom of the gedit window)
Copy the following lines from here and paste them into gedit at line 79

        # HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
        if not Shell.command.ask_password(): sys.exit(1)
        # HACK END

Save the file in gedit

close gedit

I know nothing of python, and all credit for the workaround goes to those who already contributed in the thread. This just makes it a little more convenient to install for newbies (like me).

Revision history for this message
Oumar FALL (knibals) wrote :

Merçi ca marche!

Revision history for this message
Henry H (henry-harte) wrote :

Thanks for putting this hack/workaround together.

I hadn't realised how much I was depending on the rapache tool to handle Apache2 until it stopped working (No I can't recall what I did to make it stop).

I even went to the extent of removing rapache & Apache2 (which did nothing to fix this, of course)!

I had removed some entries in Apache (through webmin) but they were still showing up in rapache. Where does rapache keep it's config files? - Not in /home/me/.rapache -.

How do we push for a 0.7.1 so that no one else is plagued with this issue?

P.S. Spartan.the got it right but Andy's method is more elegant.

Thanks heaps!!!

Revision history for this message
BlackGhost (bennydevuyst-gmail) wrote :

After upgrade to 9.10, rapache exits with following logging:

sn_launcher_context_complete called for an SnLauncherContext that hasn't been initiated
[sudo] password for benny:
Sorry, try again.
[sudo] password for benny:
Sorry, try again.
[sudo] password for benny:
Sorry, try again.
sudo: 3 incorrect password attempts

The password I enter is the correct password of course.

Greetz

Revision history for this message
Mahesh Asolkar (asolkar) wrote :

I also got the same thing yesterday (also on 0.10, but after I added work around suggested in #21). I started rapache with sudo, and it worked.

Even after that, I could not add virtual hosts. I disabled the 'default' site and then I could add more sites. I wonder what's with that.

Revision history for this message
BlackGhost (bennydevuyst-gmail) wrote :

After an update of python 2.6 The problem 26 was resolved.

greetz

Revision history for this message
BlackGhost (bennydevuyst-gmail) wrote :

Discard last message.It's not working again with same error after authentication.

sn_launcher_context_complete called for an SnLauncherContext that hasn't been initiated
[sudo] password for benny:
Sorry, try again.
[sudo] password for benny:
Sorry, try again.
[sudo] password for benny:
Sorry, try again.
sudo: 3 incorrect password attempts

Revision history for this message
Davim (davim) wrote :

Same problem on every action :( I'm using Ubuntu 9.10.... and I have the ppa repo on my sources.list:

deb http://ppa.launchpad.net/rapache-devel/ppa/ubuntu karmic main #Rapache

Revision history for this message
Davim (davim) wrote :

I've applied Andy's hack and it's working now, you should really put this hack in the PPA until you don't find another way to silve this. Rapache is great and really useful but it isn't working for a very long time now!...

Revision history for this message
TAC one (tacone) wrote :

On Tue, Nov 24, 2009 at 4:49 PM, Davim <email address hidden> wrote:
> I've applied Andy's hack and it's working now, you should really put
> this hack in the PPA until you don't find another way to silve this.
> Rapache is great and really useful but it isn't working for a very long
> time now!...

I've been reported that even that hack doesn't work that great on
9.10. I'm told it works only sometimes.

Revision history for this message
cyqotiq (jnsatterfield) wrote :

I'm running Karmic Koala (9.10). I've applied both hacks (Shell.py and RapacheGui.py), but neither completely fixes the problem. I've used Compiz to make my windows use the "Beam-Up" effect whenever a window is opened or closed, so what I see is:

1: I open rapache through the system menu
2: The "super user privileges" window opens, requesting my password
3: I enter my password, click "Okay"
4: The gksudo window goes away with a "Beam-Up" effect.
5: Another window, larger than the gksudo window, opens and then immediately closes
6: Nothing else happens

The only way I can even tell step 5 is happening is by the "Beam-Up" effect provided by Compiz. If Compiz were not being used, I don't believe anyone would be able to tell that anything is happening after the password window disappears.

Revision history for this message
EroS (manuelcanepa) wrote :

Thanks!

# HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
if not Shell.command.ask_password(): sys.exit(1)
#HACK END

That was my solution!

Revision history for this message
karlwilbur (karlwilbur) wrote :

After editing /usr/share/pyshared/RapacheGtk/RapacheGui.py by inserting, at line 80 :
<8 spaces># HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
<8 spaces>if not Shell.command.ask_password(): sys.exit(1)
<8 spaces>#HACK END

I now get a password dialog at startup. Great, this is expected. However, after carefully typing the correct password I get the same auth error as posts #26 and #29.

12:06:25 [karl@karl-laptop] ~$ rapache
sn_launcher_context_complete called for an SnLauncherContext that hasn't been initiated
[sudo] password for karl:
Sorry, try again.
[sudo] password for karl:
Sorry, try again.
[sudo] password for karl:
Sorry, try again.
sudo: 3 incorrect password attempts

12:06:31 [karl@karl-laptop] ~$

Revision history for this message
karlwilbur (karlwilbur) wrote :

Additional note: I have also tried the root password as well as my user password. Both produced the same result. Is this an issue with Rapache or with the gksu / gksudo library?

Revision history for this message
TAC one (tacone) wrote :

Karlwilbur: I believe this is an issue with the gksu library.

On Sat, Dec 26, 2009 at 6:15 PM, karlwilbur <email address hidden> wrote:
> Additional note: I have also tried the root password as well as my user
> password. Both produced the same result. Is this an issue with Rapache
> or with the gksu / gksudo library?
>
> --
> Rapache freezes when creating a new virtual host
> https://bugs.launchpad.net/bugs/346788
> You received this bug notification because you are a direct subscriber
> of the bug.
>
>

Revision history for this message
myownserver (imchillindave) wrote :

I just upgraded to 9.10 and the hack no longer works. I had hesitated upgrading for this very reason because I was afraid Rapache wouldn't work and I was right.

I really hope this project gets fixed and not abandoned. I really hoped for a fixed version with the release of 9.10.

Back to manual vhost management . . . what a pain.

Revision history for this message
spartan.the (spartan-the) wrote :

Can not verify if the cure works on 9.10 but check Paul's blog at http://www.javathinking.com/2009/11/rapache-on-ubuntu-910/

Paul reported that the hack is working but file location is different. So if you find a file
/usr/share/pyshared/RapacheGtk/RapacheGui.py

in your box then probably today is your lucky day.
Replace /usr/lib/python2.6/dist-packages/RapacheGtk/RapacheGui.py with /usr/share/pyshared/RapacheGtk/RapacheGui.py in comments above and read thread once again.

Disclaimer: Could not verify it is true it works but it may work.

Revision history for this message
TexasIntegratedServices (jhenderson) wrote :

Alright all you 9.10 users here is the fix. Be aware that there are 2 levels of security that you are going though.

First part has been done for you #21 and all the others get the credit here by doing:
After lines:
    def __init__(self, *args, **kwargs):
        super (MainWindow, self).__init__ (*args, **kwargs)
        Master.register(self)

and before lines
        self.denormalized_virtual_hosts = {}
        self.plugin_manager = PluginManager()
        self.apache = Apache2()

insert lines:
        # HACK : work around bug @see https://bugs.launchpad.net/rapache/+bug/346788
        if not Shell.command.ask_password(): sys.exit(1)
        # HACK END

Second part is: sudo gedit /usr/share/applications/rapache.desktop
Change line *** 5 ***
[Desktop Entry]
Name=rapache
Comment=Simple tool for managing and configuring an apache2 instance
TryExec=rapache
Exec=gksudo rapache
Icon=/usr/share/rapache/Glade/icon_cadsoft_eagle.svg
Type=Application
Categories=System;

Then reboot, please just reboot. When you access rapache in the system menu you will type root password twice. Then it works.

Revision history for this message
Comboy (comboyx) wrote :

@papampi

if you can't get it to work after applying the hack, open a terminal window and type rapache.
it's tricky but it worked for me.

have fun

Revision history for this message
TAC one (tacone) wrote :

Fixed in rev. 95 of the PPA trunk.

run rapache with sudo rapache. It will nevertheless ask for your password on vhost creation but it will work without freezing.

instructions on: http://www.stefanoforenza.com/rapache-returns/

Changed in rapache:
status: New → Fix Released
Revision history for this message
TAC one (tacone) wrote : Try imo messenger on the web and your mobile device

I’m using imo to message my friends on all of my accounts, MSN, Facebook,
Skype, Yahoo, Google Talk, AIM and others.

imo also lets you quickly send voice ims, create group chats, and share
photos.

It's free and easy to use.
Web: https://imo.im
iPhone: http://itunes.apple.com/us/app/imo-instant-messenger/id336435697
iPad: http://itunes.apple.com/us/app/imo-instant-messenger-for/id405179691
Android: https://market.android.com/details?id=com.imo.android.imoim

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.