Home   Manual

Flatpak: Do Molequeue need network access?

Hello,

I tried to use Avogadro2 with Molequeue with Flatpak build on openSUSE that I have added to Flathub sometime ago.
https://flathub.org/apps/details/org.openchemistry.Avogadro2

I noticed that Molequeue does not work. When I tried using Quantum > Input Generators > GAMESS > Submit Calculations…

It said

Cannot connect to MoleQueue server. Please ensure that it is running and try again.

Molequeue is already include in Avogadro2 Flatpak, but not start by default.
Normally Avogadro can be start with,

flatpak run org.openchemistry.Avogadro2

But I need to get Molequeue to work, so I have to add extra option to allow some feature through sandbox in Flatpak.

To start molequeue, I use this command.

flatpak run --command=molequeue --talk-name=org.freedesktop.Notifications --talk-name=o
rg.kde.StatusNotifierWatcher --share=network org.openchemistry.Avogadro2

This part give Molequeue access to menu tray. (need to add this to Flathub)

–talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifierWatcher

I assume that for Molequeue to talk to Avogadro2, it need some kind of network access.
So I add this in the command

–share=network

After starting Molequeue, I start Avogadro with this command.

flatpak run --talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifie
rWatcher --share=network org.openchemistry.Avogadro2

Even with network access I got the same error.

Cannot connect to MoleQueue server. Please ensure that it is running and try again.

Avogadro command log.

flatpak run --talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifie
rWatcher --share=network org.openchemistry.Avogadro2
Locale: “en_US”
translation success
“/usr/translations”
translation success
Extension plugins dynamically found… 31
Checking for “commands” scripts in “/home/kev/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/
Avogadro/commands”
Checking for “commands” scripts in “/app/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/usr/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/usr/share/runtime/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/run/host/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/app/bin/…/lib/avogadro2/scripts/commands”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L formats read”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L formats write”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L forcefields”
OBProcess::executeObabel: Running “/app/bin/obabel” “-V”
“/app/bin/obabel” found: “/app/bin/obabel: Open Babel 3.1.0 – Apr 21 2021 – 19:53:41”
Checking for “inputGenerators” scripts in “/home/kev/.var/app/org.openchemistry.Avogadro2/data/OpenChe
mistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/app/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/usr/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/usr/share/runtime/share/OpenChemistry/Avogadro/inputGenera
tors”
Checking for “inputGenerators” scripts in “/run/host/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/app/bin/…/lib/avogadro2/scripts/inputGenerators”
Checking for “formatScripts” scripts in “/home/kev/.var/app/org.openchemistry.Avogadro2/data/OpenChemi
stry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/app/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/usr/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in "/usr/share/runtime/share/OpenChemistry/Avogadro/formatScripts
"
Checking for “formatScripts” scripts in “/run/host/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/app/bin/…/lib/avogadro2/scripts/formatScripts”
ScriptLoader::queryProgramName: Unable to retrieve program name for “/app/lib/avogadro2/scripts/formatSc
ripts/cclibScript.py” ; “Error running script ‘/usr/bin/python3 /app/lib/avogadro2/scripts/formatScripts
/cclibScript.py --display-name --lang en_US’: Abnormal exit status 1 (Unknown error.: Unknown error)\n\n
Output:\nTraceback (most recent call last):\n File “/app/lib/avogadro2/scripts/formatScripts/cclibScri
pt.py”, line 22, in \n from cclib.io.ccio import ccopen\nModuleNotFoundError: No module name
d ‘cclib’\n”
“Navigator” added
“Editor” added
“Selection” added
“Manipulator” added
“BondCentric” added
“MeasureTool” added
“PlayerTool” added

Molequeue

flatpak run --command=molequeue --talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifierWatcher --share=network org.openchemistry.Avogadro2
Checking for plugins in “/app/lib/molequeue/plugins”
(“LocalSocketServer.so”)
Loaded “LocalSocketServer.so” →
OBJECT MoleQueue::LocalSocketConnectionListenerFactory::unnamed
SIGNALS OUT

SIGNALS IN

MoleQueue::Logger::~Logger() – Cannot determine working directory.
MoleQueue::Logger::~Logger() – Cannot determine working directory.

I’m not sure if this is sandboxs access blocking Molequeue or something else, do you have some clue?

Thanks.

Network access is certainly useful for Molequeue, but it doesn’t directly communicate with Avogadro using the network.

Instead, it uses local sockets.
https://doc.qt.io/qt-5/qlocalsocket.html

I haven’t gone through that code extensively - it’s basically all in the Molequeue codebase. It might use temporary files perhaps?

Thanks,

I tried giving molequeue and avogadro more permission from Flatpak.

–socket=system-bus
–socket=session-bus
–filesystem=host
–filesystem=home

Still same error.
Do you know how can I get more log out of this?
Thanks

flatpak run --command=molequeue --socket=system-bus --socket=session-bus --talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifierWatcher --share=network --filesystem=host --filesystem=home org.openchemistry.Avogadro2

flatpak run --socket=system-bus --socket=session-bus --talk-name=org.freedesktop.Notifications --talk-name=org.kde.StatusNotifierWatcher --share=network --filesystem=host --filesystem=home org.
openchemistry.Avogadro2

Let me think about it. I think the first part would be to see that the Molequeue process is running.

I think the main thing would be to add some sort of debugging statement about creating the local socket. I’ll look into that tonight.

I see Molequeue GUI with all the Job title, queue and all that. Is it consider running? I got that to happen, but same issue.

Issue report on this in stack exchange.

Yep. IIRC, that’s @Hypersphere here. Hopefully we can work through the issue. I don’t see much through Google search about Flatpak and QLocalSocket.

I have a few other things today, but should have time to investigate tomorrow.

@kevinsmia1939: Thanks for creating the flatpak for Avogadro! I have not tired it on OpenSUSE, but I installed the flatpak version of Avogadro in Linux Mint 20.1 Xfce (based on Ubuntu 20.04 LTS) and it seems to runs fine, including the input generators for quantum chemistry programs. However, I have not yet tried all of the features to see if they work as expected.

flatpak install flathub org.openchemistry.Avogadro2

The installation did not automatically create a menu entry in the Xfce Whisker menu, but I created a launcher based on the flatpak command:

flatpak run org.openchemistry.Avogadro2

I am also currently in the process of assessing quantum chemistry programs from the standpoint of their relative accessibility for non-specialists in quantum chemistry. To this end, it would be nice if someone could add a python script input generator for OpenMolcas.

Hello,
The input generators that run fine that you mention does not include working with Molequeue is it? The one with GAMESS > Submit Calculations…

I noticed that there are not avogadro menu entry for some reason, I’m looking into it, might as well add molequeue menu entry too.

About the OpenMolcas thing, I could add it, but is it simply just install along side Avogadro and it will work?

Oops! I had not yet tested the “Submit Calculations” feature. I just now tried this and I got the following error:

“Cannot connect to MoleQueue server. Please ensure that it is running and try again.”

Previously, I had tried to compile Avogadro2 from the source code, and it would get almost to the end and fail with errors. If I recall correctly, the errors had to do with MoleQueue.

Here is the output from starting Avogadro2 in the terminal:

=====

(base) rjrich@rjr-av2:~$ flatpak run org.openchemistry.Avogadro2
Gtk-Message: 17:03:05.644: Failed to load module “xapp-gtk3-module”
Qt: Session management error: Could not open network socket
Locale: “en_US”
translation success
“/usr/translations”
translation success
Extension plugins dynamically found… 31
Checking for “commands” scripts in “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/app/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/usr/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/usr/share/runtime/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/run/host/share/OpenChemistry/Avogadro/commands”
Checking for “commands” scripts in “/app/bin/…/lib/avogadro2/scripts/commands”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L formats read”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L formats write”
OBProcess::executeObabel: Running “/app/bin/obabel” “-L forcefields”
OBProcess::executeObabel: Running “/app/bin/obabel” “-V”
“/app/bin/obabel” found: “/app/bin/obabel: Open Babel 3.1.0 – Apr 21 2021 – 19:53:41”
Checking for “inputGenerators” scripts in “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/app/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/usr/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/usr/share/runtime/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/run/host/share/OpenChemistry/Avogadro/inputGenerators”
Checking for “inputGenerators” scripts in “/app/bin/…/lib/avogadro2/scripts/inputGenerators”
ScriptLoader::queryProgramName: Unable to retrieve program name for “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/generators.cmake” ; “Error running script ‘/home/rjrich/anaconda3/bin/python /home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/generators.cmake --display-name --lang en_US’: Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n File “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/generators.cmake”, line 3\n dalton.py\n ^\nSyntaxError: invalid syntax\n”
ScriptLoader::queryProgramName: Unable to retrieve program name for “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/LICENSE” ; “Error running script ‘/home/rjrich/anaconda3/bin/python /home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/LICENSE --display-name --lang en_US’: Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n File “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/LICENSE”, line 1\n Copyright (c) 2011-2018, Kitware, Inc.\n ^\nSyntaxError: invalid syntax\n”
ScriptLoader::queryProgramName: Unable to retrieve program name for “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/README.md” ; “Error running script ‘/home/rjrich/anaconda3/bin/python /home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/README.md --display-name --lang en_US’: Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n File “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/inputGenerators/README.md”, line 1\n Avogadro 2 Python Input Generators\n ^\nSyntaxError: invalid syntax\n”
Checking for “formatScripts” scripts in “/home/rjrich/.var/app/org.openchemistry.Avogadro2/data/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/app/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/usr/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/usr/share/runtime/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/run/host/share/OpenChemistry/Avogadro/formatScripts”
Checking for “formatScripts” scripts in “/app/bin/…/lib/avogadro2/scripts/formatScripts”
ScriptLoader::queryProgramName: Unable to retrieve program name for “/app/lib/avogadro2/scripts/formatScripts/cclibScript.py” ; “Error running script ‘/home/rjrich/anaconda3/bin/python /app/lib/avogadro2/scripts/formatScripts/cclibScript.py --display-name --lang en_US’: Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\nTraceback (most recent call last):\n File “/app/lib/avogadro2/scripts/formatScripts/cclibScript.py”, line 22, in \n from cclib.io.ccio import ccopen\nModuleNotFoundError: No module named ‘cclib’\n”
“Navigator” added
“Editor” added
“Selection” added
“Manipulator” added
“BondCentric” added
“MeasureTool” added
“PlayerTool” added

=====

The relevant bit might be at the beginning, “Could not open network socket”.

You can manually start molequeue with

flatpak run --command=molequeue org.openchemistry.Avogadro2

You can also install Flatseal form FLathub, which can adjust many flatpak sandbox permission if any of them broke the app.
But still, I could not get Molequeue to work even with those at the moment, I might be missing something.

Hmm. Maybe the first thing is to check that when you build openchemistry your local Linux machine (outside of Flatpak) Molequeue works?

I have a Mac, so I can confirm it’s fine … but Molequeue has been somewhat neglected for a few years. Another thread here indicated it works on Windows with a bit of work.

Would you be willing to try Molequeue on your local machine and start a separate thread? Then we can see whether it’s specific to Flatpak.

I install molequeue 0.9.0 it from openSUSE Tumbleweed repo.
I install Avogadro2 from my openSUSE personal repo.

Avogadro see Molequeue just fine.

I tried Flatpak Molequeue - normal Avogadro and vice versa, does not work for both.

I will ask Flatpak dev team, if there some kind of special permission needed.

1 Like

I not sure if this is related. I found in Flatpak doc.
https://docs.flatpak.org/en/latest/flatpak-command-reference.html?highlight=talk-name

@ghutchis Do you think it is relate some how? I’m not sure what session bus is, but I guess it allow apps to talk with each other?

–talk-name=NAME

Allow the application to talk to the well known name NAME on the session bus. If NAME ends with .*, it allows the application to talk to all matching names. This updates the [Session Bus Policy] group in the metadata. This option can be used multiple times. 

Some other Flatpak apps I see they have something like,

@Hypersphere
I update the Avogadro Flatpak.
Avogadro should have menu entry now. There should also be Molequeue entry as well. But have not solve cannot connect to molequeue yet.

Thanks. I have been able to compile Avogadro and associated programs (OpenChemistry) from source. Now I have the input generators and the submit button works. For the submit button to work, I need to start MoleQueue first.

Ok, I manage to make flatpak avogadro and flatpak molequeue work now, will update soon.
But I don’t know if it just me, flatpak avogadro is crashing randomly even without doing anything.

@Hypersphere @ghutchis

The new Avogadro build should be here now. Install it here.
https://flathub.org/apps/details/org.openchemistry.Avogadro2

Icon of Avogadro and Molequeue should be on the menu entry now.
Molequeue and Avogadro should work now. Please try Input generators > GAMESS > Submit Calculations…

Also, can you try open Avogadro for a few minutes without doing anything, does it crash?

Thanks.

I installed your flatpak version of Avogadro, sketched a molecule, and ran the input generator for GAMESS. Unfortunately, when I tried to submit the job, I got the same error message regarding the inability to connect via MoleQueue. In contrast, the submit job feature in the Avogadro compiled from source code does work. The flatpak Avogadro did not crash, but I might not have left it open for a long enough time.

Hey,

I just make an update again, not sure how long will it land on the official flathub repo, but check it out in a few hours.

1 Like