# agent csv import crashed on malformed questionnaire row with parse error: how to fix it

An agent CSV import crashing on a malformed questionnaire row needs row-level error isolation. Validate each row before processing, skip and log the bad ones, and continue. One bad row should never kill a thousand good ones.

```text
agent csv import crashed on malformed questionnaire row with parse error
```

## When to use this skill
- CSV imports crash on a bad row
- One malformed row kills the whole import

## When not to use this skill
- Every row fails (a structural issue)
- Rows import but misalign (a delimiter issue)

## Tool compatibility
Agent CSV import pipelines with row validation.
Related area: CSV and Excel data import pipelines.
Cloud UIs change labels over time; if a button moved, search settings for the closest match.

## Before you start
- Sign in to the tool and keep one tab open so sessions stay clean
- Copy the exact error text and note the time it happened
- Set aside 15 to 20 minutes; most of these resolve in a single pass

## Quick diagnosis
Make sure this is the right skill before you invest the 15 minutes.
- If you are dealing with cSV imports crash on a bad row, start at step 1 below.
- If instead every row fails (a structural issue), stop here; you need a different skill.
- If neither quite matches, compare your screen against the verbatim error block at the top; that block is exactly what this skill covers.

## Fix it in steps
### 1. Add per-row validation

```
Validate field counts and types on each row before processing it.
```
Expected: malformed rows identified without crashing.

### 2. Skip and log bad rows

```
Write bad rows to an error file with line numbers and continue.
```
Expected: the import completes with a clean error report.

### 3. Review the error file

```
Open the logged rows and fix the source data.
```
Expected: a short list of fixable problems.

### 4. Re-import the fixed rows

```
Import just the corrected rows.
```
Expected: full data set complete.

## Confirm each step worked
Run through this checklist before moving on. If a check fails, redo that step instead of pushing ahead.
- Step 1 (add per-row validation): Expected: malformed rows identified without crashing.
- Step 2 (skip and log bad rows): Expected: the import completes with a clean error report.
- Step 3 (review the error file): Expected: a short list of fixable problems.
- Step 4 (re-import the fixed rows): Expected: full data set complete.

## Quick recap
1. Add per-row validation
2. Skip and log bad rows
3. Review the error file
4. Re-import the fixed rows

## Still stuck?
Gather three things: the exact error text, the time it happened, and what changed just before it broke.
Check the vendor status page for an active incident. Then open a support ticket with those three things;
it cuts the back-and-forth in half. For agent runs, attach the last 50 lines of the agent log too,
since the loop or timeout signature in the log usually names the cause.

## Variant phrasings
### csv import crashed malformed row
Isolate per row, skip and log. If this matches what you saw, the steps above apply as written.

### agent parse error questionnaire row
The error file is the deliverable, not just the import. If this matches what you saw, the steps above apply as written.

## Why it happens
Naive import loops assume every row is well-formed, so the first malformed row throws and aborts everything. Row-level isolation turns a fatal crash into a logged skip with the import otherwise complete.

## Edge cases
- Always report skipped rows, silent skips hide data loss
- Validate before any side effects, not after partial writes
- Keep the original file untouched for reprocessing

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_qB-WjTiH_3RERA0QtFJVIg
