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

Plugin test option crashes #3143

Closed
lnedry opened this issue Jan 8, 2023 · 0 comments · Fixed by #3151
Closed

Plugin test option crashes #3143

lnedry opened this issue Jan 8, 2023 · 0 comments · Fixed by #3151

Comments

@lnedry
Copy link
Contributor

lnedry commented Jan 8, 2023

Describe the bug
When running the Haraka plugin test option, e.g. "haraka -c /etc/haraka -t graph", Haraka will crash. It doesn't matter which plugin is being tested or which other options are included with the test. I chose graph for this example because it is very simple and doesn't have a configuration.

Expected behavior
I expected some tests to be run.

Observed behavior
Haraka crashes.

/usr/lib/node_modules/Haraka/connection.js:134
        if (this.cfg.headers.show_version) {
                     ^

TypeError: Cannot read properties of undefined (reading 'headers')
    at new Connection (/usr/lib/node_modules/Haraka/connection.js:134:22)
    at exports.createConnection (/usr/lib/node_modules/Haraka/connection.js:1888:12)
    at Object.<anonymous> (/usr/lib/node_modules/Haraka/bin/haraka:533:35)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Steps To Reproduce
haraka -c /etc/haraka -t graph

System Info:

Haraka Haraka.js — Version: 3.0.0
Node v18.12.1
OS Linux mautic.wbnms.com 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
openssl OpenSSL 1.1.1n 15 Mar 2022

Additional context
My guess is that line 533 in bin/haraka should also pass some config information.
Also, line 134 in connection.js should probably test for cfg and cfg.headers

msimerson added a commit to msimerson/Haraka that referenced this issue Jan 19, 2023
msimerson added a commit that referenced this issue Jan 19, 2023
#### Fixed

- fix(bin/haraka): set server.cfg and pass to conn, fixes #3143
- fix(bin/haraka): correct error messages for help options #3142
- fix: dkim_verify fails to find record #3149

#### Changed

- plugins: Add haraka-plugin-outbound-logger to registry #3146
- dep(pi-spf): bump version 1.1.3 to 1.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant