fix(analysis): stop a '|' in the Info column from failing analysis (#550)#551
Conversation
… Info can't corrupt them (#550) tshark output is split on '|', but _ws.col.Info is free text that can contain literal '|' (FTP passive-mode "(|||50076", SMTP/SIP/LDAP messages). A pipe there adds columns and shifts every fixed-index field after Info. The fixed read of arp.src.proto_ipv4 (f[16]) then landed on shifted tcp.payload hex, which flowed into ip_mac_observations.ip (varchar(45)) and overflowed it — aborting the whole analysis transaction, surfaced in the UI as "Analysis failed on server". Read all fields after _ws.col.Info tail-relative (they are structured and fixed in count), matching what was already done for frame.number/syn/ack (#496), and reconstruct Info as the middle span. Belt-and-suspenders: cap the ARP-embedded IPs to 45 like srcIp/dstIp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the PCAP parser to read fields after the _ws.col.Info column relative to the end of the row. This prevents parsing errors and database overflows caused by the '|' separator splitting the free-text Info column. Additionally, embedded ARP IP addresses are capped at 45 characters. The review feedback suggests a performance optimization to avoid StringBuilder allocation when parsing standard rows that do not contain the '|' separator.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Skip the StringBuilder + rejoin loop for the common case where the Info column has no embedded '|' (n == 23), assigning f[11] directly. Keeps the per-packet hot path allocation-free for the vast majority of rows; the rejoin runs only when Info actually spans multiple columns. (PR #551 review) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
Uploading a capture with packets whose
_ws.col.Infotext contains a literal|fails analysis with "Analysis failed on server." Reproduced with The Ultimate PCAP (FTP passive-mode229 Entering Extended Passive Mode (|||50076, plus SMTP/SIP/LDAP messages).Fixes #550.
Root cause
PcapParserServiceruns tshark with-E separator="|"and splits each line on|. But_ws.col.Infois free text that can itself contain|. When it does, the row gains extra columns and every fixed-index field read after Info is shifted. The fixed read ofarp.src.proto_ipv4(f[16]) then lands on shiftedtcp.payloadhex (a 96-char string), which flows intoarpSrcIpand is inserted intoip_mac_observations.ip(varchar(45)):That failed insert aborts the Postgres transaction, so every subsequent query returns "current transaction is aborted" and the analysis is marked FAILED.
The trailing fields (
frame.number, syn, ack) were already read tail-relative for this exact reason (#496); the middle fieldsf[12]–f[19]were left on fixed indices.Fix
_ws.col.Infotail-relative (they are structured and fixed in count — 11 of them), and reconstructInfoas the middle span (infois aTEXTcolumn, so rejoining is safe).srcIp/dstIp, so a malformed value can never abort the transaction again.No schema change; no API change.
Verification
arp.src.proto_ipv4read has max length 15 and 0 rows over 45; the shifted FTP rows realign — correct frame numbers, correct syn/ack, empty ARP fields.ip_mac_observationspersists 30 rows with max IP length 15 / max MAC length 17.🤖 Generated with Claude Code