sipeed/picoclaw · error

no valid rows found in table

Error message

no valid rows found in table

What it means

Guard inside parseMarkdownTable: the input had at least two lines, but after splitting rows into cells not a single valid row was accumulated into allRows — every line failed row-level parsing. The function therefore cannot construct a table with any content.

Solutions

  1. Check that table rows use consistent | delimiters and non-empty cells
  2. Avoid malformed rows (e.g. lines that only contain separators after the header)
  3. Regenerate the table content if the source markdown is corrupted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/channels/teams_webhook/teams_webhook.go:357 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/e30199c669134175. Report an issue: GitHub.

Appendix: source

Thrown at pkg/channels/teams_webhook/teams_webhook.go:357

				headerLengths = append(headerLengths, len(trimmedText))
			}

			textBlock := adaptivecard.Element{
				Type: adaptivecard.TypeElementTextBlock,
				Text: trimmedText,
				Wrap: true,
			}
			cell := adaptivecard.TableCell{
				Type:  adaptivecard.TypeTableCell,
				Items: []*adaptivecard.Element{&textBlock},
			}
			tableCells = append(tableCells, cell)
		}
		allRows = append(allRows, tableCells)
	}

	if len(allRows) == 0 {
		return adaptivecard.Element{}, fmt.Errorf("no valid rows found in table")
	}

	// Create table with first row as headers
	firstRowAsHeaders := true
	showGridLines := true

	table, err := adaptivecard.NewTableFromTableCells(allRows, 0, firstRowAsHeaders, showGridLines)
	if err != nil {
		return adaptivecard.Element{}, fmt.Errorf("failed to create table: %w", err)
	}

	// Set column widths based on header content length
	table.Columns = calculateColumnWidths(headerLengths)

	return table, nil
}

// calculateColumnWidths creates TableColumnDefinition entries with widths

View on GitHub (pinned to 49183d7e8d)