Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppArmor causes editor to exit with exit code 1 #18

Open
mamedov opened this issue Oct 3, 2011 · 53 comments
Open

AppArmor causes editor to exit with exit code 1 #18

mamedov opened this issue Oct 3, 2011 · 53 comments

Comments

@mamedov
Copy link

mamedov commented Oct 3, 2011

Hello,

Thank you for your extension :)
I have changed my favorite editor to "Sublime Text 2" and now when I am trying to "edit" my textareas I got:

I ran this command: /usr/bin/sublime-text-2
/home/mamedov/.mozilla/firefox/vkuuxfit.default/itsalltext/mst.something.com.2i33381k2a.txt
...and it exited with a status of 1.

If I will open terminal and type /home/mamedov/.mozilla/firefox/vkuuxfit.default/itsalltext/mst.something.com.2i33381k2a.txt - editor opens OK and I can see text from textarea.

My sistem is: Linux mamedov-laptop 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

UPDATE:
Downgraded to 1.6.0 - now when I clicking on edit button nothing happens :(

@docwhat
Copy link
Owner

docwhat commented Oct 3, 2011

Does it have the '>' character in the command before the filename?

@mamedov
Copy link
Author

mamedov commented Oct 3, 2011

No, I dont think so. Definitely, there is no > symbol before filename.

Best Regards,
Mamed Mamedov

Sent from an Android...
On Oct 3, 2011 6:24 PM, "Christian Höltje" <
reply@reply.github.com>
wrote:

Does it have the '>' character in the command before the filename?

Reply to this email directly or view it on GitHub:
#18 (comment)

@docwhat
Copy link
Owner

docwhat commented Oct 3, 2011

Would you be willing to try level 1 debugging to see if we can get a better error message out of Firefox?

@guzaho
Copy link

guzaho commented Oct 7, 2011

Hey, I am experiencing the exact same problem. I can have a look at setting up level 1 debugging to get a better idea of what's going on. Can't guarantee that I get it done this weekend, tho..

@mamedov
Copy link
Author

mamedov commented Oct 14, 2011

Same situation :) Still have no time to setup level 1 debug, but maybe tomorrow will do it..

@guzaho
Copy link

guzaho commented Oct 14, 2011

Hello again. I did finally get around to do it. It only took me 15 minutes, actually. I didn't get much from the level 1 debugging. I took a screenshot you can find here: http://www.zaera-holo.net/static/graphics/ff_iat_error_console.png

And here's a screenshot of my config. Haven't touched it, except from the debug set to true.

http://www.zaera-holo.net/static/graphics/ff_iat_config.png

@guzaho
Copy link

guzaho commented Oct 24, 2011

Hey, any progress on this? I really miss my vim....!

@docwhat
Copy link
Owner

docwhat commented Oct 24, 2011

I'm sorry. I totally blew this.

@guzaho and @mamedov: Are you using the version of Firefox that comes stock with Ubuntu?

@mamedov
Copy link
Author

mamedov commented Oct 24, 2011

Yeap from my side :)

@docwhat
Copy link
Owner

docwhat commented Oct 24, 2011

@guzaho and @mamedov: In that case, I think the fix is to use the Official Firefox.

I'll try loading up my Ubuntu VM and see if I can recreate this and figure out what Ubuntu's stock firefox is doing different/wrong.

Ciao!

@docwhat
Copy link
Owner

docwhat commented Oct 24, 2011

Can you paste the output from lsb_release -a please?

@docwhat
Copy link
Owner

docwhat commented Oct 24, 2011

Also, is this 32bit or 64bit Ubuntu?

@mamedov
Copy link
Author

mamedov commented Oct 24, 2011

mamedov@mamedov-laptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.10
Release:    11.10
Codename:   oneiric

@docwhat, I have 64-bit Ubuntu installation :)

@guzaho
Copy link

guzaho commented Oct 24, 2011

Same here. Ubuntu 11.10 64 bits. Default Mozilla Firefox.

@docwhat
Copy link
Owner

docwhat commented Oct 24, 2011

Okay, I need to update my VM from 11.04 then.

@guzaho
Copy link

guzaho commented Oct 25, 2011

Hello again DocWhat: It didn't work on 11.04 64bits either, just so you know :)

@docwhat
Copy link
Owner

docwhat commented Oct 25, 2011

oh goody. So maybe I can't reproduce this easily. sigh

@guzaho
Copy link

guzaho commented Oct 25, 2011

Why not? Can I help?

@docwhat
Copy link
Owner

docwhat commented Oct 25, 2011

Because it worked fine in 11.04 for me. :-(

Let me finish updating my Ubuntu VM and if I can't reproduce it, then we can maybe see about tag-teaming this bug.

@guzaho
Copy link

guzaho commented Oct 25, 2011

Ok, let me know

Christian Höltje reply@reply.github.com wrote:

Because it worked fine in 11.04 for me. :-(

Let me finish updating my Ubuntu VM and if I can't reproduce it, then we can maybe see about tag-teaming this bug.

Reply to this email directly or view it on GitHub:
#18 (comment)

@docwhat
Copy link
Owner

docwhat commented Oct 25, 2011

Okay, I cannot reproduce anything. If you'd be willing to try to walk through this together, that'd be great. If you go to my website and contact me through one of my "alter egos" we can set up some way to work on this together.

Thanks again.

@mamedov
Copy link
Author

mamedov commented Oct 25, 2011

In which timezone you are located now? How about to work together after 8
hours. Now I have to sleep :)

My timezone is - GMT +5, 23:25 local time

Best Regards,
Mamed Mamedov

Sent from an Android...
On Oct 25, 2011 11:23 PM, "Christian Höltje" <
reply@reply.github.com>
wrote:

Okay, I cannot reproduce anything. If you'd be willing to try to walk
through this together, that'd be great. If you go to my website and contact me through one of my "alter egos" we can
set up some way to work on this together.

Thanks again.

Reply to this email directly or view it on GitHub:
#18 (comment)

@guzaho
Copy link

guzaho commented Oct 25, 2011

Allright, I've added you to chat on gmail. Did you get my invitation?

@guzaho
Copy link

guzaho commented Oct 25, 2011

Well.. guess what.. I set up /usr/bin/vim as my favorite editor, but I
realized that if I set /usr/bin/gvim instead, everything works fine!
PEBCAK!!!! Sorry for the bother... :O

@docwhat
Copy link
Owner

docwhat commented Oct 25, 2011

guzaho: Huh....no I didn't. Glad you got it to work anyway. :-)

@docwhat
Copy link
Owner

docwhat commented Oct 25, 2011

mamedov: Alas, I'm -4 or -5 UTC. Give me an IM tomorrow evening and I'll try to walk through some of this with you while I'm at work.

@mamedov
Copy link
Author

mamedov commented Oct 26, 2011

@docwhat, OK :) I have sent you invitation. Did you recevied it?

@docwhat
Copy link
Owner

docwhat commented Oct 26, 2011

@mamedov was awesome and let me virtually look over his shoulder and try to troubleshoot this.

What we found out was:

  • Changing runwAsync() to runAsync() or even run() didn't fix it.
  • There is no helpful messages displayed any place... I should probably look into a way to capture stderr/stdout and display that too (issue Capture stdout/stderr of editor #22).
  • As before, replacing the Ubuntu firefox 7.0.1 with the official one fixed the problem.

Conclusion:

Firefox 7.0.1 in Ubuntu is broken in some subtle way. I'm going to try taking the .deb apart to see if I can spot the difference. Both of the people who had trouble with this were using non-US languages and I can't reproduce it in my Ubuntu VM. I wonder if i18n is breaking it in some way.

@docwhat
Copy link
Owner

docwhat commented Oct 26, 2011

WORKAROUND:

Get the latest official version of Firefox and use that instead of the one shipped with Ubuntu.

@docwhat
Copy link
Owner

docwhat commented Oct 26, 2011

@mamedov - Can you go to https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/882125 and subscribe yourself in case they have additional questions?

Also, can you add the following information:

  1. The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
  2. The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center

Thanks again for your help.

@chrisccoulson
Copy link

Note, this turned out to not be a bug at all, as the reporter had set the Firefox Apparmor profile shipped in Ubuntu to enforce mode.

@docwhat
Copy link
Owner

docwhat commented Oct 27, 2011

Before I close this, I need to detect ubuntu (or at least linux) and add a message explaining to the user to check their apparmor settings.

@guzaho
Copy link

guzaho commented Oct 27, 2011

And perhaps a more explanatory error message for misconfigurations? :)

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

"Christian Höltje" reply@reply.github.com wrote:

Before I close this, I need to detect ubuntu (or at least linux) and add a message explaining to the user to check their apparmor settings.

Reply to this email directly or view it on GitHub:
#18 (comment)

@ThomasMcA
Copy link

Please note that this is not necessarily a misconfiguration. It's a default setting that happens to break It's All Text. I didn't intentionally install apparmor, let alone misconfigure it.

For the benefit of users that might find this thread while trying to get rid of this error, here's how to fix it.

If It's All Text dies with an "exited with a status of 1" error in .deb-based flavors of Linux like Ubuntu, here's how to fix that error.

To see if this will fix your error, run this command:

sudo aa-status

If you get output like "14 profiles are in enforce mode" then these instructions will work for you - continue with the following steps.

Look in the /etc/apparmor.d/ folder for a file called (or starts with) usr.bin.firefox.

Edit that file with your favorite editor using superuser priveleges. You'll need to add a line that points to the editor that you configured It's All Text to use. In my case, that's kate, and the path to kate's binary is /usr/bin/kate.

Using the above path, add one or two lines into the middle of usr.bin.firefox, like this:

I added this on 2/17/2012 to allow firefox access to the kate binary for the It's All Text addin

/usr/bin/kate ixr,

The line that starts with # is just a comment. The /usr/bin/kate portion must point to your editor. The ixr portion gives Firefox permission to run your editor. The comma at the end of the line is required.

To make this change be seen by Firefox, either restart your computer, or run this command:

sudo /etc/init.d/apparmor restart

@ThomasMcA
Copy link

Ooh, crap. That bolded "I added this" line is just a comment - it starts with #, and this web site made it big and ugly.

@guzaho
Copy link

guzaho commented Feb 19, 2012

What do you mean it's not a misconfiguration?

If I set an invalid path to my editor, I have misconfigured It's all Text, have I not? :)

What I wanted you to understand was that giving It's all Text an invalid path should show a descriptive message, not just "Editor exited with status of 1".

@ThomasMcA
Copy link

"Misconfigured" implies that the user changed some setting incorrectly. This problem happens because of a default setting. Let's not argue about semantics. :) An informative error message would still help.

@guzaho
Copy link

guzaho commented Feb 19, 2012

agreed. :) Sorry if I sounded pedantic.

@docwhat
Copy link
Owner

docwhat commented Feb 22, 2012

Absolutely. It needs a better message. Possibly pointing to a wiki page or something similar for Linux users.

@rpattabi
Copy link

I tried this workaround. Doesn't work for me. I have 64bit ubuntu 11.10

@mamedov
Copy link
Author

mamedov commented Apr 25, 2012

@rpattabi , you did installed official Firefox on Ubuntu or what?

@rpattabi
Copy link

@mamedov Yes. It is the official firefox installation that came with Ubuntu out of the box.

@mamedov
Copy link
Author

mamedov commented Apr 25, 2012

@rpattabi , try to use firefox downloaded from firefox.com :)

@docwhat
Copy link
Owner

docwhat commented Apr 26, 2012

@rpattabi If you tried putting your editor's path into the apparmor file and it didn't work, can you try running the editor via the command line? It should have given you the path.

If that works, then I suspect your apparmor file isn't set up right. You can either bypass the apparmor security by downloading the latest from firefox.com (which won't have problems with the default apparmor settings) or you can ask for help on the various Ubuntu forums.

@rpattabi
Copy link

@mamedov @docwhat There is no issue running the editor from command line. I gave the correct path which I got from which. I am currently on Windows (which is another workaround to address this problem ;--).

I am moving to latest ubuntu sometime this week. I don't expect this problem on the latest ubuntu (with latest firefox) based on your explanations. I will confirm the same here.

@rpattabi
Copy link

rpattabi commented May 6, 2012

With latest ubuntu 12.04 and latest firefox 12.0, I have the same issue

I ran this command: /usr/bin/vim /home/ragu/.mozilla/firefox/6sg2p6v2.default/itsalltext  /trello.com.24302u3d1e.txt  

...and it exited with a status of 1.  

The work around suggested didn't work, again. While doing the last step in the work around, that is, sudo /etc/init.d/apparmor restart I noticed the following

 * Reloading AppArmor profiles   
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox  
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd  
                                                                         [ OK ]  

Does it mean that the update didn't affect the required files?

@docwhat
Copy link
Owner

docwhat commented May 6, 2012

@rpattabi I'm not sure. I don't use AppArmor normally and I'm waiting to update my Ubuntu box until 12.04.1 comes out.

@ThomasMcA do you have any suggestions?

@rpattabi
Copy link

rpattabi commented May 7, 2012

@docwhat I posted this comment to Bug #882125 you created at Launchpad.

@ThomasMcA
Copy link

howtoforge.com suggests disabling apparmor here: http://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3-p3

Use these commands to do that:
sudo /etc/init.d/apparmor stop
sudo update-rc.d -f apparmor remove
sudo apt-get remove apparmor apparmor-utils

After removing apparmor on my system, ItsAllText still couldn't launch vim. Perhaps these changes need a system restart.

@docwhat
Copy link
Owner

docwhat commented May 7, 2012

@ThomasMcA Can you try restarting and see if that helps? If not, then this may be a new issue...

@ThomasMcA
Copy link

After a restart, trying to use vim gives the same error. When I changed it back to kate, it works. (I am replying using kate.)

@docwhat
Copy link
Owner

docwhat commented May 7, 2012

vim or gvim? vim won't work because it's a terminal program.

@ThomasMcA
Copy link

I was using vim. I changed it to gvim, and it worked. (I am replying right now via gvim.) I assume the O/P was also using vim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants