I installed Enigmail extension within Thunderbird. So, when I'm about to shutdown portableapps launcher a message is displayed that portableapps can't stop because dirmngr is still running.
When Thunderbird is shut down then GPGShutdown is called which properly terminates gpg-agent but leaves dirmngr running.
GPGShutdown should also terminate dirmgr. dirmngr can't even be terminated by means of gpgconf: .\portableapps.com\PortableApps\CommonFiles\GPG\bin\gpgconf.exe --kill dirmngr
This is addressed in today's release of GPG Portable 2.2.7. The custom shutdown routine I wrote will attempt to use the documented (but currently unimplemented) shutdown procedure for dirmngr.exe. After that fails, it will then forcibly shut it down.
Sometimes, the impossible can become possible, if you're awesome!
Currently I can see the very same problem I reported last year when terminating Thunderbird. GPGShutdown doesn't shut down processes gpg-agent and dirmngr. Both have to be killed manually. I'm running the very last releases of Thunderbird and gpg.
Just for cempleteness: on my Windows machine there is full gpg4win installation. I'm running Thunderbird from a PortableApps installation on a USB device along with a portable version of gpg.
When I start Thunderbird and open Options->Settings Menu-dialogue it can be seen that gpg-agent and after some time dirmngr are startet.
It would appear you're hitting the high process count bug present in all NSIS process plugins available. Too many processes and it'll always tell the caller the process is not running. I'll need to update GPGShutdown to handle high process counts the way I have other of our utilities like the PA.c Installer.
For the curious, FindProc won't return 1 here even when it's running:
Please try downloading this updated GPGShutdown.exe and replacing the existing one and let me know if that works for you.
Sometimes, the impossible can become possible, if you're awesome!
Hi John,
because there is a dirmngr.exe again I had a look at my post and saw your notice. After downloading the updated GPGShutdown.exe I realized that this one was already provided with GPG_Plugin_Portable_2.2.19.paf.exe. Because this update has already been installed before running Thunderbird I conclude that the fix does not work in my case.
Best regards
CC
This update was just included yesterday. As I heard nothing back from you, I was hoping it would solve the issue. Are you sure the current version of both is not working for you?
Also, I don't know what this means: "because there is a dirmngr.exe again I had a look at my post and saw your notice."
Sometimes, the impossible can become possible, if you're awesome!
Hi John,
I compared the Hash of both files: identical. I noticed, that the problem arises if TB is being kept running for some time. When closing TB, then in case of success there comes a messagebox containing the local path of Firefox (no idea why). In case of failure, the messagebox contains the number 0.
I've made some screen shots of the messagesboxes as well as of the processes screen of process explorer. If needed I can upload those files (where?).
Trying to shutdown dirmngr from command line gives this message:
PS C:\Users\xxxxx> I:\portableapps.com\PortableApps\CommonFiles\GPG\bin\dirmngr.exe --shutdown
dirmngr[1196]: No ldapserver file at: 'C:\Users\xxxxxxxx\AppData\Roaming\gnupg\dirmngr_ldapservers.conf'
Best regards
Neither the current official TB Portable launcher nor the GPGShutdown.exe routine have such message boxes within them. Do you have a second copy of GPG within TB Portable itself?
Sometimes, the impossible can become possible, if you're awesome!
No there is no second copy within TB. As I mentioned before there is a local installation of the gpg4win package (gpg, kleopatra,...).
The message box is related to GPGShutdown.exe (checked with process explorer: Find Window's Process (drag over window)).
The process image is I:\portableapps.com\PortableApps\CommonFiles\GPG\GPGShutdown.exe called from Thunderbird.exe.
Here is the hash of GPGShutdown.exe (latest GPG Plugin package).
SHA256 C4BF899D586D3DD8599CCBFCDEB26460FAE3535D2656B62EA2F50AD780D981BD I:\portableapps.com\PortableApps\CommonFiles\GPG\GPGShutdown.exe
I ran some more tests and recorded those with process monitor. gpg-agent is terminated successfully, dirmngr.exe isn't:
commands run by GPGShutdown.exe
"I:\portableapps.com\PortableApps\CommonFiles\GPG\bin\gpg-connect-agent.exe" /bye
"I:\portableapps.com\PortableApps\CommonFiles\GPG\bin\gpg-connect-agent.exe" killagent /bye
This test version of GPG Shutdown: https://portableapps.com/downloads/temp/GPGShutdown.exe
It's version 2.2.1 and should have 3 message boxes if it sees dirmngr.exe running. One message if it can't find it. MD5 is 286a502ef1a07a4ccd315d2ef80f983c
Sometimes, the impossible can become possible, if you're awesome!
Hi John,
made 2 tests:
local gpg-agent and corresponding dirmngr is running
1) starting TB, opened options->settings dialogue the gpg-agent has been started. After some while (about 10-15 min) portableapps's dirmngr has been started. Terminating TB runs GPGShutdown and there were 3 message boxes, the first one "dirmngr.exe is running", second "dirmngr.exe path: " and last one "killing dirmngr". That one works.
2) Started TB again, opened options->settings dialogue to start gpg-agent and waited until portableapp's dirmngr has been started again. Terminated TB, first message box contained again "dirmngr.exe is running" but second now "dirmngr.exe path: " resulting in stopping successfully portableapps's gpg-agent but left portableapp's dirmngr running. Now local and portableapp's dirmngr are still running.
Best regards
CC
Was a path listed?
Sometimes, the impossible can become possible, if you're awesome!
Yes, it was. It put it into the comment, but as I notice now I did it wrong (used angle brackets without escape character, hence text "disappeared").
In case 1 it was the path of portableapps, in case 2 the path of the local installation.
After case 2 I never succeeded to stop portableapp's dirmngr because the local one has been display. Did one more test: ran gpgconf --kill dirmngr which terminate dirmngr of local installation (portableapp's still running), then terminating TB shutdown portableapp's gpg-agent as well as dirmngr (with all 3 three message boxes, in second path to portableapps installation).
If you have multiple copies of dirmngr running, this will NOT close it. The above will work when you're only running one copy. Our only alternative given the current tools for users with way too many processes running is to kill all of them, local and portable.
Otherwise, you'll need to ask GPG to properly support shutting down dirmngr by supporting the command line parameter they have documented (which doesn't currently work).
Sometimes, the impossible can become possible, if you're awesome!
I opened an entry in the gpg4win forum and will see what the dev team will respond. I'll keep you updated here.
+1
Every time I close TB portable, I get a message box titled "GPG Shutdown | PortableApps.com" and the content is the local path to Firefox (not Firefox portable).
I too have gpg4win installed. Version gpg4win-3.1.10. I'm pretty sure the message box started appearing since I installed gpg4win.
I'll follow this thread to see if you find a solution. But let me know if I can help with additonal information.
To replicate this still extant problem: install Git for Windows adding git's usr/bin directory containing gpg.exe et al to your PATH and reboot.
You will now see the following GPG Shutdown | PortableApps.com 0 Dialog every time you shutdown PortableApps Thunderbird and when you start it twice!
https://drive.google.com/file/d/1Om2gerA5qX26ggWbO1-VdKKGIJc8rAN1/view
Starting Thunderbird from a batch file which removes git usr/bin form the path first or kills the GPG Shutdown window after (more ugly) might be the only answer for me..
The last 2 - 3 years I see this error message (whatever I have tried) whenever I exit thunderbird even if i use for 5 seconds or 2 hours!
dirmngr.exe is not running
Thunderbird has kept all my emails these years and I am afraid I am going to lose my emails if I reinstall it in the portable apps directory
Any more ideas apart from what is mentioned here are welcomed!
You can uninstall GPG Portable. It's no longer used by modern Thunderbird as it has GPG support built in.
Sometimes, the impossible can become possible, if you're awesome!
Thanks for confirming, John! I was already wondering but had not done the research.
I deinstalled GPG Portable and think I now understand the reason for the misleading error message
"dirmngr.exe is not running"
Enigmail was never correctly installed on this TB. So the error message was correct, in fact. dirmngr was not running!
Just in case anyone still comes across this error.
Are you saying that deleting the GPG folder from CommonFiles will be permanent? I don't recall ever installing it.
I have recently transferred my Thunderbird profile from an installed version and am now receiving this message: GPG Shutdown | PortableApps > dirmngr.exe is not running.
For me, removing the Common Files\GPG folder stopped the error message from appearing.
Thanks for your response. I wanted to make sure the app wouldn't reinstall. Since John T. Haller has issued a fix, I'll try that for now.
The message has been removed in GPG 2.3.1
Sometimes, the impossible can become possible, if you're awesome!
Thanks. I just installed GPG 2.3.1, so we'll see how that works. Since I have GPG4Windows installed, should I remove this folder permanently anyway?
Most people no longer need it as Thunderbird no longer supports it
Sometimes, the impossible can become possible, if you're awesome!
OK, thanks. Then I'll go ahead and delete the GPG folder. I see that TB doesn't need an external 3rd party GPG program.