Skip to main content

Write errors and abnormal data

When ingested data cannot be processed normally, locate the parsing, mapping, or write error before choosing an error policy. This page explains error actions, cache and archive settings, verification, and reingestion.

Where to operate: data ingestion tasks supporting error handling configuration → Error Handling Policy. Check logs and archives on the task execution host and target queries on the target cluster.

warning

Error handling determines what happens to data outside requirements: preserve diagnostic samples, discard it, fail the task, or cache and retry in specific cases. A running task does not mean every record was written. Before configuration, the data owner must confirm acceptable data loss and change scope. Do not choose discarding merely to eliminate task errors.

1. Distinguish four data categories first​

NamePurposeWhat it cannot replace
Error archiveSaves error reasons and data samples for diagnosing parsing, mapping, or write issues.Not a complete copy of all failed records or a database backup.
Target error cacheRetains data awaiting rewriting during supported target connection errors and rewrites it when recovery conditions are met.Cannot recover data never read from the source or replace source retention.
Raw data retentionOriginal input retention provided by some connectors.Not available for every source; does not imply task checkpoints or automatic reingestion.
BackupPreserves recoverable data and related information through a backup mechanism.Do not use the taosx archive inspection command to restore a database.

Within one archive file, only samples from the first failed batch are retained for each failure reason. Estimate impact using task error statistics, source records, and target queries together. Archive row count is not total failed row count.

These policies handle only errors that actually reach the corresponding error handling stage. They do not automatically preserve every input producing no output. For example, some JSON syntax errors and UDT evaluation failures may be logged and skipped. Empty filter evaluation results may also suppress output. Type conversion may retain a record but produce nulls. Configured archiving does not mean these original messages were preserved. Locate whether the issue is parsing, filtering, or target writing first, then check actual logs, archives, and rereadable source ranges.

2. Choose write error policies by error​

Inspect the policies actually provided by this connector in task configuration. Not every error supports every option.

Expand Error Handling Policy on the task page. Confirm each action below before saving. Preserve the original configuration before editing an existing task; do not overwrite approved policies with new-task defaults. These settings apply to target writes after reading, not source authentication, SQL queries, or data never collected.

Error action, cache, and archive controls and initial interface values

2.1 Choose each error action​

Archive saves error reasons and diagnostic samples, not complete copies of every failed record. Within one archive file, the same failure reason retains samples only from the first failed batch. Discard skips records; continued task operation does not recover them automatically. Error makes the task report failure. After repair, still check the range written before failure. Cache applies only to target connection errors supporting this action and preserves data awaiting rewriting. Recovery still depends on cache file availability and successful rewriting.

The following table applies to write tasks providing this group of error settings. Defaults describe behavior when a corresponding policy is not explicitly set. Saved tasks use their actual configuration.

ErrorAvailable actionsBehavior when unspecified and checks
Target database connection errorArchive, discard, error, cacheCache; rewrites only after target recovery and while cache remains available. Also check the cache failure policy.
Target database missingArchive, discard, errorError; does not automatically create a database.
Regular table missingArchive, discard, error, automatically create table and retryAutomatically create and retry; confirm the model and table creation permissions first.
Supertable missingArchive, discard, error, automatically create table and retryInherits “table missing” unless configured separately, then uses this setting.
Child table missingArchive, discard, error, automatically create table and retrySame as above. Archive or discard applies only to data for missing child tables, not necessarily the entire batch.
Primary timestamp overflowArchive, discard, errorArchive; check actual database time limits and source units.
Null primary timestampArchive, discard, error, use current timeArchive; using current time changes business time semantics.
Null composite primary keyArchive, discard, errorArchive; first check target composite primary key columns and mapping.
Table name length overflowArchive, discard, error, truncate, truncate and archiveArchive; check for name collisions after truncation.
Invalid table name charactersArchive, discard, error, replace with specified stringReplaces with an empty string by default. Different names may collapse into one; preview first.
Null table name template variableDiscard, leave empty, replace with specified stringReplaces with an empty string by default. “Leave empty” keeps other template parts; it does not automatically make the row valid.
Missing column nameArchive, discard, error, automatically add missing columnsAutomatically add; requires schema change permissions and model approval.
Column name length overflowArchive, discard, errorArchive; value truncation does not automatically shorten column names.
Automatic column expansionEnable, disableEnabled by default; may modify target column lengths. Define whether this is permitted before production ingestion.
Column length overflowArchive, discard, error, truncate, truncate and archiveArchive; check whether expansion is enabled and successful and inspect actual target types.
Other data errorsArchive, discard, errorArchive; check impact by the specific reason.

“Truncate and archive” continues processing with the truncated value and saves diagnostic samples. It does not mean the complete original value reached the database. For example, replacing the invalid character in a.b with _ gives a_b; check for a collision with an existing a_b child table. With template t_{device}, a fixed replacement for empty device values may also merge devices into one child table. Automatic table creation, column addition, or expansion changes target schemas. Obtain permissions and confirm changes are allowed; after failures, inspect logs and target schemas as well.

The target table name limit is 192 bytes and column name limit 64 bytes, not the same number of Chinese characters. Table name truncation counts characters. For multibyte names, the truncated character count does not guarantee the byte limit is met. Shorten the template first, then preview and test writes. Column value length also depends on target type and declared length; string and binary limits cannot use one character-count rule. Before production ingestion, test the longest actual identifiers and samples containing Chinese characters. Passing ASCII samples does not replace full validation.

2.2 Cache and archive retention settings​

Caches hold pending data after target errors; archives support error diagnosis. Plan capacity, directories, and failure actions separately.

SettingMeaning and defaultOperator action
Connection timeoutDefault 30s; entered in seconds in the interface, range 1–600Record separately from source read timeout. Do not hide authentication failure with longer timeouts.
Archive retentionDefault 30d; 0 falls back to default 30dUsed for archive cleanup. Set positive integer days for the diagnostic window, also considering file count and actual files. It does not guarantee all samples remain within retention.
Cache retentionAccepted configuration default 30d, but pending rewrite caches are not automatically evicted by this timeDo not assume cache space is released after 30 days. Disk capacity must cover actual growth during interruptions and catch-up.
Available space settingDefault 1GB; supports KB, MB, GB; 0 falls back to the defaultActually rotates individual files by size, not a total directory quota. Existing size is checked before writing, so files may exceed the threshold. Configure separate directory and disk alerts.
Rotated file countDefault 100; used in archive cleanup, but not automatic eviction of pending rewrite cacheDo not assume caches have at most 100 files or archive retention days alone guarantee sample availability.
File locationDefault cache/ and archived/; relative paths resolve under task and subtask directoriesFiles reside on the actual execution host. Check service account permissions; the browser host's download directory is not a substitute.
Cache failure policyInterface offers discard or error and stop; default discardDiscard may lose data awaiting rewriting. Selecting cache does not justify a no-data-loss guarantee.
Archive failure policyDelete old files, discard, or error and stop; default delete old files and retryDeleting old files reduces diagnostic history but does not automatically expand disk capacity. Some archive paths only log errors after failed retries; task stops cannot be relied on for detection. “Discard” does not guarantee continued operation either. Check actual files and logs as described below when failures occur.

Archive rotation removes old files according to retention and file count. Samples may disappear before the business needs them, and failure policies may trigger additional rotation. Pending rewrite caches do not undergo this automatic cleanup; normal reclamation depends on successful rewriting. Do not manually delete caches not yet confirmed delivered merely to free space. The default archive directory is ${data_dir}/tasks/<任务 ID>/<子任务 ID>/archived/, with sibling cache/. For custom locations, use actual configuration, execution nodes, and logs. For capacity inspection and estimation, see Control disk growth.

If archive writing or rotation fails, even with a running task, check service account write permissions, actual free disk space, whether the current file was created or is still growing, and the affected data range in the same time window. Preserve error context and readable archive copies following Logs and performance. Do not infer that diagnostic samples are safely on disk because the task did not stop. To confirm whether a failure stops the task, check actual behavior in an authorized isolated scope, not by creating production disk failures.

2.3 Verify after saving​

  1. Before submitting, record selected actions, directories, and failure policies. Pay particular attention to automatic schema changes, truncation, and discarding.
  2. First confirm normal samples ingest in an isolated test scope, then test one authorized error type. Do not shut down production services or exhaust disks to create failures.
  3. Inspect error logs, completed archive copies, or target schemas according to the actual policy, and query target data for the same time range. Continued task operation does not mean abnormal rows were written.
  4. After repair, check new normal records and the affected window. Define source rereading or reingestion ranges separately for archived or discarded data; automatic recovery is not promised.
warning

According to the v3.4.4.2 release notes, when the target TDengine TSDB runs out of disk space during a write, the write task fails directly instead of archiving or discarding the data and continuing. Selecting archive or discard cannot keep the task running through this failure. Resolve the target disk-space issue first, then resume the original task and check the affected scope. For older versions, confirm whether the delivered version includes this change.

3. Verify in a separate test task​

  1. First ingest one normal message following Target table modeling and field mapping, and save the baseline.
  2. Choose one authorized error type to test, such as a missing primary timestamp. Explicitly set it to archive, not to substitute the current time, and record archive configuration.
  3. Send a message without a time field to the test source, then a normal message with recognizable time and value.
  4. Inspect task logs and error archives to confirm that the cause is the time field. Query the target to confirm that the abnormal input was not written with an incorrect business time and the normal message follows the selected policy.
  5. Correct input or mapping, then send a new test time to confirm writing has recovered.

Do not verify documentation examples by shutting down target services or filling disks. Such failure drills require a separate environment and change authorization.

4. Locate and inspect error archives​

First run SHOW XNODE TASKS; and SHOW XNODE JOBS; in the taosExplorer Data Browser or taos CLI and record the task, subtasks, and execution nodes. Check configuration and logs on the actual taosX execution host. The default archive directory is ${data_dir}/tasks/<任务 ID>/<子任务 ID>/archived/, with target error cache in sibling cache/. If paths were customized, use the actual configuration.

For stable files or controlled copies, inspect summaries first, then a few samples:

taosx archive --limit 0 "<异常归档文件路径>"
taosx archive --limit 5 "<异常归档文件路径>"

--limit is the maximum sample rows printed to the terminal per input file, default 20. 0 disables sample printing only; it does not skip file reading. Use -o only to extract standard Parquet data fragments. It takes an output directory; paths after it are input files, not a second output directory.

warning

For Windows PowerShell and Linux Bash path examples, overwrite hazards, and multiple-file instructions, see Logs and performance. When reading caches, do not move or delete original files, or data awaiting rewriting may be damaged.

5. Verify with logs, statistics, and target results together​

Record the task ID, run start, and error time window. For metrics, follow Logs and performance to confirm the monitoring cluster and database written by taosKeeper, then query the same task and interval through Grafana, the taosExplorer Data Browser, or taos CLI. Configured reporting does not establish usable metrics.

Assess impact using error changes, archive reasons, recognizable source samples, and target time windows together. Task counters may reset after restart, and cumulative writes do not represent unique target rows. Only correct expected target records, values, and tags confirm an effective fix.

6. Troubleshooting and reingestion​

SymptomNext step
Logged errors without archivesCheck whether archiving is selected for this error, whether it is sampled, and the execution node, directory, permissions, and space.
Far fewer archived rows than errorsConsider same-reason sampling first. Check impact against statistics and source/target records; do not conclude that only a little data was lost.
Backlog remains after connection recoveryCheck that cache files remain, then rewriting errors and target permissions, then target time ranges.
Archive or cache writing failsCheck space, permissions, and their own failure policies. Do not simply delete directories or broaden permissions and retry.

Save configuration and diagnostic state before stopping the task. After recovering the original task, verify new data and the range awaiting rewriting. Archived or discarded records are not guaranteed to recover automatically. Correct the root cause first, then plan bounded rereading or reingestion based on source retention. Reingestion may overlap written data; check primary keys and update semantics.

7. Limitations​

Error archiving, target caching, and taosX-Agent store-and-forward are three different mechanisms. Do not apply message ingestion policies to all migration, publishing, or industrial collection tasks. Maintain archive capacity, retention, and failure policies as well. Zero retention or space settings use defaults; zero does not enable unlimited retention.