apache/hadoop · error · RuntimeException
Invalid metadata: #files ({}), total_size ({}), filelisturi
Error message
Invalid metadata: #files ({}), total_size ({}), filelisturi ({}) What it means
Error "Invalid metadata: #files ({}), total_size ({}), filelisturi ({})" thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java:203
// Split the special file that contains the list of distributed cache file
// paths and their file sizes such that each split corresponds to
// approximately same amount of distributed cache data to be generated.
// Consider numTaskTrackers * numMapSlotsPerTracker as the number of maps
// for this job, if there is lot of data to be generated.
@Override
public List<InputSplit> getSplits(JobContext jobCtxt) throws IOException {
final JobConf jobConf = new JobConf(jobCtxt.getConfiguration());
final JobClient client = new JobClient(jobConf);
ClusterStatus stat = client.getClusterStatus(true);
int numTrackers = stat.getTaskTrackers();
final int fileCount = jobConf.getInt(GRIDMIX_DISTCACHE_FILE_COUNT, -1);
// Total size of distributed cache files to be generated
final long totalSize = jobConf.getLong(GRIDMIX_DISTCACHE_BYTE_COUNT, -1);
// Get the path of the special file
String distCacheFileList = jobConf.get(GRIDMIX_DISTCACHE_FILE_LIST);
if (fileCount < 0 || totalSize < 0 || distCacheFileList == null) {
throw new RuntimeException("Invalid metadata: #files (" + fileCount
+ "), total_size (" + totalSize + "), filelisturi ("
+ distCacheFileList + ")");
}
Path sequenceFile = new Path(distCacheFileList);
FileSystem fs = sequenceFile.getFileSystem(jobConf);
FileStatus srcst = fs.getFileStatus(sequenceFile);
// Consider the number of TTs * mapSlotsPerTracker as number of mappers.
int numMapSlotsPerTracker = jobConf.getInt(TTConfig.TT_MAP_SLOTS, 2);
int numSplits = numTrackers * numMapSlotsPerTracker;
List<InputSplit> splits = new ArrayList<InputSplit>(numSplits);
LongWritable key = new LongWritable();
BytesWritable value = new BytesWritable();
// Average size of data to be generated by each map task
final long targetSize = Math.max(totalSize / numSplits,
DistributedCacheEmulator.AVG_BYTES_PER_MAP);View on GitHub (pinned to 2add963021)
Solutions
- Provide consistent distcache metadata: valid file count, total size, and a file list URI.
When it happens
Trigger: The distributed-cache generation metadata (number of files, total size, or file list URI) passed to Gridmix GenerateDistCacheData is invalid or incomplete.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/490ee44e005caf5e.
Report an issue: GitHub.