[22211]解决办法
# Atlas 搜索时报 __AtlasUserProfile 不存在导致事务回滚
# 一、问题背景 Atlas 搜索异常
在 Atlas 正常启动、Solr 索引健康的情况下,访问 Web UI 的 搜索页面,控制台请求不断触发,但后台日志中持续出现图事务回滚异常。
页面访问地址如下:
http://dev2:21005/n/index.html#!/search/searchResult?searchType=basic&type=_ALL_ENTITY_TYPES

现象概述
- Atlas UI 可以正常打开
- 搜索页面可进入,但请求过程中伴随后台 ERROR
- Solr Index 显示为
isHealthy=true
# 二、Atlas 启动阶段状态确认 启动正常
从启动日志前半段可以看到,Atlas 的基础组件初始化均未出现异常。
2026-01-25 11:42:24,155 [main] INFO [AtlasCSRFPreventionFilter.java:102] Adding cross-site request forgery (CSRF) protection
2026-01-25 11:42:24,743 [main] INFO [AtlasJsonProvider.java:53] AtlasJsonProvider() instantiated
2026-01-25 11:42:25,746 [main] WARN [AtlasAuditReductionService.java:336] Audit aging is not enabled
2026-01-25 11:42:25,772 [main] INFO [AuditFilter.java:64] AuditFilter initialization started
2026-01-25 11:42:25,772 [main] INFO [AuditFilter.java:69] REST_API_ENABLE_DELETE_TYPE_OVERRIDE=false
2026-01-25 11:42:26,593 [main] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.repository.store.graph.v2.AtlasEntityStoreV2.createOrUpdate
2026-01-25 11:42:52,877 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:42:52,884 [index-health-monitor] WARN [IndexRecoveryService.java:354] Vertex passed is NULL: Returned is startTime by TTL 2026-01-15T03:42:52.884Z
2026-01-25 11:42:52,895 [index-health-monitor] INFO [AtlasJanusGraphManagement.java:462] Index Recovery: Stats: Success:0: Failed: 0
2026-01-25 11:42:52,895 [index-health-monitor] INFO [IndexRecoveryService.java:245] Index Recovery: Started! Recovery time: 2026-01-15T03:42:52.884Z
2026-01-25 11:42:53,225 [etp1355457888-232 - e7e6d9cb-7a27-4dcc-896c-c8285a618f90] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.services.MetricsService.getMetrics
2026-01-25 11:42:53,518 [etp1355457888-218 - bceb2561-2ea2-46a4-9c6e-29ff2c5e95b6] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.glossary.GlossaryService.getGlossaries
2026-01-25 11:42:53,539 [etp1355457888-215 - 06824fa0-f1a0-418c-bbe0-7d7218825aaf] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.repository.store.graph.v2.AtlasEntityStoreV2.getByUniqueAttributes
2026-01-25 11:42:53,545 [etp1355457888-215 - 06824fa0-f1a0-418c-bbe0-7d7218825aaf] ERROR [GraphTransactionInterceptor.java:202] graph rollback due to exception AtlasBaseException:Instance __AtlasUserProfile with unique attribute {name=admin} does not exist
2026-01-25 11:43:02,713 [etp1355457888-207 - 7ce9e3f0-6847-4a64-9f47-b76c08de10ae] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.discovery.EntityDiscoveryService.searchWithParameters
2026-01-25 11:43:05,392 [etp1355457888-231 - 3c644c4f-3dcd-48f7-bc5a-f8ef81ecd011] WARN [StandardJanusGraphTx.java:1484] Query requires iterating over all vertices [(__traitNames <> null AND __state = ACTIVE)]. For better performance, use indexes
2026-01-25 11:43:05,903 [etp1355457888-231 - 3c644c4f-3dcd-48f7-bc5a-f8ef81ecd011] WARN [StandardJanusGraphTx.java:1484] Query requires iterating over all vertices [(__propagatedTraitNames <> null AND __state = ACTIVE)]. For better performance, use indexes
2026-01-25 11:43:05,986 [etp1355457888-231 - 3c644c4f-3dcd-48f7-bc5a-f8ef81ecd011] WARN [StandardJanusGraphTx.java:1484] Query requires iterating over all vertices [(__traitNames <> null AND __state = ACTIVE)]. For better performance, use indexes
2026-01-25 11:43:06,060 [etp1355457888-231 - 3c644c4f-3dcd-48f7-bc5a-f8ef81ecd011] WARN [StandardJanusGraphTx.java:1484] Query requires iterating over all vertices [(__propagatedTraitNames <> null AND __state = ACTIVE)]. For better performance, use indexes
2026-01-25 11:43:06,907 [Thread-31] WARN [Login.java:197] TGT renewal thread has been interrupted and will exit.
2026-01-25 11:43:20,320 [Thread-44] WARN [Login.java:197] TGT renewal thread has been interrupted and will exit.
2026-01-25 11:43:22,902 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:43:52,905 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:44:22,910 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:44:35,328 [etp1355457888-231 - 6d221a94-6151-4020-911a-3529b2fd24f8] ERROR [GraphTransactionInterceptor.java:202] graph rollback due to exception AtlasBaseException:Instance __AtlasUserProfile with unique attribute {name=admin} does not exist
2026-01-25 11:44:52,914 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:44:53,668 [etp1355457888-29 - 677179b4-7fdc-4b00-9407-1eca4632244c] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.discovery.EntityDiscoveryService.quickSearch
2026-01-25 11:44:53,672 [etp1355457888-30 - 51242efa-3937-49bc-bab9-01efef319dbd] INFO [GraphTransactionAdvisor.java:41] GraphTransaction intercept for org.apache.atlas.discovery.EntityDiscoveryService.getSuggestions
2026-01-25 11:44:53,676 [etp1355457888-29 - 677179b4-7fdc-4b00-9407-1eca4632244c] WARN [IndexSerializer.java:440] Could not convert given VERTEX index query: [a*]
2026-01-25 11:44:53,740 [etp1355457888-29 - 677179b4-7fdc-4b00-9407-1eca4632244c] WARN [IndexSerializer.java:440] Could not convert given VERTEX index query: [a*]
2026-01-25 11:44:55,041 [etp1355457888-24 - 780af814-a29b-489c-8641-0dcf9ed3da36] WARN [IndexSerializer.java:440] Could not convert given VERTEX index query: [aa*]
2026-01-25 11:44:55,051 [etp1355457888-24 - 780af814-a29b-489c-8641-0dcf9ed3da36] WARN [IndexSerializer.java:440] Could not convert given VERTEX index query: [aa*]
2026-01-25 11:45:22,919 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 11:45:52,923 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
索引健康检查线程也持续输出正常状态:
2026-01-25 11:42:52,877 [index-health-monitor] INFO indexBackEnd=solr; isHealthy=true
结论
Atlas Server 本身是完整启动状态,问题并非出现在启动阶段。
# 三、关键异常:__AtlasUserProfile 实体不存在 事务回滚
在用户进行搜索、词条、指标等 UI 操作时,后台日志中开始反复出现如下错误:
2026-01-25 11:42:53,545 [etp...] ERROR [GraphTransactionInterceptor.java:202]
graph rollback due to exception
AtlasBaseException: Instance __AtlasUserProfile with unique attribute {name=admin} does not exist
2
3
该异常具有几个显著特征:
异常特征
- 发生在 GraphTransactionInterceptor
- 明确触发 graph rollback
- 指向内部系统实体
__AtlasUserProfile - 缺失的唯一属性:
name=admin
这意味着: Atlas 在处理某些请求时,假定 admin 用户的 Profile 实体一定存在,但当前图数据库中并没有该节点。
# 四、__AtlasUserProfile 的内部作用 内部系统实体
__AtlasUserProfile 是 Atlas 内部使用的系统实体,并不会在 UI 中显式展示,但它被广泛用于:
- 搜索行为关联
- 用户操作上下文
- 某些指标与审计逻辑
行为说明
当 Atlas 接收到搜索、快速搜索、建议(suggestions)等请求时,
会尝试通过当前用户(如 admin)加载对应的 __AtlasUserProfile。
如果该实体不存在,就会导致 事务直接回滚,但 UI 层往往不会立即报错,只表现为“功能异常”或日志刷错。
# 五、通过 REST API 验证实体是否存在 直接验证
首先使用 Atlas REST API 查询 admin 对应的 Profile:
curl --negotiate -u : -s \
"http://dev2:21005/api/atlas/v2/entity/uniqueAttribute/type/__AtlasUserProfile?attr:name=admin"
2
返回结果为空,说明实体确实不存在。
风险说明
Atlas 不会自动补齐该实体,一旦缺失,只能通过 API 手动创建。
# 六、手动创建 __AtlasUserProfile 实体 修复操作
通过 POST 接口补齐 admin 的 Profile:
curl --negotiate -u : -s -H "Content-Type: application/json" \
-X POST "http://dev2:21005/api/atlas/v2/entity" \
-d '{
"entity": {
"typeName": "__AtlasUserProfile",
"attributes": {
"name": "admin"
}
}
}'
2
3
4
5
6
7
8
9
10
成功返回如下结果:
[root@dev2 conf]# curl --negotiate -u : -s -H "Content-Type: application/json" \
> -X POST "http://dev2:21005/api/atlas/v2/entity" \
> -d '{
> "entity": {
> "typeName": "__AtlasUserProfile",
> "attributes": {
> "name": "admin"
> }
> }
> }'
{"mutatedEntities":{"CREATE":[{"typeName":"__AtlasUserProfile","attributes":{"name":"admin"},"guid":"496544d8-01c8-466f-8225-f57ad2b571c7","status":"ACTIVE","displayText":"admin","classificationNames":[],"classifications":[],"meaningNames":[],"meanings":[],"isIncomplete":false,"labels":[]}]},"guidAssignments":{"-3354708124540954":"496544d8-01c8-466f-8225-f57ad2b571c7"}}[root@dev2 conf]#
[root@dev2 conf]#
2
3
4
5
6
7
8
9
10
11
12
13
操作结果
admin 对应的内部用户 Profile 已成功写入图数据库。
# 七、修复后的行为变化 问题消失
完成实体补齐后:
- 搜索页面请求不再触发
GraphTransactionInterceptor回滚 __AtlasUserProfile does not exist错误彻底消失- 搜索、建议、快速搜索恢复正常


# 八、补充异常:审计写入阶段 NoSuchMethodError 二次异常
在问题修复后,又观察到审计线程出现新的异常:
2026-01-25 13:11:14,694 [atlas.async.multi_dest.batch_atlas.async.multi_dest.batch.hdfs_destWriter] ERROR [AuditFileSpool.java:709] Error sending logs to consumer. provider=atlas.async.multi_dest.batch, consumer=atlas.async.multi_dest.batch.hdfs
2026-01-25 13:11:18,569 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 13:11:48,573 [index-health-monitor] INFO [AtlasJanusGraphIndexClient.java:98] indexBackEnd=solr; isHealthy=true
2026-01-25 13:12:14,706 [atlas.async.multi_dest.batch_atlas.async.multi_dest.batch.hdfs_destWriter] ERROR [BaseAuditHandler.java:355] Error writing to log file.
java.lang.NoSuchMethodError: org.apache.hadoop.fs.FsTracer.get(Lorg/apache/hadoop/conf/Configuration;)Lorg/apache/hadoop/tracing/Tracer;
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:323)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:308)
at org.apache.hadoop.hdfs.DistributedFileSystem.initDFSClient(DistributedFileSystem.java:202)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:187)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3375)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:125)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3424)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3392)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:485)
at org.apache.ranger.audit.utils.AbstractRangerAuditWriter.createFileSystemFolders(AbstractRangerAuditWriter.java:96)
at org.apache.ranger.audit.utils.AbstractRangerAuditWriter.createWriter(AbstractRangerAuditWriter.java:267)
at org.apache.ranger.audit.utils.RangerJSONAuditWriter.getLogFileStream(RangerJSONAuditWriter.java:171)
at org.apache.ranger.audit.utils.RangerJSONAuditWriter$1.run(RangerJSONAuditWriter.java:101)
at org.apache.ranger.audit.utils.RangerJSONAuditWriter$1.run(RangerJSONAuditWriter.java:98)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
at org.apache.ranger.audit.provider.MiscUtil.executePrivilegedAction(MiscUtil.java:544)
at org.apache.ranger.audit.utils.RangerJSONAuditWriter.logJSON(RangerJSONAuditWriter.java:98)
at org.apache.ranger.audit.utils.RangerJSONAuditWriter.log(RangerJSONAuditWriter.java:137)
at org.apache.ranger.audit.destination.HDFSAuditDestination.logJSON(HDFSAuditDestination.java:79)
at org.apache.ranger.audit.queue.AuditFileSpool.sendEvent(AuditFileSpool.java:880)
at org.apache.ranger.audit.queue.AuditFileSpool.runLogAudit(AuditFileSpool.java:827)
at org.apache.ranger.audit.queue.AuditFileSpool.run(AuditFileSpool.java:757)
at java.lang.Thread.run(Thread.java:748)
2026-01-25 13:12:14,706 [atlas.async.multi_dest.batch_atlas.async.multi_dest.batch.hdfs_destWriter] ERROR [AuditFileSpool.java:709] Error sending logs to consumer. provider=atlas.async.multi_dest.batch, consumer=atlas.async.multi_dest.batch.hdfs
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
该异常发生在 Ranger Audit → HDFS Audit 写入路径中。
根因提示
Atlas WebApp 中引入的 hbase-shaded-client-2.5.3-hadoop3.jar
与 Hadoop 3.3.x 的 FsTracer API 版本不兼容。
# 九、临时规避方式 环境冲突规避
在 Atlas Web 目录中移除冲突 Jar:
cd /usr/bigtop/current/atlas-server/server/webapp/atlas/WEB-INF/lib
mv hbase-shaded-client-2.5.3-hadoop3.jar \
zzzz-hbase-shaded-client-2.5.3-hadoop3.jar
2
3
4

注意
这是规避方案,非最终解决方案,适用于定位和验证阶段。
- 01
- Ambari-Web-3.0.0本地启动与二开环境搭建01-28
- 02
- 左侧 Service 数量控制原理与实现01-28
- 03
- [22212]Ambari 3.0.0 左侧服务菜单滚动条缺失修复01-28