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

Using libunbound results in an internal error #385

Closed
ghost opened this issue Aug 17, 2023 · 15 comments
Closed

Using libunbound results in an internal error #385

ghost opened this issue Aug 17, 2023 · 15 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 17, 2023

I get an internal error when using libunbound by following the instructions in the wiki (https://github.com/lieser/dkim_verifier/wiki/DNS). The JavaScript DNS library works fine with the same settings.

My system configuration:

  • Windows 10 (64-bit)
  • Thunderbird 115.1.1 (64-bit)
  • DKIM Verifier 5.3.1
  • libunbound 1.17.1 (64-bit)

What I have already tried:

  • Using a backslash instead of a slash in the path.
  • Using an absolute path instead of a relative path
  • Disabling the firewall
@lieser
Copy link
Owner

lieser commented Aug 31, 2023

Could you please enable the advance logging in the settings and post the output of the debug log (https://github.com/lieser/dkim_verifier/wiki/Debug#view-error-and-debug-messages)?
It would be important to see the log for the first verified message after the start of TB or the DNS settings are reconfigured.

Hopefully this will give a hint on what is going wrong. Otherwise this will be really hard to debug.

@lieser lieser added the bug label Aug 31, 2023
@ghost
Copy link

ghost commented Sep 2, 2023

OperationError: PathUtils.join: Could not append to path: NS_ERROR_FILE_UNRECOGNIZED_PATH libunbound.js:130:23
    path jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:130
    map self-hosted:221
    load jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:126
    configure jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:398
    result resource://gre/modules/ExtensionParent.sys.mjs:1144
    withCallContextData resource://gre/modules/ExtensionParent.sys.mjs:627
    result resource://gre/modules/ExtensionParent.sys.mjs:1143
    withPendingBrowser resource://gre/modules/ExtensionParent.sys.mjs:637
    result resource://gre/modules/ExtensionParent.sys.mjs:1142
    callAndLog resource://gre/modules/ExtensionParent.sys.mjs:1095
    recvAPICall resource://gre/modules/ExtensionParent.sys.mjs:1141
    AsyncFunctionNext self-hosted:852
DKIM_Verifier.Verifier	FATAL	 Error during DKIM verification: Error: An unexpected error occurred verifier.mjs.js:1447:8
    #handleException moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1447
    #processSignatures moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1489

@lieser
Copy link
Owner

lieser commented Sep 3, 2023

@sanyazuev151 Could you please post the path you configured?

@lieser lieser added this to the 5.4.0 milestone Sep 3, 2023
@lieser
Copy link
Owner

lieser commented Sep 3, 2023

Note that in TB 115 there seems to be an issue with the Path relative to profile directory option, if the relative path contains a folder.

What works for me as a workaround for now:

  • Using an absolute path.
  • Using Path relative to profile directory together with just a filename, i.e. the dll being directly in the profile folder.

@sanyazuev151 You initially reported that you also tried it also with an absolute path, and for you it did not work. Can you please try again if you can reproduce it, and if yes post the error in the logs together with the used path?

@ghost
Copy link

ghost commented Sep 3, 2023

In the first log, the path was set to extensions/libunbound-8.dll with Path relative to profile directory enabled following the instructions in the wiki.

Following your workaround and moving the DLL directly to the profile folder, the path was set to libunbound-8.dll with Path relative to profile directory enabled:

Error in libunboundWorker: libunboundWorker: Error: error in ub_ctx_set_fwd: syntax error. errno: 0; subType: DKIM_DNSERROR_UNKNOWN; stack: update_ctx/<@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:448:10
update_ctx@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:446:14
onmessage@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:493:16
libunbound.js:263
    #onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:263
    onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:96
DKIM_Verifier.Verifier	FATAL	 Error during DKIM verification: Error: An unexpected error occurred verifier.mjs.js:1447:8
    #handleException moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1447
    #processSignatures moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1489

With the DLL remaining in the profile folder, the path was set to C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/libunbound-8.dll with Path relative to profile directory disabled:

Error in libunboundWorker: libunboundWorker: Error: error in ub_ctx_set_fwd: syntax error. errno: 0; subType: DKIM_DNSERROR_UNKNOWN; stack: update_ctx/<@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:448:10
update_ctx@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:446:14
onmessage@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:493:16
libunbound.js:263
    #onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:263
    onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:96
DKIM_Verifier.Verifier	FATAL	 Error during DKIM verification: Error: An unexpected error occurred verifier.mjs.js:1447:8
    #handleException moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1447
    #processSignatures moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1489

@lieser
Copy link
Owner

lieser commented Sep 3, 2023

The second error looks like another unrelated problem. The libunbound dll is successfully loaded, but it fails to set the manually configured DNS servers.

Can you post what you have set as the DNS servers?

@ghost
Copy link

ghost commented Sep 4, 2023

@lieser
Copy link
Owner

lieser commented Sep 4, 2023

I meant the exact string you configured. This has to be a IP4 or IP6 address.
What you currently have configured there does not follow the expected syntax, looking at the link you provided probably because you set an URL.

Also note that although unbound seems to support both DNS over TLS (DoT) and DNS over HTTPS (DoH), I never tested it with the addon. And I don't think the build of the libraries I provide at https://github.com/lieser/libunbound-builds even include this support.
So you probably need to configure a normal DNS server.

@ghost
Copy link

ghost commented Sep 4, 2023

I tested all of the IP addresses listed on the project page, as well as Google's, Cloudflare's and my ISP's default DNS address. They all produce the same error as previously mentioned.

@d4k0
Copy link

d4k0 commented Sep 16, 2023

I had the same problem when I updated to Thunderbird 115 a few days ago. For me using the absolute path (and unchecking Path relative to profile directory) worked.

Another important note: It only worked with the build of the library from https://github.com/lieser/libunbound-builds, the official build (I tested the latest version 1.18.0) somehow didn't work.

@lieser
Copy link
Owner

lieser commented Sep 17, 2023

I just tried again to reproduce the problem of ub_ctx_set_fwd: syntax error and was unable to do so. Using Thunderbird version 115.2.2 (64-bit) and the dll from https://github.com/lieser/libunbound-builds/releases/download/v1.17.1/libunbound_release-1.17.1_64-bit.zip.

Please try the following:

  1. Remove all the input for the manually configured DNS servers
  2. Enable getting the DNS servers from the OS
  3. Try verifying an e-mail
    1. This should work, unless your OS configured DNS servers for some reasons do not work.
    2. It should defiantly not result in the ub_ctx_set_fwd: syntax error error, as this is only called if something is configured for the manually set DNS servers.
  4. Disable getting DNS servers from the OS
  5. Set the DNS servers to exactly 8.8.8.8, and nothing more.
  6. Try again to verifying an e-mail

If the last part fails again that would be very strange, as the exact same input does not give any error for me.


@d4k0

Another important note: It only worked with the build of the library from https://github.com/lieser/libunbound-builds, the official build (I tested the latest version 1.18.0) somehow didn't work.

I created this builds because in the past unbound stopped providing windows binaries that contained the libunbound dll. But that has seemed to change again.
Note that in the official build the libunbound-8.dll dll also depends on the libcrypto-1_1-x64.dll, libssl-1_1-x64.dll and libssp-0.dll dlls, which you need to copy to the same location.
It is also best to explizitly load the dependencies to avoid some strange behaviors (#170 (comment)), so e.g. set the dll path to libcrypto-1_1-x64.dll;libssl-1_1-x64.dll;libssp-0.dll;libunbound-8.dll (of course with the correct absolute paths for the dlls..

@ghost
Copy link

ghost commented Oct 2, 2023

Error in libunboundWorker: libunboundWorker: Error: libunbound not correctly initialized (ub_ctx_create missing); subType: DKIM_DNSERROR_UNKNOWN; stack: update_ctx@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:406:9
onmessage@chrome://dkim_verifier_libunbound/content/libunboundWorker.jsm.js:493:16
libunbound.js:263
    #onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:263
    onmessage jar:file:///C:/Users/User/AppData/Roaming/Thunderbird/Profiles/xxxxxxxx.default-release/extensions/dkim_verifier@pl.xpi!/experiments/libunbound.js:96
DKIM_Verifier.Verifier	FATAL	 Error during DKIM verification: Error: An unexpected error occurred verifier.mjs.js:1447:8
    #handleException moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1447
    #processSignatures moz-extension://f86688dc-855e-4139-94bf-fa818cc259b4/modules/dkim/verifier.mjs.js:1489

@lieser
Copy link
Owner

lieser commented Oct 2, 2023

Could you please post the complete log with debugging enabled?
At which step did the error occur?

@d4k0
Copy link

d4k0 commented Oct 3, 2023

@lieser
Thanks for the tip with the dlls. I tried it with all dlls at that time, but then I didn't know that you had to disable Path relative to profile directory, so it didn't work either. But your version is better, because everything is linked in one dll.

@lieser
Copy link
Owner

lieser commented Oct 29, 2023

The issue with the relative path not working in Thunderbird 115 should be solved now.
For the other issue I would need more information to investigate further.

@lieser lieser self-assigned this Oct 30, 2023
@lieser lieser closed this as completed Nov 15, 2023
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

2 participants