EllanJiang/GameFramework · error · GameFrameworkException
Data node is not exist, path
Error message
Data node is not exist, path '{0}', node '{1}'. What it means
DataNodeManager.GetData<T> throws this GameFrameworkException when GetNode(path, node) cannot resolve the given path under the given (or root) node, i.e. the resolved data node is null. The message includes both the requested path and the FullName of the starting node (empty string when starting from root). The node exists check happens before any type conversion; type errors on the stored Variable surface separately.
Solutions
- Use dataNodeManager.HasData<T>(path) (or check GetNode result) before calling GetData<T>
- Print/compare node.FullName paths — verify the exact path and start node match the created tree
- Ensure the node subtree is created (GetOrAddNode/SetData) before reading
- Restore or re-create removed nodes, or query the correct root/start node
Example fix
// before
VarInt32 hp = dataNodeManager.GetData<VarInt32>("Player/HP");
// after
if (dataNodeManager.HasData<VarInt32>("Player/HP"))
{
VarInt32 hp = dataNodeManager.GetData<VarInt32>("Player/HP");
}
else
{
VarInt32 hp = new VarInt32(100);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!dataNodeManager.HasData<T>(path))
{
return defaultValue;
} Try / catch
try { return dataNodeManager.GetData<VarInt32>(path); }
catch (GameFrameworkException ex)
{
Log.Warn($"Missing data node: {ex.Message}");
return defaultValue;
} Prevention
- Define node paths as constants shared by writer and reader
- Check HasData before GetData in non-critical paths
- Ensure node trees are created during initialization before readers run
- Log node.FullName on failure to diagnose path mismatches
- Verify removed nodes are not queried after scene transitions
When it happens
Trigger: Calling GetData<T>("a/b/c") where a segment was never created; querying a node that was removed (RemoveNode) or in a different subtree than the provided start node; path typos or case mismatches; calling before the relevant node tree was built during load.
Common situations: Data written under a different prefix (e.g. 'Game/Player/HP' vs 'Player/HP'); paths assembled from variables with an empty segment; a data node removed on scene unload but queried afterwards; save-data migration renaming node paths.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Name of data node is invalid.
- Name is invalid.
- Results is invalid.
- Resource manager is invalid.
- Data provider helper is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/c08835363f744cb9.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/DataNode/DataNodeManager.cs:93
/// <returns>数据结点的数据。</returns>
public Variable GetData(string path)
{
return GetData(path, null);
}
/// <summary>
/// 根据类型获取数据结点的数据。
/// </summary>
/// <typeparam name="T">要获取的数据类型。</typeparam>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>指定类型的数据。</returns>
public T GetData<T>(string path, IDataNode node) where T : Variable
{
IDataNode current = GetNode(path, node);
if (current == null)
{
throw new GameFrameworkException(Utility.Text.Format("Data node is not exist, path '{0}', node '{1}'.", path, node != null ? node.FullName : string.Empty));
}
return current.GetData<T>();
}
/// <summary>
/// 获取数据结点的数据。
/// </summary>
/// <param name="path">相对于 node 的查找路径。</param>
/// <param name="node">查找起始结点。</param>
/// <returns>数据结点的数据。</returns>
public Variable GetData(string path, IDataNode node)
{
IDataNode current = GetNode(path, node);
if (current == null)
{
throw new GameFrameworkException(Utility.Text.Format("Data node is not exist, path '{0}', node '{1}'.", path, node != null ? node.FullName : string.Empty));
}View on GitHub (pinned to d0c010b051)