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

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

Open
Altonss opened this issue Apr 10, 2021 · 14 comments
Labels
bug Something isn't working flatpak Flatpak sandbox or packaging linux Relates some variant of Linux

Comments

@Altonss
Copy link

Altonss commented Apr 10, 2021

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 !

@skyjake skyjake added the question Further information is requested label Apr 11, 2021
@skyjake
Copy link
Owner

skyjake commented Apr 11, 2021

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.

@Altonss
Copy link
Author

Altonss commented Apr 11, 2021

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

@skyjake skyjake changed the title Unable to launch Lagrange 1.3.1 from Flathub Unable to launch Lagrange 1.3.1 or 1.3.2 from Flathub Apr 11, 2021
@skyjake
Copy link
Owner

skyjake commented Apr 11, 2021

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 skyjake added the linux Relates some variant of Linux label Apr 11, 2021
@Altonss
Copy link
Author

Altonss commented Apr 11, 2021

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?

@skyjake
Copy link
Owner

skyjake commented Apr 11, 2021

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.

@Altonss
Copy link
Author

Altonss commented Apr 11, 2021

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

@skyjake
Copy link
Owner

skyjake commented Apr 11, 2021

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

flatpak run fi.skyjake.Lagrange -E

What does it print?

@Altonss
Copy link
Author

Altonss commented Apr 11, 2021

I get this:
tabs.new

@skyjake
Copy link
Owner

skyjake commented Apr 12, 2021

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.

@Altonss
Copy link
Author

Altonss commented Apr 12, 2021

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

@skyjake
Copy link
Owner

skyjake commented Apr 12, 2021

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 skyjake added bug Something isn't working and removed question Further information is requested labels Apr 12, 2021
@skyjake skyjake changed the title Unable to launch Lagrange 1.3.1 or 1.3.2 from Flathub Flatpak sandbox vs. IPC (unable to launch Lagrange 1.3.1 or 1.3.2 from Flathub due to leftover .pid file) Apr 12, 2021
@skyjake skyjake changed the title Flatpak sandbox vs. IPC (unable to launch Lagrange 1.3.1 or 1.3.2 from Flathub due to leftover .pid file) Flatpak sandbox vs. IPC (unable to launch Lagrange 1.3 due to leftover .pid file) Apr 12, 2021
@skyjake skyjake changed the title Flatpak sandbox vs. IPC (unable to launch Lagrange 1.3 due to leftover .pid file) Flatpak sandbox vs. IPC (unable to launch v1.3 due to leftover .pid file) Apr 12, 2021
@Altonss
Copy link
Author

Altonss commented Apr 12, 2021

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

@skyjake
Copy link
Owner

skyjake commented Apr 12, 2021

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 added a commit that referenced this issue Apr 18, 2021
It may take a while to add D-Bus support, so adding a way to disable the incompatible IPC mechanism for Flatpak builds.

IssueID #245
skyjake added a commit that referenced this issue Apr 18, 2021
It may take a while to add D-Bus support, so adding a way to disable the incompatible IPC mechanism for Flatpak builds.

IssueID #245

# Conflicts:
#	src/ui/window.c
@skyjake
Copy link
Owner

skyjake commented Apr 19, 2021

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 skyjake changed the title Flatpak sandbox vs. IPC (unable to launch v1.3 due to leftover .pid file) Flatpak sandbox requires D-Bus for IPC (unable to launch v1.3 due to leftover .pid file) Apr 26, 2021
@skyjake skyjake added the flatpak Flatpak sandbox or packaging label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flatpak Flatpak sandbox or packaging linux Relates some variant of Linux
Projects
None yet
Development

No branches or pull requests

2 participants