Skip to main content

Logs, errors and codes

The engine logs one JSON line per event to standard output, through pino. Each line has an event name and fields that are ids, counts, codes and error names: never a message's content, an error's own text or a source file's name. Commands whose standard output is their report (status, messages, rekey and the rest) send their log lines to standard error.

Log events​

Messages​

EventLevelFieldsMeaning
receivedinfochannel, message, bytes, faileda message is stored; failed when the source stored it as failed
already-storedinfochannel, messagea source handed in again a message it had stored before a stop
possible-duplicatewarnchannel, message, duplicateOfsame sender and control ID as an earlier message
possible-duplicatewarnchannel, message, delivery, destination, reason, interruptedAttempta delivery was found cut off after its send (reason send-interrupted), and is sent again, flagged
receive-failederrorchannel, codea message could not be stored, and was not acknowledged
transformedinfochannel, message, outputsthe transform returned outputs
filteredinfochannel, message, outputsthe transform returned none
transform-failedwarnchannel, message, kind, name, code, wherethe message is marked failed; kind is the stage
deliveredinfochannel, destination, delivery, resenda destination accepted an output; resend only on a flagged resend
content-droppedinfochannel, message, deliverythe last delivery was delivered, and the message's content dropped (storage.content: dropAfterDelivery)
dry-runinfochannel, destination, deliverya destination that runs dry recorded an output and sent nothing
delivery-retrywarnchannel, destination, delivery, attempt, retryInMs, codeit is tried again after retryInMs
delivery-redirectedwarnchannel, destination, delivery, attempt, retryInMs, status, locationHostan HTTP destination answered a 3xx; held, never followed, and tried again after retryInMs (retry.max, 5 minutes by default)
delivery-rejectedwarnchannel, destination, delivery, reasonthe destination rejected it for good
delivery-exhaustedwarnchannel, destination, delivery, attempt, reason, codeout of retries (reason limit or maxAge): marked failed, its body kept for a resend
delivery-haltedwarnchannel, destination, delivery, attemptpathways channel halt cut the send off; it stays pending and is sent again, flagged, after a resume

A transform-failed line's kind is load, parse, transform, output, timeout, memory or crash. where is file:line:column in the transform, when it threw.

Sources and endpoints​

EventMeaning
source-start-faileda source could not listen (code, such as EADDRINUSE); tried again after retryInMs
source-starteda source that was down is listening again
source-losta running source said it lost its connection (code, attempt); it should try again after retryInMs
source-regaineda source that said it lost its connection has it again
poll-deadlinea polled source's pass ran past its deadlineMs and was cut off; the source took nothing more in that pass
poll-failed-after-cuta polled source's poll call rejected after its pass was cut off, with an error of its own rather than the cut's (code); the cut goes on as before
poll-overlapa polled source's pass came due while its last poll call had not returned, and was skipped
source-read-faileda file source could not claim or read a file; it stays for the next pass
source-file-set-asidea file source will not take a file, by reason (too-large or unreadable); moved says whether it went into errorDir, and code why not
http-refusedan HTTP source or the health endpoint refused a request, with its status
http-unreadablean HTTP source answering with ACKs stored a message as failed, with its problem
mllp-listeningan MLLP source is listening, on port, with tls true or false
mllp-store-failedan MLLP message could not be stored; onStoreFailure says what was answered
mllp-unreadablean MLLP message was stored as failed, with its problem
mllp-tls-refuseda TLS handshake on an MLLP source failed, such as a client without a certificate
mllp-ack-builder-faileda custom ACK builder threw or ran out of time; the default ACK was sent
mllp-ack-unsendablean ACK held an MLLP framing byte, so none was sent
mllp-source-error, mllp-source-failed, mllp-security-warningthe MLLP server reported an error or a warning, by name and code

Configuration and storage​

EventMeaning
plaintextan endpoint runs without TLS (endpoint says which); logged at every start
unauthenticateda listening endpoint has neither a token nor tls.ca
plaintext-copiesa file source keeps plaintext copies (keepProcessed: true)
unencrypted-storageencryption: none
dry-runpathways start --dry-run: every destination runs dry (destinations is all)
dry-run-destinationsat start, the destinations that run dry, by index under each channel's name (channels); a destination not named sends
dry-run-pendinga channel with a destination that runs dry (destinations, by index) has pending deliveries at start, of every destination; each of a dry destination is marked dry-run, not sent
retentiona retention run, with the messages and deliveries it deleted
retention-faileda retention run failed, by code; the next run tries again
lease-acquiredthe engine took the engine lease, with its node and epoch
lease-lostthe engine lost its lease, with the reason and epoch; it stops and exits 1
lease-unsupporteda custom store has no lease methods: the engine runs unfenced, and a second one is not refused
lease-release-failedthe lease could not be freed at a stop, by code; it lapses instead
standbystarted as a standby, with its node
standby-waitinga standby is waiting for the lease another engine holds (holder, epoch)
channel-statea channel's state changed (running, paused or stopped), here or on another engine
channel-states-unreadthe channel states could not be read at the top of a pass, by code; the last ones stand
channel-state-unstoreda pause, resume, stop or halt could not be stored, by code; the channel was put back as it was
channel-reloadedpathways channel reload swapped in the channel's new transform and settings

Hooks and the audit log​

EventMeaning
hook-faileda hook threw, with its name and code
hook-timeouta hook ran past its time limit
hook-droppeda hook had 1,000 events waiting, or was stopping, and events were dropped
hook-stop-faileda hook's stop() threw or ran out of time
audit-listener-faileda listener on the audit log failed; the entry stands

Delivery codes​

A retried delivery stores and logs a code. These come from Pathways' own connectors; a network error keeps the operating system's code, such as ECONNREFUSED or ENOTFOUND.

CodeConnectorMeaning
CONNECT_TIMEOUTMLLPno connection within ackTimeout
ACK_TIMEOUTMLLPno ACK within ackTimeout
ACK_AR, ACK_CRMLLPthe receiver answered with a reject code
ACK_UNREADABLEMLLPthe answer was not an ACK Pathways could read
ACK_CONTROL_ID_MISMATCHMLLPthe ACK answered another message's MSH-10
MLLP_CONNECTIONMLLPthe connection ended with no other code
HTTP_<status>HTTPa 408, 425, 429 or 5xx answer, or a held 3xx
ETIMEDOUTHTTPno answer within timeout
DELIVERY_TIMEOUTanythe attempt ran past its deadline, cut off

A delivery-retry line's retryInMs is the backoff, or the wait a 429's or a 503's Retry-After asked for when that is longer, up to the destination's retry.max, 5 minutes by default. A delivery-exhausted line comes only from a destination whose retry settings set a limit or a maxAge; see Delivery and errors. A delivery-redirected line's locationHost is the host (and port, when it names one) of the 3xx answer's Location, never its path or query, and is absent when there is no Location or it names no host.

A delivery rejected for good stores its reason: the ACK code (AE, CE), HTTP <status> for a 101 or a 4xx other than 408, 425 and 429, or MLLP_PAYLOAD_CONTAINS_... for an output that holds a framing byte.

MLLP problem codes​

When an MLLP source stores a message as failed, the reason is one of @cosyte/hl7's parse codes (such as NO_MSH_SEGMENT), NO_CONTROL_ID, MULTIPLE_MESSAGES or MLLP_TRAILING_BYTES. An ACK builder receives it as problem.

File source codes​

Besides the operating system's codes (EACCES, EEXIST and the like), a source-read-failed or source-file-set-aside line from a file source can carry:

CodeMeaning
ERR_SCRIPT_EXECUTION_TIMEOUTan include or exclude pattern ran past 50 ms on a path; the file is tried again on a later pass
ESTALEa file left the source folder, or was replaced, between the pass finding it and moving it; it stays
ERR_PATHWAYS_FILE_HELDa file moved in from outside the folder could not go back, and waits in .claimed/ as refused-...
ERR_PATHWAYS_FILE_ID_UNSTEADYthe folder's file system changes a file's id when it moves (FAT, exFAT), so the source claims nothing there

SFTP codes​

A file source or destination on an SFTP server gives the SFTP status of a failed request as the operating system's code where there is one (ENOENT, EACCES, ENOTSUP, and ELOOP for a link where a file was opened), and otherwise one of these. The first nine, and a system code on connecting (such as ECONNREFUSED), mark the source down until a pass runs again. A missing ssh2 package stops the engine at the first pass that needs it.

CodeMeaning
ERR_PATHWAYS_SFTP_HOST_KEY_UNKNOWNthe known hosts hold no key for the server; the error names its fingerprint
ERR_PATHWAYS_SFTP_HOST_KEY_CHANGEDthe server's key is not the one the known hosts or hostKey hold
ERR_PATHWAYS_SFTP_HOST_KEY_REVOKEDthe server's key is on an @revoked line
ERR_PATHWAYS_SFTP_AUTHthe server refused the login
ERR_PATHWAYS_SFTP_KEY_INVALIDthe private key could not be read, or its passphrase is wrong
ERR_PATHWAYS_SFTP_NO_POSIX_RENAMEthe server has no posix-rename@openssh.com, so a claim cannot be made
ERR_PATHWAYS_SFTP_TIMEOUTthe connection, or one request, took longer than its deadline
ERR_PATHWAYS_SFTP_CONNECTION_LOSTthe connection dropped while it was in use
ERR_PATHWAYS_SFTP_CONNECTthe connection could not be made, with no system code
ERR_PATHWAYS_SFTP_NOT_INSTALLEDthe ssh2 package is not installed
ERR_PATHWAYS_SFTP_SIZE_MISMATCHa read or a write moved a different number of bytes than the file's size
ERR_PATHWAYS_SFTP_FAILUREthe server failed a request without saying why
ERR_PATHWAYS_SFTP_EOFthe server said the file ended where it should not have
ERR_PATHWAYS_SFTP_BAD_MESSAGEthe server could not read a request
ERR_PATHWAYS_SFTP_STATUS_<n>any other SFTP status, by number

Encryption errors​

CodeMeaning
ERR_PATHWAYS_NOT_ENCRYPTEDa stored value is not encrypted: it was stored while encryption was none, or changed
ERR_PATHWAYS_ENCRYPTEDa stored value is encrypted, and encryption is none
ERR_PATHWAYS_MALFORMEDa stored value starts like an encrypted one, but its layout is broken
ERR_PATHWAYS_FORMAT_VERSIONa stored value is in an encrypted format this version does not read
ERR_PATHWAYS_UNKNOWN_KEYthe master key a value names is not configured
ERR_PATHWAYS_INTEGRITYa value, or its wrapped data key, failed its integrity check: changed, damaged, or the key under its id is not the one that wrote it
ERR_PATHWAYS_KEY_PROVIDERa key provider returned a key id or a key that cannot be used