【Atlas】Atlas 搜索时报 `__AtlasUserProfile` 不存在导致事务回滚

一、问题背景

在 Atlas 正常启动、Solr 索引健康的情况下,访问 Web UI 的 搜索页面,控制台请求不断触发,但后台日志中持续出现图事务回滚异常。

页面访问地址如下:

bash 复制代码
http://dev2:21005/n/index.html#!/search/searchResult?searchType=basic&type=_ALL_ENTITY_TYPES

现象概述

  • Atlas UI 可以正常打开
  • 搜索页面可进入,但请求过程中伴随后台 ERROR
  • Solr Index 显示为 isHealthy=true

二、Atlas 启动阶段状态确认

从启动日志前半段可以看到,Atlas 的基础组件初始化均未出现异常。

bash 复制代码
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

索引健康检查线程也持续输出正常状态:

bash 复制代码
2026-01-25 11:42:52,877 [index-health-monitor] INFO indexBackEnd=solr; isHealthy=true

结论

Atlas Server 本身是完整启动状态,问题并非出现在启动阶段。

三、关键异常:__AtlasUserProfile 实体不存在

在用户进行搜索、词条、指标等 UI 操作时,后台日志中开始反复出现如下错误:

bash 复制代码
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

该异常具有几个显著特征:

异常特征

  • 发生在 GraphTransactionInterceptor
  • 明确触发 graph rollback
  • 指向内部系统实体 __AtlasUserProfile
  • 缺失的唯一属性:name=admin

这意味着:
Atlas 在处理某些请求时,假定 admin 用户的 Profile 实体一定存在,但当前图数据库中并没有该节点。

四、__AtlasUserProfile 的内部作用

__AtlasUserProfile 是 Atlas 内部使用的系统实体,并不会在 UI 中显式展示,但它被广泛用于:

  • 搜索行为关联
  • 用户操作上下文
  • 某些指标与审计逻辑

行为说明

当 Atlas 接收到搜索、快速搜索、建议(suggestions)等请求时,

会尝试通过当前用户(如 admin)加载对应的 __AtlasUserProfile

如果该实体不存在,就会导致 事务直接回滚,但 UI 层往往不会立即报错,只表现为"功能异常"或日志刷错。


处理办法可参考
22211:解决办法


八、补充异常:审计写入阶段 NoSuchMethodError

在问题修复后,又观察到审计线程出现新的异常:

bash 复制代码
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

该异常发生在 Ranger Audit → HDFS Audit 写入路径中。

根因提示

Atlas WebApp 中引入的 hbase-shaded-client-2.5.3-hadoop3.jar

与 Hadoop 3.3.x 的 FsTracer API 版本不兼容。

九、临时规避方式

在 Atlas Web 目录中移除冲突 Jar:

bash 复制代码
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

注意

这是规避方案,非最终解决方案,适用于定位和验证阶段。

相关推荐
码路飞几秒前
315 曝光 AI 投毒产业链,我写了个 Python 脚本检测 AI 回答有没有「中毒」
python·aigc
q_35488851534 分钟前
计算机毕业设计源码:锦江酒店大数据分析与个性化推荐系统 Django框架 Vue 可视化 Hadoop 爬虫 协同过滤推荐算法 民宿 客栈(建议收藏)✅
python·机器学习·信息可视化·数据分析·django·课程设计·旅游
sg_knight12 分钟前
设计模式实战:代理模式(Proxy)
python·设计模式·代理模式·proxy
xixihaha132415 分钟前
实战:用OpenCV和Python进行人脸识别
jvm·数据库·python
badhope15 分钟前
Python 库全景图:核心工具与最佳实践(小白也能看懂版)
后端·python
m0_6625779720 分钟前
C++中的享元模式实战
开发语言·c++·算法
带娃的IT创业者21 分钟前
WeClaw WebSocket 路由实战:BridgeConnectionManager 如何用四层映射在 800 个连接中实现毫秒级消息转发?
网络·python·websocket·网络协议·fastapi·实时通信
一直学习的程序小白22 分钟前
java进阶-优化GC垃圾回收机制
java·开发语言·jvm
Storynone25 分钟前
【Day】LeetCode:134. 加油站,135. 分发糖果,860. 柠檬水找零,406. 根据身高重建队列
python·算法·leetcode
阿_旭35 分钟前
基于YOLO26深度学习的茶叶病害智能检测识别系统【python源码+Pyqt5界面+数据集+训练代码】
人工智能·python·深度学习·茶叶病害检测