Bug - Fixed Linux relay browser launching broken

Trying to launch the relay browser by clicking the button in the toolbar (or any other method) in r11593 results in nothing happening (no browser launches). Manually opening the browser and navigating to localhost:60080/game.php works after the relay server is running.

I'm using Kubuntu 12.10, Java 7u9 (Java 6 isn't available for this OS).

EDIT: Getting Unexpected error, debug log printed after EVERY request. Not sure what's broken; attached is all the stack traces. (Since there are so many debug logs, the file's FAR bigger than usual.)
 
Last edited:

Catch-22

Active member
Hola changed the BareBones launcher quite a bit and I'm just catching up on what he's done.

First of all, can you tell me what the CLI output of "get preferredWebBrowser" is?
 

Catch-22

Active member
Okay, 2nd question, are you in a headless environment?

Edit: Wait, that's a silly question because you probably wouldn't be clicking a button if you were.
 

holatuwol

Developer
Well, only thing I can think of is if the java.awt.Desktop.browse(java.net.URI) strategy does nothing on Kubuntu 12.10 with Java 7 or something, since I'm not seeing like that on Xubuntu 11.10. Try r11598, I've swapped out the code so that it always uses the fallback.
 

Catch-22

Active member
Well, only thing I can think of is if the java.awt.Desktop.browse(java.net.URI) strategy does nothing on Kubuntu 12.10 with Java 7 or something, since I'm not seeing like that on Xubuntu 11.10. Try r11598, I've swapped out the code so that it always uses the fallback.

There's no such thing as that method doing nothing, it's either working or throwing an exception. What's doing nothing is your exception handler.

You should also add gvfs-open to your list of UNIX_BROWSERS and remove all the "which" stuff as it's not needed when you're using handlers instead of actual browsers.

Edit: I don't know why you completely removed the loadAWTDesktopBrowser method from loadUnixBrowser, it should use the AWT method and fallback to manual methods if the AWT method fails (unless they manually set their preferredWebBrowser). You should add some exception handling to know what's actually going wrong, it's probably a restrictive security policy setting that is causing the AWT method to fail, falling back to the manual method, not finding any of the UNIX_BROWSERS and then doing nothing.
 
Last edited:
Well, only thing I can think of is if the java.awt.Desktop.browse(java.net.URI) strategy does nothing on Kubuntu 12.10 with Java 7 or something, since I'm not seeing like that on Xubuntu 11.10. Try r11598, I've swapped out the code so that it always uses the fallback.
Sigh. 11598 isn't on the KoLmafia daily builds site yet, so I cannot test. :3
 

Veracity

Developer
Staff member
Since you release Java programs yourself, you obviously have the tools to build KoLmafia yourself. Perhaps you should consider doing that.
 

emelye

New member
Trying to launch the relay browser by clicking the button in the toolbar (or any other method) in r11593 results in nothing happening (no browser launches). Manually opening the browser and navigating to localhost:60080/game.php works after the relay server is running.

This is a me-too post. I'm having exactly the same issue, and, fortunately, wrldwzrd89's work-around works for me.

I'm too much of a Linux newbie to be able to participate in troubleshooting this bug efficiently, so I'm not looking for support unless someone is really jazzed about holding my hand to work on this.

I'm running mafia build r11598 on Ubuntu Linux Mint 12 Lisa and Java 6. I don't get an Unexpected Error or log output.

Thanks for all y'all do to maintain Mafia for the community.
 

holatuwol

Developer
There's no such thing as that method doing nothing, it's either working or throwing an exception. What's doing nothing is your exception handler.
I phrased that poorly then. It's either doing nothing and returning true or it's throwing an exception which results in it returning false, which results the fallback code running and doing nothing. However, I'll go ahead and add debug tracing in case it captures anything when trying to run either the fallback code or the original code.

You should also add gvfs-open to your list of UNIX_BROWSERS and remove all the "which" stuff as it's not needed when you're using handlers instead of actual browsers.
Actually, since all the handlers are actually in /usr/bin, the which logic is still applicable.

Code:
$ which sensible-browser
/usr/bin/sensible-browser

Edit: I don't know why you completely removed the loadAWTDesktopBrowser method from loadUnixBrowser, it should use the AWT method and fallback to manual methods if the AWT method fails (unless they manually set their preferredWebBrowser).
Explained above. The only way the behavior wrldwzrd89 can get the behavior he's getting is if the method returns true (the code thinks that launching the browser was successful) and stops the fallback, or if the fallback logic itself is failing. As such, I decided to assume the former. I've also added the suggested stack trace printing in case it's the latter.
 

Catch-22

Active member
The only way the behavior wrldwzrd89 can get the behavior he's getting is if the method returns true (the code thinks that launching the browser was successful) and stops the fallback, or if the fallback logic itself is failing. As such, I decided to assume the former. I've also added the suggested stack trace printing in case it's the latter.

I assumed the latter. KDE comes with it's own browser launcher which could be added for this purpose, "kfmclient openURL". It would need special handling because "which" would mess things up for it.
 
Tested with r11602. Relay browser opens now, but is opening rekonq rather than the default I've set of Chromium. This is definitely an improvement over the situation in earlier builds.
 

Catch-22

Active member
Tested with r11602. Relay browser opens now, but is opening rekonq rather than the default I've set of Chromium. This is definitely an improvement over the situation in earlier builds.

The fallback method, which is currently the only method being used for Linux if you leave it at default, is just trying a bunch of commonly known browsers and launching the first one that works.

If Holatuwol reverts the change made in r11598 and adds in some exception handling, we should be able to determine what is actually causing the native Java function to fail and get you to fix that issue instead. My money is on permissions.
 

holatuwol

Developer
I'll go ahead and go with the recommendation to rollback 11598, but I'm not convinced that everything won't just quietly fail again. That being said, to see what's going on with loading the default browser via fallback methods, can you go ahead and enter the following commands into your terminal?

Code:
xdg-open http://www.google.com/
exo-open http://www.google.com/
gnome-open http://www.google.com/
gvfs-open http://www.google.com/
sensible-browser http://www.google.com/
open http://www.google.com/
firefox http://www.google.com/
netscape http://www.google.com/
 

nworbetan

Member
I don't know if this is helpful or not, but in Fedora, most of those looked like:
Code:
bash: : command not found
But xdg-open found and opened my browser, and "open" gave: "Couldn't get a file descriptor referring to the console" as an output.
 

Catch-22

Active member
I don't know if this is helpful or not, but in Fedora, most of those looked like:
Code:
bash: : command not found
But xdg-open found and opened my browser, and "open" gave: "Couldn't get a file descriptor referring to the console" as an output.

Well, it shows that the fallback method would probably work okay for people running Red Hat based distros (such as Fedora, RHEL, CentOS).
 
Top