ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds t
ActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds t
What Happened#
cupixworks-mysql2 (= tesla 의 mysql2 APM adapter span, 실제 앱은 tesla cupixworks-api) 에서 Mysql2::Error: You have an error in your SQL syntax 가 집계되었다. 클러스터의 Representative Error 는 facility_repository.rb 의 default_joins SELECT 문(facilities.*, workspaces.name AS workspace_name, teams.qa_preference AS team_qa_preference)을 가리키지만, 이 변형은 최근 14일 창에서 0건이며 STALE 하다. last_seen 시점의 실제 발생은 전혀 다른 경로 — Compass Text-to-SQL 기능(POST /api/v1/mcp/search, Api::V1::CompassSearchController#search)에서 Gemini LLM 이 생성한 SQL 에 치환되지 않은 템플릿 placeholder {facility_id}} 가 남아 MySQL EXPLAIN 파싱이 실패한 케이스다. 이 실패는 이미 Cupix::Errors::Parameter (ARG20006) → HTTP 400 으로 정상 매핑된다.
Quick Facts#
| Field | Value |
|---|---|
| exception.class | Cupix::Errors::Parameter (wrapping ActiveRecord::StatementInvalid / Mysql2::Error) |
| exception.message | SQL validation failed: Mysql2::Error: You have an error in your SQL syntax; ... near '{facility_id}} AND f.trashed_at IS NULL AND (f.id IN (SELECT facility_id FROM ' at line 8 |
| error.code | ARG20006 (develop tree 상 동형 코드 = ARG20003, query_executor.rb:62) |
| top_frame | app/services/cupix/compass/db_search/query_executor.rb:59 (explain_validate! → EXPLAIN) |
| endpoint | POST /api/v1/mcp/search (Api::V1::CompassSearchController#search) |
| http.status | 400 |
| deploy | production-us-west-2-20260723t0838z0-7d0d9d21-cupixworks |
| env | dev + production (us-west-2) |
Affected Teams#
| Team / Domain | Error Count (14d) | Impact |
|---|---|---|
| cupix (internal) | 29 | Compass Text-to-SQL 검색 요청이 400 반환 (기능 개발/테스트 트래픽) |
| updatedemo | 7 | 동일 400 |
| nexus | 4 | 동일 400 |
| built | 3 | 동일 400 |
| secc / admin | 2 | 동일 400 |
env 분포: dev 30 / production 15. 모두 Api::V1::CompassSearchController#search, 모두 HTTP 400.
Timeline#
- 2026-03-18 19:17 KST — 클러스터
first_seen(ET 가 SQL syntax error 이슈로 최초 그룹화, 당시 Representative =facility_repository.rb default_joins변형). - 2026-07-24 13:47 KST — 최근 14일 창 내 Compass
{facility_id}}placeholder 400 최초 관측 (production, team secc). - 2026-08-06 05:54 KST — 클러스터
last_seen. 동일 시각(20:54:34Z) Compass{facility_id}}400 로그 확인. - 2026-08-06 — RCA 수행. Representative(default_joins) 변형은 14일 창 0건으로 STALE 확인.
Scoring#
Confidence 100% · Actionability 52%
Confidence#
| Dimension | Score | Detail |
|---|---|---|
| Evidence completeness | 5/5 | 23 code refs, 9 log queries |
| Code path explicitness | 3/3 | 23 file:line refs |
| Log evidence | 3/3 | section, query, pattern |
| RCA structure | 3/3 | 3/3 sections |
| Revision history | 3/3 | 3 revision(s) |
| Agent execution | 3/3 | success |
Actionability#
| Dimension | Score | Detail |
|---|---|---|
| Fix complexity | 5/5 | trivial |
| Affected files | 1/5 | 21 file(s) |
| Single repo | 1/3 | 2 service(s) |
| Immediate actions | 0/3 | absent |
| Testability | 0/3 | no test info |
| External dependency | 3/3 | no external deps |
| Data migration | 3/3 | no migration |