lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Flatpak sandbox requires D-Bus for IPC (unable to launch v1.3 due to leftover .pid file)

Open Altonss opened this issue 3 years ago • 14 comments

Lagrange crashed and now doesn't launch anymore. I am running Lagrange 1.3.1 from Flathub on Fedora 33. Do you know why this happened and how to fix this issue? Thanks for your help !

Altonss avatar Apr 10 '21 21:04 Altonss

Perhaps this is due to issue #243?

The fix for that is in v1.3.2 that I've submitted just now to Flathub. It should be up soon.

If it still crashes with v1.3.2 we'll need to try some troubleshooting.

skyjake avatar Apr 11 '21 11:04 skyjake

It just updated to 1.3.2, but Lagrange just doesn't open :(

Altonss avatar Apr 11 '21 12:04 Altonss

Well, let's first see if clearing the stored runtime state (tabs, etc.) helps.

Find the file state.lgr somewhere under the ~/.var/app/fi.skyjake.Lagrange/ directory and rename the file. When you launch Lagrange, all previously open tabs should be gone.

If it still crashes after this, do the same with prefs.cfg. That will reset your preferences to the defaults.

skyjake avatar Apr 11 '21 12:04 skyjake

Find the file state.lgr somewhere under the ~/.var/app/fi.skyjake.Lagrange/ directory and rename the file. When you launch Lagrange, all previously open tabs should be gone.

What name should I choose to rename the file?

Altonss avatar Apr 11 '21 12:04 Altonss

It could be state.lgr.old for example. The actual name doesn't matter as long as it's different so Lagrange doesn't use it.

skyjake avatar Apr 11 '21 12:04 skyjake

I renamed state.lgr, it didn't work. Then I renamed prefs.cfg but it doesn't work neither.

Altonss avatar Apr 11 '21 13:04 Altonss

All right, try launching the app from the command line like this:

flatpak run fi.skyjake.Lagrange -E

What does it print?

skyjake avatar Apr 11 '21 13:04 skyjake

I get this: tabs.new

Altonss avatar Apr 11 '21 13:04 Altonss

I see. That indicates Lagrange's IPC mechanism has a problem when running inside the Flatpak sandbox. Do you have an instance of Lagrange already running?

Check for a hidden .pid file in ~/.var/app/fi.skyjake.Lagrange/config/lagrange/ and delete it.

skyjake avatar Apr 12 '21 08:04 skyjake

Thanks it works now ! Do you know why this happened?

Altonss avatar Apr 12 '21 08:04 Altonss

This seems to happen if 1) you already have the app running, or 2) the app crashes/was killed and it didn't clean up after itself.

To fix this I'll need to figure out how to check for previously launched app instances under Flatpak, where the sandbox permissions seem to prevent them directly communicating with each other.

skyjake avatar Apr 12 '21 08:04 skyjake

Thanks for your help and explenations. I will not close the issue if it's a bug that needs to be fixed.

Altonss avatar Apr 12 '21 08:04 Altonss

Yes this does need to be addressed...

Since Flatpak supports D-Bus, that is probably the way to go here. The drawback is that we'll have to use the low-level C API directly since Lagrange does not rely on higher-level UI frameworks like GTK.

skyjake avatar Apr 12 '21 09:04 skyjake

v1.3.3 is available on Flathub with the IPC feature disabled (reverting to v1.2 behavior), so now it should allow launching multiple instances. However, they will overwrite each other's data, so for example newly added bookmarks might get lost.

skyjake avatar Apr 19 '21 03:04 skyjake