Repository: haraka/Haraka

Issue #2359: crash after qmail-queue "Transaction went away"
Created: 2018-03-06T10:41:44Z
system info



Haraka
Haraka.js — Version: 2.8.17




Node
v8.9.1


OS
Linux HOST 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


openssl
OpenSSL 1.0.2k-fips  26 Jan 2017



Expected behavior
When a client closes the connecting while haraka is qmail-queueing the mail, either abort the queueing or queue the mail regardless.
Observed behavior
Haraka diagnoses and logs the missing transaction object but then crashes anyway when accessing the transaction object.
[NOTICE] [connid] [core] connect ip=XXX port=42411 local_ip=:: local_port=25
[INFO] [connid] [helo.checks] helo_host: XXX, ips: XXX, pass:match_re, bare_ip, big_co(not), literal_mismatch, valid_hostname, rdns_match, forward_dns, host_mismatch, fail:dynamic
[NOTICE] [connid.1] [core] sender <XXXX@hotmail.co.jp> code=CONT msg=""
[INFO] [connid.1] [core]  hook=rcpt plugin=rcpt_to.in_host_list function=hook_rcpt params=<XXX> retval=OK msg=""
[NOTICE] [connid.1] [core] recipient <XXX> code=OK msg="" sender=XXX@hotmail.co.jp
[INFO] [connid.1] [data.headers] pass:duplicate, missing, invalid_date, Return-Path, direct-to-mx(3), fail:UA, from_match(hotmail.co.jp / ocn.ne.jp)
[NOTICE] [connid.1] [core] message mid=<XXX> size=94343 rcpts=1/0/0 delay=0.002 code=CONT msg=""
[INFO] [connid.1] [core] client [XXX] half closed connection
[NOTICE] [connid.1] [core] disconnect ip=XXX rdns=XXX helo=XXX relay=N early=N esmtp=Y tls=N pipe=Y errors=0 txns=1 rcpts=1/0/0 msgs=0/0/0 bytes=94343 lr="" time=225.962
[ERROR] [connid.1] [queue/qmail-queue] Unable to queue message to qmail-queue: 54
[ERROR] [-] [queue/qmail-queue] Transaction went away while delivering mail to qmail-queue
[INFO] [-] [queue/qmail-queue] Message Stream sent to qmail. Now sending envelope
[CRIT] [-] [core] TypeError: Cannot read property 'mail_from' of null
[CRIT] [-] [core]     at Socket.<anonymous> (/opt/haraka/lib/node_modules/Haraka/plugins/queue/qmail-queue.js:71:50)
[CRIT] [-] [core]     at emitOne (events.js:116:13)
[CRIT] [-] [core]     at Socket.emit (events.js:211:7)
[CRIT] [-] [core]     at Pipe._handle.close [as _onclose] (net.js:554:12)
[CRIT] [-] [core] Error: shutdown ENOTCONN
[CRIT] [-] [core]     at _errnoException (util.js:1024:11)
[CRIT] [-] [core]     at Socket.onSocketFinish (net.js:294:25)
[CRIT] [-] [core]     at emitNone (events.js:106:13)
[CRIT] [-] [core]     at Socket.emit (events.js:208:7)
[CRIT] [-] [core]     at finishMaybe (_stream_writable.js:604:14)
[CRIT] [-] [core]     at endWritable (_stream_writable.js:612:3)
[CRIT] [-] [core]     at Socket.Writable.end (_stream_writable.js:563:5)
[CRIT] [-] [core]     at Socket.end (net.js:496:31)
[CRIT] [-] [core]     at Socket.<anonymous> (/opt/haraka/lib/node_modules/Haraka/plugins/queue/qmail-queue.js:63:32)
[CRIT] [-] [core]     at emitOne (events.js:116:13)
[ERROR] [connid.1] [queue/qmail-queue] Unable to queue message to qmail-queue: 54
[NOTICE] [-] [core] Shutting down

Steps to reproduce
Happened in production. Sadly I do not have steps to reproduce this.

Duplicate issue #2541: Latest version cannot be installed
Created: 2018-11-18T10:06:43Z
After the latest version update I get the following error when installing it via npm i Haraka.
npm WARN enoent ENOENT: no such file or directory, open '/Users/christianvaas/Desktop/tst/package.json'
npm WARN tst No description
npm WARN tst No repository field.
npm WARN tst No README data
npm WARN tst No license field.

npm ERR! path /Users/me/Desktop/tst/node_modules/Haraka/bin/haraka
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/me/Desktop/tst/node_modules/Haraka/bin/haraka'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2018-11-18T10_07_41_313Z-debug.log

Closing comment (2018-11-18T21:24:30Z): This might be related to #2359