aitable-workflow-cli 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +1 -6
  2. package/dist/{chunk-IGB6WDLR.js → chunk-UNPV6DTX.js} +1 -1
  3. package/dist/cli.js +47 -47
  4. package/dist/config-set-FBOQBRSJ.js +13 -0
  5. package/dist/{config-ui-server-CORDAOYI.js → config-ui-server-IUSACAOT.js} +1 -1
  6. package/package.json +3 -3
  7. package/dist/config-set-EGLLIMVJ.js +0 -13
  8. package/templates/support-qa/.env.example +0 -16
  9. package/templates/support-qa/aitable-workflow.config.yml +0 -46
  10. package/templates/support-qa/coding-agents.config.json +0 -18
  11. package/templates/support-qa/lib/__tests__/declarative-matcher.test.ts +0 -240
  12. package/templates/support-qa/lib/__tests__/dingtalk-group-membership.test.ts +0 -144
  13. package/templates/support-qa/lib/__tests__/memory-events.test.ts +0 -90
  14. package/templates/support-qa/lib/__tests__/sandbox-agent.test.ts +0 -382
  15. package/templates/support-qa/lib/__tests__/thread-adapter.test.ts +0 -242
  16. package/templates/support-qa/lib/__tests__/thread-observe-step.test.ts +0 -391
  17. package/templates/support-qa/lib/__tests__/thread-observer-handler.test.ts +0 -274
  18. package/templates/support-qa/lib/action-dispatch.ts +0 -262
  19. package/templates/support-qa/lib/contract.ts +0 -253
  20. package/templates/support-qa/lib/declarative-matcher.ts +0 -398
  21. package/templates/support-qa/lib/dingtalk-group-membership.ts +0 -158
  22. package/templates/support-qa/lib/guards.ts +0 -18
  23. package/templates/support-qa/lib/memory-events.ts +0 -113
  24. package/templates/support-qa/lib/owner-resolver.ts +0 -94
  25. package/templates/support-qa/lib/preflight.ts +0 -294
  26. package/templates/support-qa/lib/profile.ts +0 -51
  27. package/templates/support-qa/lib/sandbox-agent.ts +0 -653
  28. package/templates/support-qa/lib/thread-adapter.ts +0 -281
  29. package/templates/support-qa/lib/thread-digest.ts +0 -144
  30. package/templates/support-qa/npmrc +0 -1
  31. package/templates/support-qa/package.json +0 -27
  32. package/templates/support-qa/profiles/aitable/profile/escalation/contacts.json +0 -37
  33. package/templates/support-qa/profiles/aitable/profile/escalation/owner-map.json +0 -18
  34. package/templates/support-qa/profiles/aitable/profile/fastpath/known-answers.yml +0 -561
  35. package/templates/support-qa/profiles/aitable/profile/profile.yml +0 -219
  36. package/templates/support-qa/profiles/aitable/profile/prompts/kb-editor.md +0 -3
  37. package/templates/support-qa/profiles/aitable/profile/prompts/persona.md +0 -49
  38. package/templates/support-qa/profiles/aitable/profile/prompts/troubleshooter.md +0 -5
  39. package/templates/support-qa/profiles/aitable/profile/troubleshoot/classifiers.yml +0 -36
  40. package/templates/support-qa/profiles/aitable/skills/troubleshooting/SKILL.md +0 -58
  41. package/templates/support-qa/profiles/aitable/skills/troubleshooting/aitable-import-troubleshooter/SKILL.md +0 -485
  42. package/templates/support-qa/profiles/aitable/skills/troubleshooting/aitable-openapi-troubleshooter/SKILL.md +0 -183
  43. package/templates/support-qa/profiles/aitable/skills/troubleshooting/import-openapi-e2e-troubleshooter/SKILL.md +0 -459
  44. package/templates/support-qa/profiles/aitable/skills/troubleshooting/notable-datasource-troubleshooter/SKILL.md +0 -1286
  45. package/templates/support-qa/profiles/aitable/skills/troubleshooting/notable-field-troubleshooter/SKILL.md +0 -673
  46. package/templates/support-qa/profiles/aitable/skills/troubleshooting/spreadsheet-datasync-troubleshooter/SKILL.md +0 -322
  47. package/templates/support-qa/profiles/default/profile/fastpath/known-answers.yml +0 -32
  48. package/templates/support-qa/profiles/default/profile/profile.yml +0 -217
  49. package/templates/support-qa/profiles/default/profile/troubleshoot/classifiers.yml +0 -37
  50. package/templates/support-qa/profiles/default/wiki/support//345/270/270/350/247/201/351/227/256/351/242/230.md +0 -10
  51. package/templates/support-qa/tsconfig.json +0 -16
  52. package/templates/support-qa/vitest.config.ts +0 -9
  53. package/templates/support-qa/workflows/admin-kb-update/recipes/kb-refine.recipe.ts +0 -137
  54. package/templates/support-qa/workflows/admin-kb-update/recipes/kb_sync_handler.recipe.ts +0 -119
  55. package/templates/support-qa/workflows/admin-kb-update/workflow.yml +0 -96
  56. package/templates/support-qa/workflows/config-sync/recipes/config_sync.recipe.ts +0 -668
  57. package/templates/support-qa/workflows/config-sync/recipes/config_sync_handler.recipe.ts +0 -16
  58. package/templates/support-qa/workflows/config-sync/workflow.yml +0 -62
  59. package/templates/support-qa/workflows/daily-review/recipes/daily_review.recipe.ts +0 -602
  60. package/templates/support-qa/workflows/daily-review/recipes/daily_review_handler.recipe.ts +0 -26
  61. package/templates/support-qa/workflows/daily-review/workflow.yml +0 -65
  62. package/templates/support-qa/workflows/group-qa/recipes/answer.recipe.ts +0 -231
  63. package/templates/support-qa/workflows/group-qa/recipes/conversation_handler.recipe.ts +0 -394
  64. package/templates/support-qa/workflows/group-qa/recipes/fastpath.recipe.ts +0 -72
  65. package/templates/support-qa/workflows/group-qa/recipes/on-action.recipe.ts +0 -225
  66. package/templates/support-qa/workflows/group-qa/recipes/reply-to-group.recipe.ts +0 -202
  67. package/templates/support-qa/workflows/group-qa/recipes/troubleshoot.recipe.ts +0 -273
  68. package/templates/support-qa/workflows/group-qa/workflow.yml +0 -268
  69. package/templates/support-qa/workflows/thread-observer/README.md +0 -96
  70. package/templates/support-qa/workflows/thread-observer/recipes/thread_observe.recipe.ts +0 -415
  71. package/templates/support-qa/workflows/thread-observer/recipes/thread_observer_handler.recipe.ts +0 -213
  72. package/templates/support-qa/workflows/thread-observer/workflow.yml +0 -185
  73. package/templates/support-qa/workspaces/daily-review/AGENTS.md +0 -233
  74. package/templates/support-qa/workspaces/kb-editor/AGENTS.md +0 -32
  75. package/templates/support-qa/workspaces/support/AGENTS.md +0 -156
  76. package/templates/support-qa/workspaces/thread-observer/AGENTS.md +0 -156
  77. package/templates/support-qa/workspaces/troubleshooter/AGENTS.md +0 -71
@@ -1,183 +0,0 @@
1
- ---
2
- name: aitable-openapi-troubleshooter
3
- version: 0.3.0
4
- description: 排查 AI表格/文档 OpenAPI 线上错误。用户提供 requestId 或 traceId 时触发,按完整调用链(lippi-doc-solution → lippi-doc-notable → notable-fc → 回调 lippi-doc-notable HSF)逐层定位错误根因,判断是下游报错、FC 执行异常还是抖动/超时。
5
- allowed-tools: mcp__sls-mcp__list_sls_projects, mcp__sls-mcp__query_sls_logs, mcp__sls-mcp__query_sls_logs_full, mcp__sls-mcp__get_sls_log_detail
6
- ---
7
-
8
- # OpenAPI 错误排查 Skill
9
-
10
- 用户给出 requestId 或 traceId,在 SLS 日志中定位 AI表格/文档 OpenAPI 错误根因。
11
-
12
- ## 整体架构
13
-
14
- ```
15
- 用户/OpenAPI平台 (pop-aliyun-com)
16
- └─ lippi-doc-solution 【网关层】SLS: lippi-doc-solution / master / cn-wulanchabu
17
- └─ lippi-doc-notable 【中间层】SLS: lippi-doc-notable / master / cn-wulanchabu
18
- └─ notable-fc 【主执行层★】SLS: lippi-doc-notable-frontend / notable-fc / cn-hangzhou
19
- └─ lippi-doc-notable (HSF 回调)
20
- ↑ notable-fc 内部需要业务数据时(用户信息、文档信息等),
21
- 会再次调用 lippi-doc-notable 上注册的 HSF 方法
22
- ```
23
-
24
- **关键认知**:OpenAPI 的实际业务逻辑主要跑在 notable-fc 这个 FC 容器里。`lippi-doc-solution` 是网关,`lippi-doc-notable` 做简单权限校验后把请求转发给 notable-fc;notable-fc 执行业务时如果需要获取文档信息、用户信息等,会回调 `lippi-doc-notable` 的 HSF 接口。所以排查时要优先看 notable-fc 的日志。
25
-
26
- ## SLS 资源清单
27
-
28
- | 层级 | SLS Project | Logstore | Region |
29
- |---|---|---|---|
30
- | 网关层 | `lippi-doc-solution` | `master` | `cn-wulanchabu` |
31
- | 中间层 | `lippi-doc-notable` | `master` | `cn-wulanchabu` |
32
- | **主执行层** | `lippi-doc-notable-frontend` | `notable-fc` | `cn-hangzhou` |
33
-
34
- ## 排查路径
35
-
36
- ### 第一步:从网关层确认请求基本信息
37
-
38
- 用 requestId 或 traceId 在 `lippi-doc-solution` 查请求入口日志:
39
-
40
- ```
41
- projectName: lippi-doc-solution
42
- logstoreName: master
43
- region: cn-wulanchabu
44
- query: <requestId 或 traceId>
45
- quickTimeRange: 最近7天(用户提供具体时间则用 fromTime/toTime)
46
- ```
47
-
48
- 提取关键字段:
49
- - `baseId` / `sheetIdOrName` —— 目标文档/表格
50
- - `appId` / `systemOrgId` / `userId` —— 调用方身份
51
- - `methodName` —— 调用的 OpenAPI 接口
52
- - `callerApp` —— 上游调用方(如 `pop-aliyun-com`)
53
- - `rt` / `errorCode` / `errorMessage`
54
-
55
- 同时关注 `HSF-CLIENT-DIGEST` 日志判断网关层到中间层的调用是否正常。
56
-
57
- ### 第二步:在 notable-fc 查主执行日志(核心)
58
-
59
- FC 容器是实际执行业务逻辑的地方,用 traceId 或 requestId 查:
60
-
61
- ```
62
- projectName: lippi-doc-notable-frontend
63
- logstoreName: notable-fc
64
- region: cn-hangzhou
65
- query: <traceId 或 requestId>
66
- ```
67
-
68
- 重点看:
69
- - FC 内部的 ERROR / WARN 日志
70
- - notable-fc 向 lippi-doc-notable 发起 HSF 回调时的错误(如获取文档信息、用户信息失败)
71
- - 函数执行是否超时或冷启动
72
-
73
- ### 第三步:必要时在 lippi-doc-notable 查中间层日志
74
-
75
- 用于确认权限校验、转发阶段是否有问题,或者查看 notable-fc 回调过来的 HSF 方法执行情况:
76
-
77
- ```
78
- projectName: lippi-doc-notable
79
- logstoreName: master
80
- region: cn-wulanchabu
81
- query: <traceId>
82
- ```
83
-
84
- ### 第四步:判断是抖动还是确定性错误
85
-
86
- **网关超时阈值:6000ms**。`lippi-doc-solution` 网关对下游的超时限制为 6s,超过后外部调用者会收到超时报错。排查时先看 `lippi-doc-solution` 的 `rt` 字段:
87
- - `rt >= 6000` → 网关超时,需重点看 notable-fc 是否执行慢或冷启动
88
- - `rt < 6000` 但有错误 → 下游确定性报错,看错误码和错误信息
89
-
90
- | 特征 | 判断 |
91
- |---|---|
92
- | `time=FAST`,rt 在几百ms内,有具体业务错误码 | 下游**确定性业务报错**,不是抖动 |
93
- | `time=SLOW` 或 `rt >= 6000` | **网关超时**,外部调用者同样收到报错,重点排查 notable-fc 执行耗时 |
94
- | 同时间段多个不同 baseId/userId 均报同一错误 | 服务级别问题,非单文档问题 |
95
- | 只有特定 baseId 报错 | 文档数据问题(文档不存在/被删除/权限) |
96
- | notable-fc 日志有冷启动或函数超时 | FC 容器层面问题,可能导致网关超时 |
97
-
98
- ### 第五步:判断是偶现问题还是批量底层抖动(必查)
99
-
100
- **无论错误类型如何,都要做两个维度的交叉验证:**
101
-
102
- #### 5.1 横向:同时间段内其他文档是否有同样的问题?
103
-
104
- 在 notable-fc 查询出错时间点前后 **±5 分钟**,搜索同类型的关键日志(去掉 baseId/docId 条件),看是否有大批量不同文档出现相同的慢或报错:
105
-
106
- ```
107
- projectName: lippi-doc-notable-frontend
108
- logstoreName: notable-fc
109
- region: cn-hangzhou
110
- query: <关键方法名或错误关键词,不加 docId>
111
- fromTime/toTime: 出错时间点 ±5 分钟
112
- limit: 50
113
- ```
114
-
115
- - **大量不同 docId 同时出现慢/报错** → 底层服务(OSS / HSF / 依赖中间件)在该时段出现整体抖动,属于**平台级问题**,不是文档本身的问题
116
- - **只有该 docId 出现问题** → 文档特有,继续下钻数据/权限层面
117
-
118
- 典型场景:`getCheckpointAndOps` 的 cpDownloadTime / opsDownloadTime 同时在多个 docId 异常飙高 → OSS 访问慢
119
-
120
- #### 5.2 纵向:该文档历史上是否多次出现同样的问题?
121
-
122
- 用具体的 docId/baseId 查询最近 7 天的同类日志:
123
-
124
- ```
125
- projectName: lippi-doc-notable-frontend
126
- logstoreName: notable-fc
127
- region: cn-hangzhou
128
- query: <docId 或 baseId> AND <关键方法名或错误关键词>
129
- quickTimeRange: 最近7天
130
- ```
131
-
132
- - **历史多次复现** → 该文档存在持续性问题(数据量过大、频繁写入、权限配置错误等),需针对该文档排查
133
- - **历史从未出现,仅此一次** → 结合 5.1 的横向结果,大概率是外部平台抖动的连带影响,无需针对文档处理
134
-
135
- #### 5.3 综合判断矩阵
136
-
137
- **⚠️ 前置闸门(必须先判错误类型,再决定要不要套抖动矩阵)**:下面的「横向×纵向」矩阵只对**时延/超时类**错误成立。先用第四步的判定:
138
-
139
- - **确定性业务报错(4xx,如 `InvalidRequest.ResourceNotFound`、`fail to find field`、参数/数据校验失败,且 `rt` 短、未超时)** → **不套抖动矩阵**。此时根因已在调用方的请求参数/数据,横向「同时段多文档同错」≠ 平台抖动,只说明**多个调用方各自请求都不对(调用方共性问题)**,绝不能误判成平台抖动。
140
- - 横向大批量 → 调用方共性问题(多个客户端批量写入 schema/参数不匹配)
141
- - 仅该文档 → 单一调用方/文档的请求参数错误
142
- - **超时 / 慢 / 未知类(`rt >= 6000`、`time=SLOW`、无明确业务错误码)** → 才用下面的抖动矩阵区分平台 vs 文档。
143
-
144
- | 横向(同时段其他文档) | 纵向(该文档历史) | 结论 |
145
- |---|---|---|
146
- | 大批量受影响 | 无历史复现 | **平台级抖动**(OSS/HSF/中间件),非文档问题 |
147
- | 大批量受影响 | 历史多次复现 | 平台抖动 + 文档本身也有性能问题,双重因素 |
148
- | 仅该文档受影响 | 历史多次复现 | **文档特有持续性问题**,需针对文档排查 |
149
- | 仅该文档受影响 | 无历史复现 | 偶发性异常,可能是单次资源竞争,观察为主 |
150
-
151
- > 真实踩坑(requestId `C127F54A`):`insertRecords` 引用了目标表不存在的字段,同时段 ±5min 内 `fail to find field` 跨多个 docId 命中 528 条。若直接套矩阵会误判「平台级抖动」,但逐层证据均为各自表的确定性 4xx 校验错——正确结论是**调用方共性问题,非平台抖动**。
152
-
153
- ## 常见错误模式
154
-
155
- ### `fail to get document info` (errorCode: 5000001)
156
- - **位置**:通常是 notable-fc 内部回调 `lippi-doc-notable` 的 `getSheetFields` / `getDocumentInfo` 失败
157
- - **是抖动吗**:看 `time=FAST` 则为确定性报错
158
- - **可能原因**:文档不存在/已删除;notable HSF 服务在该时段异常
159
-
160
- ### `internalError`
161
- - `lippi-doc-solution` 对下游错误的统一包装,需结合下游日志看真实错误码
162
-
163
- ## AI表格接口范围(错误统计专用)
164
-
165
- 统计 AI表格 OpenAPI 错误时,**只统计以下接口**,不含文档类接口:
166
-
167
- ```
168
- deleteRecords, insertRecords, updateRecords, listRecord, getRecord, getRecords,
169
- createField, updateField, deleteField, getAllFields,
170
- createSheet, deleteSheet
171
- ```
172
-
173
- **不包含**:`getRange`, `getAllSheets`, `docExport`, `getDelegatedDocContent`, `getSheet`, `updateRange`, `docAppendText`, `docBlocksQuery`, `getDocContent`, `updateSheet`, `docExportByDelegatedPermission` 等。
174
-
175
- ## 输出格式
176
-
177
- 排查结束后,输出:
178
-
179
- 1. **发生时间** & **总耗时**
180
- 2. **调用信息**(baseId、orgId、userId、methodName、callerApp)
181
- 3. **错误链**:在哪一层报错(网关层 / 中间层 / notable-fc / FC 回调 HSF)
182
- 4. **判断**:是抖动 / 确定性业务报错 / 文档数据问题 / FC 执行异常
183
- 5. **建议**:下一步去哪个服务/日志继续排查
@@ -1,459 +0,0 @@
1
- ---
2
- name: import-openapi-e2e-troubleshooter
3
- version: 0.2.0
4
- description: >-
5
- 多维表导入 OpenAPI 端到端排查与监控技能。
6
- 两种模式:(1) 大盘模式——展示导入链路各层成功率、失败原因分布;
7
- (2) 单次排查模式——用户提供 traceId / jobId / baseId / docId / importId 时,
8
- 追踪这一次导入从 OpenAPI 网关到 converter 转换的全链路失败根因。
9
- 触发词:"导入排查"、"导入成功率"、"导入大盘"、"import troubleshoot"、
10
- "导入失败"、"查导入链路"。
11
- allowed-tools: mcp__sls-mcp__list_sls_projects, mcp__sls-mcp__query_sls_logs, mcp__sls-mcp__query_sls_logs_full, mcp__sls-mcp__get_sls_log_detail, mcp__sls-mcp__count_sls_logs
12
- ---
13
-
14
- # 多维表导入 OpenAPI 端到端排查
15
-
16
- ## 整体架构
17
-
18
- ```
19
- Client
20
- └─ OpenAPI Gateway (pop-aliyun-com)
21
- └─ lippi-doc-solution 【网关层】 SLS: lippi-doc-solution / master / cn-wulanchabu
22
- └─ lippi-doc-notable 【业务层】 SLS: lippi-doc-notable / master / cn-wulanchabu
23
- ├─ lippi-doc-converter-notable 【转换层】SLS: lippi-doc-converter / master / cn-wulanchabu
24
- │ └─ CsvConvertServiceImpl / XlsxConvertService
25
- │ └─ lippi-doc-notable-core (HSF: isNotableCoreApiEnabled 等)
26
- └─ notable-fc 【写入层】 SLS: lippi-doc-notable-frontend / notable-fc / cn-hangzhou
27
- └─ 写入 records → lippi-doc-notable (HSF 回调)
28
- ```
29
-
30
- **导入流程**:
31
- 1. Client 调 `prepareImportUpload` → 获取上传链接和 importId
32
- 2. Client 上传文件到 OSS
33
- 3. Client 调 `executeImport` → lippi-doc-notable 创建导入会话,发 MQ 消息给 converter
34
- 4. converter-notable 消费 MQ,下载文件并解析(CSV 走 Java CsvConvertServiceImpl,xlsx 走 Rust gRPC)
35
- 5. converter-notable 写入数据到 notable(通过 notable-fc 或直接 HSF)
36
- 6. 转换完成后回调 lippi-doc-notable 更新导入状态
37
- 7. Client 轮询 `queryImportStatus` 获取最终结果
38
-
39
- **关键认知**:
40
- - solution 层的 `queryImportStatus` 返回 `IMPORT_FAILED` 时,`errorMessage` 只有 `"data import job failed: jobId=xxx"`,**没有有效信息**
41
- - 真正的失败原因在 **converter-notable 的 ERROR 日志**中,必须用 jobId 去 converter 层查
42
- - converter-notable 的错误日志几乎都会截断,**必须用 `get_sls_log_detail` 获取完整堆栈**
43
-
44
- ## SLS 资源清单
45
-
46
- | 层级 | SLS Project | Logstore | Region | 说明 |
47
- |---|---|---|---|---|
48
- | 网关层 | `lippi-doc-solution` | `master` | `cn-wulanchabu` | 4 个 OpenAPI 的 HSF DIGEST/RESPONSE 日志 |
49
- | 业务层 | `lippi-doc-notable` | `master` | `cn-wulanchabu` | 导入会话管理、MQ 回调状态 |
50
- | **转换层** | `lippi-doc-converter` | `master` | `cn-wulanchabu` | converter-notable 的转换执行日志(**根因所在**) |
51
- | 写入层 | `lippi-doc-notable-frontend` | `notable-fc` | `cn-hangzhou` | FC 写入数据时的错误(行数超限、字段不存在等) |
52
-
53
- ## 日志格式要点
54
-
55
- ### solution 层(content 大字段,无独立索引列)
56
-
57
- 所有字段都在 `content` 文本中,分析时用 `regexp_extract` 提取:
58
-
59
- ```
60
- HSF-SERVER-DIGEST 格式:
61
- category=HSF-SERVER-DIGEST, rt=24, role=provider, clientIp=..., methodName=getImportEncryptPublicKey, time=FAST, serviceName=...ImportApiService_Open, callerApp=pop-aliyun-com, status=OK
62
-
63
- HSF-SERVER-RESPONSE 格式:
64
- category=HSF-SERVER-RESPONSE, role=provider, response={"result":{"phase":"COMPLETED","status":"success",...},"success":true}, ... methodName=queryImportStatus, ...
65
-
66
- traceId 位于 content 的第一个 | 分隔字段:
67
- 2026-06-09 11:12:48.697|<traceId>|<rpcId>|...
68
- 提取方式: regexp_extract(content, '^[^|]+\|([^|]+)\|', 1)
69
- ```
70
-
71
- ### converter-notable 层(独立索引列)
72
-
73
- 有独立索引列:`traceId`、`level`、`logger`、`message`、`time` 等。
74
- 关键日志:
75
- - `logger=SERVICE_DETAIL_LOGGER` + `ConverterNotableConvertJobConsumer` + `success=N` → 转换失败
76
- - `logger=SERVICE_DIGEST_LOGGER` + `setFailedStatusAndErrCode` → 设置失败状态
77
-
78
- ### notable-fc 层(部分独立索引列)
79
-
80
- 索引列:`errorCode`、`method`、`category`、`appType`、`success`、`docId`、`uid` 等。
81
- **非索引列**:`message`、`errorMsg`(需用全文检索过滤)。
82
-
83
- ---
84
-
85
- ## 模式一:大盘模式
86
-
87
- 用户说"导入成功率"、"导入大盘"、"导入监控"时触发。
88
-
89
- ### 第一步:查询 OpenAPI 网关层指标
90
-
91
- ```
92
- projectName: lippi-doc-solution
93
- logstoreName: master
94
- region: cn-wulanchabu
95
- quickTimeRange: 最近7天(或用户指定的时间范围)
96
- ```
97
-
98
- **查询 1 — 各接口调用量 + 成功率 + RT**:
99
-
100
- ```sql
101
- HSF-SERVER-DIGEST and (getImportEncryptPublicKey or prepareImportUpload or executeImport or queryImportStatus)
102
- | select
103
- regexp_extract(content, 'methodName=(\w+)', 1) as method_name,
104
- count(distinct regexp_extract(content, '^[^|]+\|([^|]+)\|', 1)) as total,
105
- sum(case when regexp_extract(content, 'status=(\w+)', 1) = 'OK' then 1 else 0 end) * 100.0 / count(1) as success_pct,
106
- avg(cast(regexp_extract(content, 'rt=(\d+)', 1) as bigint)) as avg_rt,
107
- approx_percentile(cast(regexp_extract(content, 'rt=(\d+)', 1) as bigint), 0.99) as p99_rt
108
- group by regexp_extract(content, 'methodName=(\w+)', 1)
109
- order by total desc
110
- ```
111
-
112
- **查询 2 — 导入任务终态分布**:
113
-
114
- ```sql
115
- HSF-SERVER-RESPONSE and queryImportStatus and (COMPLETED or FAILED or IMPORT_FAILED)
116
- | select
117
- regexp_extract(content, '"phase":"(\w+)"', 1) as phase,
118
- count(distinct regexp_extract(content, '^[^|]+\|([^|]+)\|', 1)) as cnt
119
- group by regexp_extract(content, '"phase":"(\w+)"', 1)
120
- ```
121
-
122
- **查询 3 — 端到端漏斗**:
123
-
124
- ```sql
125
- HSF-SERVER-DIGEST and (getImportEncryptPublicKey or prepareImportUpload or executeImport or queryImportStatus)
126
- | select
127
- regexp_extract(content, 'methodName=(\w+)', 1) as step,
128
- count(distinct regexp_extract(content, '^[^|]+\|([^|]+)\|', 1)) as cnt
129
- where regexp_extract(content, 'methodName=(\w+)', 1) in ('prepareImportUpload', 'executeImport', 'queryImportStatus')
130
- group by regexp_extract(content, 'methodName=(\w+)', 1)
131
- ```
132
-
133
- **查询 4 — 业务失败原因**:
134
-
135
- ```sql
136
- HSF-SERVER-RESPONSE and queryImportStatus and IMPORT_FAILED
137
- | select
138
- regexp_extract(content, '"errorCode":"([^"]+)"', 1) as error_code,
139
- regexp_extract(content, '"errorMessage":"([^"]+)"', 1) as error_msg,
140
- count(1) as cnt
141
- group by
142
- regexp_extract(content, '"errorCode":"([^"]+)"', 1),
143
- regexp_extract(content, '"errorMessage":"([^"]+)"', 1)
144
- order by cnt desc
145
- ```
146
-
147
- ### 第二步:查询 converter 转换层失败
148
-
149
- ```
150
- projectName: lippi-doc-converter
151
- logstoreName: master
152
- region: cn-wulanchabu
153
- quickTimeRange: 最近7天
154
- ```
155
-
156
- **查询 5 — 转换失败总量**:
157
-
158
- ```sql
159
- ConverterNotableConvertJobConsumer and success=N | select count(1) as cnt
160
- ```
161
-
162
- **查询 6 — 转换失败按 jobType 和 errorCode 分布**:
163
-
164
- ```sql
165
- ConverterNotableConvertJobConsumer and success=N | select jobType, errorCode, count(1) as cnt group by jobType, errorCode order by cnt desc
166
- ```
167
-
168
- ### 第三步:查询 notable-fc 写入层失败
169
-
170
- ```
171
- projectName: lippi-doc-notable-frontend
172
- logstoreName: notable-fc
173
- region: cn-hangzhou
174
- quickTimeRange: 最近7天
175
- ```
176
-
177
- **查询 7 — FC 写入层失败总量**:
178
-
179
- ```sql
180
- appType=IMPORT and success=false | select count(1) as cnt
181
- ```
182
-
183
- **查询 8 — FC 写入层按方法分布**:
184
-
185
- ```sql
186
- appType=IMPORT and success=false | select method, count(1) as cnt group by method order by cnt desc
187
- ```
188
-
189
- **查询 9 — FC 写入层错误分类**(`message` 不是索引列,用全文检索分类,每个独立查询):
190
-
191
- | 错误类型 | 查询语句(`|` 右侧统一用 `select count(1) as cnt`) |
192
- |---|---|
193
- | 限流 429 | `appType=IMPORT and success=false and "Too Many Requests" \| select count(1) as cnt` |
194
- | HSF 超时 | `appType=IMPORT and success=false and "no response in" \| select count(1) as cnt` |
195
- | 超行数上限 | `appType=IMPORT and success=false and "at most" and records \| select count(1) as cnt` |
196
- | 超表数上限 | `appType=IMPORT and success=false and "at most" and sheet \| select count(1) as cnt` |
197
- | 字段不存在 | `appType=IMPORT and success=false and "fail to find field" \| select count(1) as cnt` |
198
- | 线程池满 | `appType=IMPORT and success=false and "thread pool is full" \| select count(1) as cnt` |
199
-
200
- ### 第四步:输出大盘报告
201
-
202
- ```markdown
203
- ## 多维表导入 OpenAPI 大盘(<时间范围>)
204
-
205
- ### 一、OpenAPI 网关层
206
- | 接口 | 调用量 | HSF 成功率 | Avg RT | P99 RT |
207
- |---|---|---|---|---|
208
- | getImportEncryptPublicKey | X | X% | Xms | Xms |
209
- | prepareImportUpload | X | X% | Xms | Xms |
210
- | executeImport | X | X% | Xms | Xms |
211
- | queryImportStatus | X | X% | Xms | Xms |
212
-
213
- ### 二、导入任务端到端结果
214
- | 终态 | 数量 | 占比 |
215
- |---|---|---|
216
- | COMPLETED (成功) | X | X% |
217
- | FAILED (失败) | X | X% |
218
-
219
- **业务成功率**: X / (X + X) = **X%**
220
-
221
- ### 三、端到端漏斗
222
- prepareImportUpload: X → executeImport: X → queryImportStatus(终态): X
223
-
224
- ### 四、converter 转换层失败
225
- | jobType | errorCode | 数量 |
226
- |---|---|---|
227
- | CSV_TO_NOTABLE_V2 | 80000001 | X |
228
- | ... | ... | ... |
229
-
230
- ### 五、notable-fc 写入层失败
231
- | 错误类型 | 数量 |
232
- |---|---|
233
- | 限流 (429) | X |
234
- | HSF 超时 | X |
235
- | 超行数上限 | X |
236
- | ... | ... |
237
- ```
238
-
239
- ---
240
-
241
- ## 模式二:单次排查模式
242
-
243
- 用户提供 traceId / jobId / baseId / docId / importId 中任意一个时触发。
244
-
245
- ### 第一步:提取标识符
246
-
247
- 从用户输入中识别:
248
- - `traceId` — EagleEye traceId(32 位十六进制,如 `21076a0017810575336547930d009c`)
249
- - `jobId` — converter 转换任务 ID(如 `28375009612`)
250
- - `importId` — 导入会话 ID(如 `imp_182d186a226349f993d18f5e50a12b5c`)
251
- - `baseId` / `docId` — 目标文档 ID
252
-
253
- **标识符关联规则**:
254
- - traceId 贯穿全链路,可查所有层
255
- - jobId 出现在 converter 层和 notable 层的 MQ 回调日志中
256
- - importId 出现在 solution 层的 RESPONSE 日志和 notable 层的 ImportSessionServiceImpl 日志中
257
- - docId 出现在 converter 层和 notable-fc 层
258
-
259
- 如果用户只给了其中一个,先查出关联的其他 ID,再逐层追踪。
260
-
261
- ### 第二步:从 solution 网关层入手
262
-
263
- ```
264
- projectName: lippi-doc-solution
265
- logstoreName: master
266
- region: cn-wulanchabu
267
- query: <traceId 或 importId>
268
- quickTimeRange: 最近30天
269
- limit: 20
270
- order: asc
271
- ```
272
-
273
- 提取:
274
- - 调用了哪个 OpenAPI(`methodName`)
275
- - HSF 层是否成功(`status=OK`)
276
- - `queryImportStatus` 的 response 中的 `phase`、`errorCode`、`errorMessage`
277
- - **提取 jobId**:从 `errorMessage` 中提取 `jobId=xxx`
278
-
279
- 如果用户给的是 importId,从 RESPONSE 日志中找到对应的 jobId 和 traceId。
280
-
281
- ### 第三步:到 converter 层查根因(核心)
282
-
283
- ```
284
- projectName: lippi-doc-converter
285
- logstoreName: master
286
- region: cn-wulanchabu
287
- query: <jobId 或 traceId>
288
- quickTimeRange: 最近30天
289
- limit: 20
290
- order: asc
291
- ```
292
-
293
- **重点找**:
294
- 1. `ConverterNotableConvertJobConsumer` + `success=N` 的 ERROR 日志 → **必须用 `get_sls_log_detail` 获取完整内容**
295
- 2. `setFailedStatusAndErrCode` 的 DIGEST 日志 → 提取 errCode
296
- 3. `getConvertStatus` 的返回值 → 提取 `status=3`(失败)和 `errCode`
297
-
298
- 从完整堆栈中提取:
299
- - `BusinessException` 的消息 → 真正的根因
300
- - `jobType`(`CSV_TO_NOTABLE_V2` / `XLSX_TO_NOTABLE_V2`)
301
- - `errorCode`(converter 层错误码)
302
- - `docId`、`uid`
303
-
304
- ### 第四步:到 notable 业务层查会话状态
305
-
306
- ```
307
- projectName: lippi-doc-notable
308
- logstoreName: master
309
- region: cn-wulanchabu
310
- query: <jobId 或 importId 或 traceId>
311
- quickTimeRange: 最近30天
312
- limit: 10
313
- order: asc
314
- ```
315
-
316
- 重点找:
317
- - `ImportSessionServiceImpl` + `MQ wake-up` → 导入会话被唤醒,提取 `status` 和 `errCode`
318
- - `ImportApiServiceImpl` + `executeImport` → 导入请求入口,提取 `dentryUuid`、`uid`、`hasEncryption`、`hasAppend`
319
-
320
- ### 第五步:到 notable-fc 写入层查数据写入错误(按需)
321
-
322
- ```
323
- projectName: lippi-doc-notable-frontend
324
- logstoreName: notable-fc
325
- region: cn-hangzhou
326
- query: <docId 或 traceId> and appType=IMPORT and success=false
327
- quickTimeRange: 最近30天
328
- limit: 10
329
- ```
330
-
331
- 重点看:
332
- - `method` — 哪个写入操作失败
333
- - `message` 中的 `errorCode` 和 `errorMsg`
334
- - `rt` — 是否超时
335
-
336
- ### 第六步:横向验证(判断是否为批量问题)
337
-
338
- 如果 converter 层发现是 HSF 超时或连接异常,检查同时段是否有批量失败:
339
-
340
- ```
341
- projectName: lippi-doc-converter
342
- logstoreName: master
343
- region: cn-wulanchabu
344
- query: ConverterNotableConvertJobConsumer and success=N
345
- fromTime: <出错时间 - 300>
346
- toTime: <出错时间 + 300>
347
- ```
348
-
349
- ```sql
350
- | select errorCode, count(1) as cnt group by errorCode order by cnt desc
351
- ```
352
-
353
- - 大量同时段失败 → 平台级抖动
354
- - 仅此一条 → 单任务问题
355
-
356
- ### 第七步:输出排查报告
357
-
358
- ```markdown
359
- ## 导入失败排查报告
360
-
361
- **基本信息**
362
- - 时间:YYYY-MM-DD HH:MM:SS
363
- - 环境:prod / pre
364
- - traceId:xxx
365
- - jobId:xxx
366
- - importId:xxx
367
- - docId:xxx
368
- - uid:xxx
369
-
370
- **调用链路**
371
- ```
372
- Client → OpenAPI Gateway
373
- → lippi-doc-solution (methodName, rt=Xms, status=OK/FAIL)
374
- → lippi-doc-notable (ImportApiServiceImpl, importId=xxx)
375
- → lippi-doc-converter-notable (MQ, jobType=XXX)
376
- → CsvConvertServiceImpl.xxx() ← 💥 根因
377
- ← errCode=xxx, status=3(FAILED)
378
- ← MQ 回调: "data import job failed: jobId=xxx"
379
- ← queryImportStatus → phase=FAILED, errorCode=IMPORT_FAILED
380
- ```
381
-
382
- **根因**:<一句话描述>
383
-
384
- **错误详情**
385
- - 所在层:converter-notable / notable-fc / notable
386
- - errorCode:xxx
387
- - 异常类:BusinessException / RpcException / ...
388
- - 异常消息:xxx
389
- - 代码位置:XxxServiceImpl.java:XXX
390
-
391
- **错误分类**:
392
- - [ ] 用户文件问题(CSV 内容为空、格式异常、二进制控制字符等)
393
- - [ ] 下游服务问题(notable-core 超时、连接断开等)
394
- - [ ] 平台限制(行数上限、表数上限、字段不存在等)
395
- - [ ] 系统 bug
396
-
397
- **是否为批量问题**:是/否(同时段 X 个任务失败)
398
-
399
- **建议**:
400
- - 给用户:xxx
401
- - 给研发:xxx
402
- ```
403
-
404
- ---
405
-
406
- ## Converter 层常见错误码
407
-
408
- ### CSV 链路(errorCode 7xxxx / 8xxxx,来自 Java CsvConvertServiceImpl)
409
-
410
- | errorCode | 异常特征 | 根因 | 建议 |
411
- |---|---|---|---|
412
- | `80000001` | `import sheet info is empty` | CSV 文件解析后无法提取有效 sheet 信息(空文件/格式不兼容) | 用户检查文件内容,确认非空 |
413
- | `70000015` | `Failed to invoke isNotableCoreApiEnabled` + `RpcException: timeout` | notable-core HSF 超时,converter 无法判断行数上限 | 平台侧问题,检查 notable-core 预发/生产状态 |
414
- | `70000015` | `Failed to invoke isNotableCoreApiEnabled` + `COMM_ERROR` / `connection closed` | notable-core 连接被断开 | 平台侧问题,检查 notable-core 节点稳定性 |
415
- | `70000016` | `Failed to check if notable core API is enabled` | notable-core 服务不可用,无法创建新 sheet | 平台侧问题 |
416
- | `70000016` | `sheet 'XXX' already exists` | 目标文档中已有同名 sheet(上次失败残留) | 用户删除残留 sheet 后重试 |
417
- | `70000037` | `CSV cell contains binary data` | CSV 单元格含二进制控制字符 | 用户用 Excel 打开后另存为 xlsx 重新导入 |
418
-
419
- ### xlsx 链路(errorCode 3xxxx,来自 Rust gRPC)
420
-
421
- | errorCode | errMsg 特征 | 根因 | 建议 |
422
- |---|---|---|---|
423
- | `30019` | `read attribute 'r' error, value is '0'` | xlsx 中存在行号为 0 的非法行 | Excel/WPS 打开后另存 |
424
- | `30014` | `XMLDataIllegalError` | xlsx XML 数据不合法,文件可能损坏 | Excel/WPS 修复后重新导入 |
425
- | `30001` | `ZipError` | zip 解压失败,文件损坏或上传不完整 | 重新上传 |
426
- | `30002` | `FileEncryptedError` | 文件有密码保护 | 移除密码后重新导入 |
427
- | `30013` | `FileDataEmptyError` | 文件为空 | 确认文件内容 |
428
- | `30025` | `FileTypeError` | 非标准 xlsx 格式 | 确认文件格式 |
429
-
430
- ## 注意事项
431
-
432
- - solution 层日志存在**双写**(两个路径同时采集),计数需用 `count(distinct traceId)` 去重
433
- - converter-notable 的 ERROR 日志**几乎都会截断**,`truncated=true` 时**必须**用 `get_sls_log_detail` 获取完整堆栈
434
- - `message` 字段在 notable-fc 不是索引列,无法在 `|` 右侧用 `regexp_extract`,需用全文检索(`|` 左侧)过滤
435
- - traceId 在不同服务中字段名可能是 `traceId` 或 `traceid`(大小写不一致),查询时用关键词搜索
436
- - 预发环境(`user_defined_id=lippi-doc-solution_pre`)和 生产环境(`_prod`)的失败要分开分析
437
- - 如果 converter 层查不到日志,可能是日志已过期(默认保留 30 天),或 jobId 不对
438
- - 导入 OpenAPI 的 4 个方法:`getImportEncryptPublicKey`、`prepareImportUpload`、`executeImport`、`queryImportStatus`
439
-
440
- ### 各入口标识符的坑(验证结论)
441
-
442
- **traceId 入口**:
443
- - **traceId 跨 MQ 断链**:solution 层的 traceId 是 `queryImportStatus` 请求的(Client 轮询时产生),converter 层的 traceId 是 `executeImport` 请求的(触发转换时产生),**两者不同**
444
- - 不能用 solution 层的 traceId 直接搜 converter 层,必须先从 solution 层提取 jobId,再用 jobId 搜 converter
445
- - 从 solution 层提取 jobId 的方式:搜 traceId → 找到 `HSF-CLIENT-RESPONSE` 日志 → 从 response JSON 中提取 `dataJobId`
446
-
447
- **importId 入口**:
448
- - solution 层全文检索 importId **可以命中**(importId 出现在 prepareImportUpload / executeImport / queryImportStatus 三个阶段的日志中)
449
- - 从 `queryImportStatus` 的 IMPORT_FAILED 日志中提取 `dataJobId` → 下钻 converter 层
450
-
451
- **docId 入口**:
452
- - converter 层用 docId 搜索 **30 天范围容易超时**(SLS MCP HSF 超时),应缩小到 **7 天**
453
- - notable 层的 `ImportSessionServiceImpl` 和 `ImportApiServiceImpl` 日志中 **`docId` 字段为空**(`docId:""`),用 docId 搜不到 notable 层日志
454
- - solution 层不会直接出现 docId(solution 层用的是 baseId/dentryUuid)
455
- - docId 入口的正确路径:converter 层搜 docId → 提取 jobId → 用 jobId 反查 solution 层和 notable 层
456
-
457
- **converter 层 errorCode**:
458
- - `errorCode` 在 converter 的 `SERVICE_DETAIL_LOGGER` 日志中不是独立索引列,不能在 `|` 右侧直接引用
459
- - 正确做法:用全文检索 `errorCode=80000001` 在 `|` 左侧过滤