【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

注意

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

相关推荐
apcipot_rain2 小时前
python与人工智能代码基础
人工智能·python·机器学习
devmoon2 小时前
区块链预言机(Oracle)解析:Polkadot、以太坊与 Solana 如何把现实世界带入链上?
开发语言·oracle·区块链·信息与通信·以太坊·polkadot·solana
Lsir10110_2 小时前
【Linux】生产者-消费者模型及条件变量
linux·运维·开发语言·c++
Coding茶水间2 小时前
基于深度学习的鸡数量统计系统演示与介绍(YOLOv12/v11/v8/v5模型+Pyqt5界面+训练代码+数据集)
开发语言·人工智能·深度学习·yolo·目标检测·机器学习
wangbing11252 小时前
开发指南143-扩展类功能
java·开发语言
游乐码2 小时前
c#继承中的构造函数
开发语言·c#
海天一色y2 小时前
用Python和Pygame从零打造植物大战僵尸:完整技术解析
开发语言·python·pygame
嫂子的姐夫2 小时前
029-rs5:欧治
爬虫·python·逆向
tod1132 小时前
C++核心知识点全解析(三)
开发语言·c++·面试经验