Operating pipelines
Once pipelines are running, you can retry, defer or pause them, check the engine instances behind the dashboard, and see which inputs were refused before they were stored. This page covers those actions and the environment variables behind them. The dashboard's pages are in The dashboard. For units, statuses and items themselves, see Units and state. For the same actions from a script, see Admin scripts. When something fails, start at Troubleshooting.
Operator actions
Three actions change units: Retry, Defer, and deleting waiting items. Each runs in one short transaction and answers at once.
Retry and Defer
| action | takes a unit at | the unit becomes |
|---|---|---|
| Retry | error, deferred or sent | received, with its error and _skipped counts cleared, and a fresh place at the store: no attempts counted, due at once |
| Defer | error | deferred, keeping its error. Nothing happens to it until it is retried |
A Retry runs every step after the store again, with the workspace's current code. The Aidbox sender does not send again a resource it already delivered unchanged, so retrying a unit that partly reached Aidbox sends only what is missing or changed.
- Up to 1000 units per request. The dashboard sends a larger selection in parts of 1000.
- Leftover items are cleared first. A unit the sender rejected may still
have items that another send held at that moment. Both actions delete those
before they change the unit, up to 10,000 per request. An item a send still
holds stays, and the unit is left unchanged as
item_in_flight. A Retry that leaves a unit with items after those 10,000 leaves it unchanged asitems_left. A Defer goes ahead. Either way the sender drops the rest, never sending an item of a unit aterrorordeferred.
Each answers the units it moved, and the units it left unchanged with a reason:
| reason | means |
|---|---|
status | the unit is at a status this action does not take. The answer names it |
busy | another transaction holds the unit, or its place at the store: the engine is working on it, or another action is. Try again |
item_in_flight | a send holds one of the unit's items. Try again once it settles |
items_left | the unit still had waiting items after the call deleted 10,000 across all its units, and the sender drops the rest. Try again shortly |
incomplete_input | Retry only: the unit is at engine/copy_incomplete, one of the units a staged copy made before it stopped. Retrying it alone would send part of an input, so deliver it again as a new delivery or under a new name |
not_found | no unit with that id in this pipeline |
Deleting waiting items
A unit at processed stays there until its last item is delivered. An item that
waits counts no error and has no limit, so a unit whose resource waits for a
reference that will never arrive stays processed until someone acts. Deleting
its waiting items closes it.
- Only a unit at
processed. Any other status is refused withunit is not processedand the unit's status. - All, or the ones you name, up to 1000 item ids. All deletes up to 10,000
per request and answers
morewhile waiting items remain. - Items a send holds right now are
kept. A named item already gone, delivered or deleted meanwhile, ismissing. The rest are deleted. - When no item is left, the unit becomes
sent. - A named item of another unit refuses the request, and so does a unit another
transaction holds (
busy).
The answer lists the items deleted, kept and missing, and the unit's
status after it.
They never wait on the engine
The actions do not wait for a lock. A unit the engine is working on is in work,
and an operator does not change it underneath. Waiting could also deadlock
against the engine, and would spend the request's time. So a unit another
transaction holds is answered busy at once, and the action can be repeated.
Every statement of an action, and of the reads behind the Dashboard's totals and
error kinds and the Pipelines, Units and Unit pages, runs within one time budget
for the whole request,
INTERBOX_API_READ_TIMEOUT_MS. A request that spends it answers 504, and
changes nothing.
A unit an action moves enters a new status, so a pipeline that subscribes to
received, deferred or sent gets that event, delivered by the engine shortly
after the action (see Webhooks).
Pausing a pipeline
A paused pipeline stops taking in and sending out, on every engine instance of the deployment, until you resume it. Use it when two deployments read the same storage location and you want one of them to load a delivery first, or to stop a load that is going wrong.
The Pipelines page shows Paused by <who> at <when> on a paused pipeline,
and a Pause or Resume button on each pipeline declared in the active
workspace. Both ask you to confirm, naming
the pipeline and the dashboard's address.
While a pipeline is paused:
| part | what it does |
|---|---|
| a file source | starts no new listing, marker read, or file read. The operation in progress finishes |
| a workspace source that Interbox polls | starts no poll. A poll already running finishes |
| a source that receives (MLLP, webhook) | keeps accepting and storing what it receives. Recovery of already accepted staged inputs continues |
| the steps | process no unit. The units in progress when you pause finish |
| the sender | sends nothing. A send in progress finishes |
| a queue that consumers poll | hands out no new items. Consumers can acknowledge items they already received |
Nothing is lost and nothing counts as a failed attempt. When you resume, each part goes on from where it stopped: within a second for the steps and the sender, and at the next poll for a source. The first file-drop poll after resuming restarts the waiting clock for unfinished deliveries. Time spent paused cannot make a delivery hit its abandonment timeout.
- The pause lives in the deployment's database. It holds across restarts, redeploys and workspace reloads. Pause after a rollout finishes: an instance still on an earlier version does not know about it.
- A pause belongs to a pipeline name. A renamed pipeline starts unpaused, so pause it once it appears. If you remove a paused pipeline, its historical row loses the pause status and controls. Adding the same pipeline name back restores its pause.
- Who paused is the signed-in user's name,
adminfor the administrator login, andunknownon a deployment that runs without authentication. Each pause and resume writes an audit line.
Who can call them
Retry and Defer are also open to the dashboard assistant's grant. Deleting items is not (see Securing dashboard access).
Engine instances
Every engine instance writes a heartbeat row of its own every 2 seconds, keyed
by its id: INTERBOX_INSTANCE_ID, or the host name when that is unset. The row
carries its version, license state, CPU and memory, the state of each of its
stages, its pipelines' sources, the inputs it refused, and its reload error.
-
Fresh or stale. An instance seen within the last 6 seconds is fresh. A stale one has stopped, crashed, or cannot reach the database. Rows not seen for an hour are deleted, so an instance that is gone for good, such as one that restarted under a new host name, drops off within the hour.
-
One id, one instance. Two live engines with the same id write one row, and the dashboard shows them as one. When an instance finds its row written by another live process, it logs one error naming the duplicate
INTERBOX_INSTANCE_ID. Give each engine its own. -
Active or standby. Every replica runs the stages that ingest: its MLLP and webhook sources and the webhook router. Only the active replica also runs the segments, the senders and the other sources.
-
Reload error. The instance's current failure to load the published workspace build:
{ at, ref, message }, with credentials in URLs removed. It is set when a build fails to load and cleared when one loads. A replica that already runs a build keeps it. One with no build loaded stays unready, runs no stage and keeps beating. Either way the replica tries again when a new build is published, on its poll, or onSIGHUP. A build the workspace service could not make shows on the Repository screen instead, and also here while the replica has no build loaded; see The workspace. -
Large inputs and fan-outs are staged in Postgres. An input whose steps before the store make more than 1,000 rows or 4 MiB, such as a big file, and a unit whose steps after the store give more than that, are first written to Postgres gzipped, then copied into units or sender items in parts of that size, each in a short transaction. Nothing goes to the engine's local disk.
- Space. The staged copy takes database space, a fraction of the rows' size, until its last part is copied, normally within seconds. One left by a crash is copied on or deleted by the stored-files sweep. The log names each staged input and unit with its rows, parts and timings.
- Vacuum. Copying deletes each staged part as it goes, so a big delivery
leaves dead rows in that pipeline's
unit_file_chunkpartition until autovacuum clears them. After the first large deliveries, check that autovacuum keeps up there (n_dead_tupinpg_stat_user_tablesforinterbox.unit_file_chunk__<pipeline>,-in the name written as_). - All at once. The units a copy makes wait until its last part is copied,
then all become due at once. The dashboard counts them as
copying, notready. A unit's items are not sent before its last part either. Webhooks get each part'sreceivedevents as the part commits, before the copy ends, and a copy that then stops sendserrorfor the same units. - Busy while copying. Retry, an item delete and a drop of pending items
leave a unit whose copy is pending unchanged as
busy. - Refused before staging. A row Postgres would refuse is refused before
anything is staged, the same at any size. An input is refused as
store_misfitfor an indexed attr longer than 2,684 bytes as Postgres writes it, anorderAtthat is neither aDatenor text aDateparses, or text Postgres cannot hold. A unit ends atengine/write_failedfor an item key longer than 2,684 bytes or holding NUL. - A copy no retry can finish stops. A part Postgres refuses as data, or
one that cannot be read back, stops the copy, and none of the work goes on
half done. The units it made so far end at
engine/copy_incomplete, with the part, the staged file and the error in their message and in an ERROR log line, and a file-drop delivery is judgedpartial. Retry refuses them asincomplete_input: deliver it again as a new delivery or under a new name. On S3 an identical re-upload keeps its ETag, the file's version, and is skipped as already read. SFTP, local folders, GCS and Azure give every upload a new version. A unit whose outputs were being copied ends atengine/write_failedand its items are dropped unsent. Retry it as any failed unit. - Other failures wait and try again. A lost connection, a timeout, a lock
or a full disk never stops a copy: each failed try logs an ERROR with the
try count and the next try's time, and the copy is tried again after 1, 2
and 4 minutes, then every 5 minutes, until it copies. A restart keeps the
wait. Meanwhile later inputs to the pipeline are refused as
copy_pending. - Keep a bridging pipeline until its copies end. Before you remove or
rename a pipeline that sends into another with
intoPipeline(), check that the receiving pipeline shows nocopyingunits. A copy left behind holds its units there, and every later unit of that pipeline waits behind them, with no admin action to clear it. If the pipeline was removed anyway, add it back until its copies finish or are undone. The engine logs a warning at boot for each pipeline no longer declared that still has copies pending.
-
A step after the store holds a unit's outputs in memory. The exception is a
read: "delivery"pipeline, whose outputs stream into the staged copy. Until the step ends, every output it gives for one unit is in the engine's heap: about 1 KB per output, so a unit that fans out into 500,000 items takes about 500 MiB. -
Whole deliveries take database space. A file-drop feed with
read: "delivery"copies every file of a delivery, as received, into Postgres, with no limit on its size. The files stay until the pipeline'sretentionhas passed after their unit issentorskipped, 7 days by default, and"forever"keeps them for good. A unit inerrorordeferredkeeps its files, so it can be retried. Size the database for the deliveries of that many days. The unit and its file list stay after the deletion.
Refused inputs
An input refused before the store left nothing behind: no unit, no stored value. The sending side was told, and retries on its own. Each refusal is counted, so a feed whose every input is refused can be told apart from one that went quiet.
| code | the input | the sending side gets |
|---|---|---|
too_large | was an MLLP frame or a request body over the source's maxBytes | MLLP: the connection is dropped. HTTP: 413 |
unauthorized | was a request to a webhook source with a secret that did not carry it | HTTP 401 |
store_misfit | produced a row the store's codec cannot hold | MLLP AE, HTTP 500 |
source_error | made the source's own read mark or state write fail to store. MLLP and webhook sources never raise it | the source retries |
copy_pending | came while an earlier input's staged rows were not all copied yet | the source retries |
step_error | made a step before the store throw, or answer notReady | MLLP AE, HTTP 500 |
not_ready | made a step before the store read a reference table that is not ready, or throw NotReady | MLLP AE, HTTP 500 |
timeout | passed its deadline, in a step or in a statement | MLLP AE, HTTP 500 |
db_error | was refused by Postgres, or Postgres could not be reached | MLLP AE, HTTP 500 |
- Per pipeline, per instance, since its source started. Each instance keeps its counts in memory and writes them with its heartbeat. A restart starts from zero, and the refusals of the last seconds before a crash are lost.
- The Pipelines page sums the fresh instances, with the reason and time of the latest refusal. The Instances page shows each instance's total.
- Only the code is counted. The engine's log names the pipeline, the error's kind and the code location it was thrown at, never its message, which can hold the input.
- Not counted: an input abandoned before its commit by a stop or by an HTTP client that disconnected, a request refused for its method, and a request to a path no webhook source has.
Environment
The engine and the API read the variables below. Environment variables lists all of them.
| variable | default | what it sets |
|---|---|---|
INTERBOX_API_READ_TIMEOUT_MS | 10000 | the time budget, in milliseconds, of one request behind the Dashboard's totals and error kinds and the Pipelines, Units and Unit pages, and of one action. Past it the request answers 504. A value that is not a whole number above zero uses the default. The dashboard waits 20 seconds for most of these reads, so above that a slow read shows there as failed rather than as 504 |
INTERBOX_INSTANCE_ID | the host name | the instance's id on the Instances page. Give each engine its own. A restart under the same id takes the active lease without waiting for it to lapse |
INTERBOX_STOP_GRACE_MS | see Updating the engine | how long a stop lets started work finish. The workspace covers it while a replica switches builds |
INTERBOX_WEBHOOK_PORT | 3002 | the TCP port every webhook source listens on, each at its own path. 0 lets the system pick a free port, which the Sources page shows. A value that is not a whole number from 0 to 65535 refuses the workspace's load, and the error names the variable. An MLLP source on the same port parks its pipeline |
INTERBOX_WORKSPACE_SERVICE_URL | unset | the address of the workspace service, such as http://interbox-workspace:3001. The API forwards the Repository screen, workspace actions, the workspace UI, concept maps, unmapped codes and the assistant there. Unset, those routes answer 404 and the dashboard shows no assistant. See The workspace service |