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

libunbound: couldn't open library / libunbound not correctly initialized #170

Closed
nataedu opened this issue Sep 12, 2019 · 16 comments
Closed
Assignees
Labels
Milestone

Comments

@nataedu
Copy link

nataedu commented Sep 12, 2019

I updated my Thunderbird to the last version and the DKIM verificator add-on stopped working. The status bar shows this brief error : Error in the DNS resolver.

If I open the error console setting the debeug levels I have the following errors :

DKIM_Verifier.libunbound	DEBUG	libunboundWorker: Posting exception back to main script: Error: libunbound not correctly initialized (ub_resolve missing)
libunbound.jsm:297
DKIM_Verifier.Verifier	ERROR	DKIM verifier internal error (DKIM_DNSERROR_UNKNOWN): libunboundWorker: Error: libunbound not correctly initialized (ub_resolve missing)(resource://dkim_verifier/helper.jsm:430:3) JS Stack trace: libunboundWorker.onmessage@libunbound.jsm:316:16
libunbound.jsm:316:16
DKIM_Verifier.Verifier	DEBUG	Exception on DKIM-Signature 1
dkimVerifier.jsm:1295

@lieser lieser self-assigned this Sep 12, 2019
@lieser
Copy link
Owner

lieser commented Sep 12, 2019

Just tested it with TB 68.1.0, and could not reproduce it.

My guess is that loading the library failed. If the loading works, you should see the following in the logs:

9/12/2019, 20:50:49	DKIM_Verifier.libunbound	DEBUG	initialized
libunbound.jsm:197
9/12/2019, 20:50:49	DKIM_Verifier.libunbound	DEBUG	libunboundWorker: libunbound loaded
libunbound.jsm:297
9/12/2019, 20:50:51	DKIM_Verifier.libunbound	DEBUG	libunboundWorker: context created

Please make sure it still at the path specified by you.
If you used the one shipped by the DNSSEC Validator add-on it was probably removed from TB during the update. Check https://github.com/lieser/dkim_verifier/wiki/DNS#windows-use-the-libunbound-library-in-the-dnssec-validator on how to get the dll again.

@lieser lieser added the bug label Sep 12, 2019
@nataedu
Copy link
Author

nataedu commented Sep 12, 2019

I double checked the path and restarted the computer (on Windows sometimes that does wonders), and the error changed :
DKIM_Verifier.libunbound FATAL Exception in libunboundWorker: DKIM verifier internal error (DKIM_DNSERROR_UNKNOWN): libunboundWorker: Error: couldn't open library C:\Program Files\Mozilla Thunderbird\extensions\libDNSSECcore-windows-x86.dll: error 193(resource://dkim_verifier/helper.jsm:430:3) JS Stack trace: libunboundWorker.onmessage@libunbound.jsm:316:16

The .dll is at the right location, so I don't understand what is wrong.
I use TB with the x64 version.

@lieser
Copy link
Owner

lieser commented Sep 12, 2019

Are you sure you are using a dll for x64?

See also #122 (comment) for a link to a x64 dll.

@lieser
Copy link
Owner

lieser commented Sep 21, 2019

@nataedu Could you fix the issue? If yes, please close this.

@SilmorSenedlen
Copy link

SilmorSenedlen commented Sep 22, 2019

@lieser I think it's need to update wiki section about libunbound configuration.
Something like this:

  1. Go to download page of Unbound DNS resolver: https://nlnetlabs.nl/projects/unbound/download/
  2. Download "Binaries (no install)" zip package depending on your version of Thunderbird: 32-bit(x86) or 64-bit(x64)
  3. Open downloaded archive and go to libunbound sub-directory unbound-1.9.3.zip\libunbound\
  4. Extract following file:

For 32-bit(x86):

libcrypto-1_1.dll
libssl-1_1.dll
libunbound-8.dll

Or for 64-bit(x64):

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll
libunbound-8.dll

To your Thunderbird profile extensions directory.

For example:

C:\Users\your_profile_name\AppData\Roaming\Thunderbird\Profiles\profile_name\extensions\

  1. Open DKIM Verifier add-on options.
  2. Go to General >> DNS
  3. Select libunbound in Resolver dropdown list.
  4. Set Path as extensions/libunbound-8.dll and Path relative to profile directory checkbox.

Tested on Thunderbird 68.1.0 (64-bit) with DKIM Verifier 3.0.1 and DLL's from Unbound 1.9.3 x64 package.

@nataedu
Copy link
Author

nataedu commented Sep 23, 2019

So @lieser I couldn't fix the issue, and after following step by step the instructions given by @SilmorSenedlen I could not fix the issue. I still get an error :
23/09/2019, 17:40:36 DKIM_Verifier.libunbound FATAL Exception in libunboundWorker: DKIM verifier internal error (DKIM_DNSERROR_UNKNOWN): libunboundWorker: Error: couldn't open library C:\Users\<user>\AppData\Roaming\Thunderbird\Profiles\<profile>\extensions/libunbound-8.dll: error 126(resource://dkim_verifier/helper.jsm:430:3) JS Stack trace: libunboundWorker.onmessage@libunbound.jsm:316:16

I am also in Thunderbird 68.1.0 (64-bit) with DKIM verifier 3.0.1 and downloaded the DLL from Unbound 1.9.3 for the x64 architecture

@SilmorSenedlen
Copy link

SilmorSenedlen commented Sep 23, 2019

@nataedu looking more closely to your DLL's path from the log:

C:\Users\<user>\AppData\Roaming\Thunderbird\Profiles\<profile>\extensions/libunbound-8.dll

on the part \extensions/

It's strange. In my case extensions/libunbound-8.dll and Path relative to profile directory checkbox work well.

Try to change / to \ in the Path

Upd. In my case work well either way.

@nataedu
Copy link
Author

nataedu commented Sep 23, 2019

I know. I put the relative path as you had suggested, and tried both '\' and '/'. The file is there but I get the same error

@SilmorSenedlen
Copy link

SilmorSenedlen commented Sep 23, 2019

@nataedu
Try to remove add-on and delete all preferences with prefix extensions.dkim_verifier from Options >> Advanced >> Config Editor(about:config) and restart TB.

@nataedu
Copy link
Author

nataedu commented Sep 23, 2019

I tried and I still get the same error.

@d4k0
Copy link

d4k0 commented Sep 23, 2019

@nataedu
I have the exact same problem with Thunderbird 68.1.0 x64, DKIM verifier 3.0.1 and Unbound 1.9.3 x64. Somehow the extension can't load the DLL:

23.9.2019, 21:04:20 DKIM_Verifier.libunbound FATAL Exception in libunboundWorker: DKIM Verifier Interner Fehler (DKIM_DNSERROR_UNKNOWN): libunboundWorker: Error: couldn't open library C:\Users\<user>\AppData\Roaming\Thunderbird\Profiles\wnxacr0f.default\extensions\libunbound-8.dll: error 126(resource://dkim_verifier/helper.jsm:430:3) JS Stack trace: libunboundWorker.onmessage@libunbound.jsm:316:16 libunbound.jsm:322

The path that is shown in the log is correct. Before the 64-bit version of Thunderbird existed, it worked with the x86 version of libunbound if I remember correctly (I responded in a ticket back then).

I will probably test it again with a portable version of Thunderbird and a new profile this weekend.

@lieser
Copy link
Owner

lieser commented Sep 23, 2019

I did some experimenting, and found that the loading of the dependent libraries has some weird behavior. If it was one loaded by TB, TB seems to always try to load it from the same path again. Restarting TB, or even Windows did not change anything for me.

For testing I now added the ability to explicitly load more libraries before libunbound.
Please try it with dkim_verifier@pl-beta.zip (This is for TB68)

You also need to specify the path to the dependencies, separated by ;, in the correct order.
E.g.:

extensions/libcrypto-1_1-x64.dll;extensions/libssl-1_1-x64.dll;extensions/libunbound-8.dll

If this does still not help, please enable tracing by setting extensions.dkim_verifier.logging.console to Trace, and post the DKIM_Verifier.libunbound messages.

Also try to load the libraries in the above order with ctypes.open(<full path>).

@lieser lieser changed the title Bug on DKIM verification with libunbound in thunderbird 68.1.0 libunbound: couldn't open library / libunbound not correctly initialized Sep 23, 2019
@lieser lieser added this to the 3.0.2 milestone Sep 23, 2019
@d4k0
Copy link

d4k0 commented Sep 24, 2019

@lieser
Nice, it seems to work now! When the first request is made, Windows Firewall now also asks for permission.

@nataedu
Copy link
Author

nataedu commented Sep 28, 2019

@lieser Works for me too! I have also the request from the Windows Firewall.
Thanks for the help!

@nataedu nataedu closed this as completed Sep 28, 2019
@lieser lieser modified the milestones: 3.0.2, 2.2.0 Jan 5, 2020
@Pascal666
Copy link

  1. Go to download page of Unbound DNS resolver: https://nlnetlabs.nl/projects/unbound/download/
  2. Download "Binaries (no install)" zip package depending on your version of Thunderbird: 32-bit(x86) or 64-bit(x64)

The DLLs appear to no longer be available on that page. Does anyone know the new location or have a copy they can post?

@SilmorSenedlen
Copy link

SilmorSenedlen commented Mar 5, 2020

Does anyone know the new location

Sadly not. We should ask the developers of unbound.

have a copy they can post?

Below are archives with 3 previously mentioned files from the last published binary version(1.9.3).
libunbound_files_1.9.3_x86.zip
libunbound_files_1.9.3_x64.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants