{"record":{"id":"7ed24ec97df36b8d","repo":"nodejs/node","slug":"u-illegal-argument-error-7ed24e","errorCode":"U_ILLEGAL_ARGUMENT_ERROR","errorMessage":"pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\\n\\tBad path: '%s'\\n","messagePattern":"pkgdata: Error: absolute path encountered\\. Old style paths are not supported\\. Use relative paths such as 'fur\\.res' or 'translit%cfur\\.res'\\.\\\\n\\\\tBad path: '(.+?)'\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":2130,"sourceCode":"                            *lineNext = 0;\n                            lineNext++;\n                        }\n                    }\n                } else {\n                    lineNext = uprv_strchr(linePtr, ' ');\n                    if(lineNext) {\n                        *lineNext = 0; /* terminate at space */\n                        lineNext++;\n                    }\n                }\n\n                /* add the file */\n                s = const_cast<char*>(getLongPathname(linePtr));\n\n                /* normal mode.. o->files is just the bare list without package names */\n                o->files = pkg_appendToList(o->files, &tail, uprv_strdup(linePtr));\n                if(uprv_pathIsAbsolute(s) || s[0] == '.') {\n                    fprintf(stderr, \"pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\\n\\tBad path: '%s'\\n\", U_FILE_SEP_CHAR, s);\n                    exit(U_ILLEGAL_ARGUMENT_ERROR);\n                }\n                /* The +5 is to add a little extra space for, among other things, PKGDATA_FILE_SEP_STRING */\n                tmpLength = static_cast<int32_t>(uprv_strlen(o->srcDir) + uprv_strlen(s) + 5);\n                if ((tmp = static_cast<char*>(uprv_malloc(tmpLength))) == nullptr) {\n                    fprintf(stderr, \"pkgdata: Error: Unable to allocate tmp buffer size: %d\\n\", tmpLength);\n                    exit(U_MEMORY_ALLOCATION_ERROR);\n                }\n                uprv_strcpy(tmp, o->srcDir);\n                uprv_strcat(tmp, o->srcDir[uprv_strlen(o->srcDir)-1] == U_FILE_SEP_CHAR ? \"\" : PKGDATA_FILE_SEP_STRING);\n                uprv_strcat(tmp, s);\n                o->filePaths = pkg_appendToList(o->filePaths, &tail2, tmp);\n                linePtr = lineNext;\n            } /* for each entry on line */\n        } /* for each line */\n        T_FileStream_close(in);\n    } /* for each file list file */\n}","sourceCodeStart":2112,"sourceCodeEnd":2148,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L2112-L2148","documentation":"A token in the file list is an absolute path (uprv_pathIsAbsolute true) or begins with '.', which pkgdata rejects because it only accepts bare relative names like 'fur.res' or 'translit/fur.res'. The process exits with U_ILLEGAL_ARGUMENT_ERROR. The bad path is printed so it can be found and rewritten.","triggerScenarios":"A file-list entry starting with '/' (POSIX absolute), a drive letter/backslash (Windows absolute), or a leading '.' (./ or ../). The check fires before srcDir is joined, so any leading dir component is forbidden except a subpath with no leading separator.","commonSituations":"Migrating an old-style ICU data file list that used absolute paths; a build system that prepends $(CURDIR)/ to each resource; using ../ to reference sibling build dirs.","solutions":["Strip absolute prefixes and leading './' or '../' from each entry, leaving only the relative tail.","Use the -O srcDir option to supply the base directory instead of embedding it in each path.","Regenerate the list so entries are bare names (e.g. locale.res) or subpaths (translit/de.res).","Audit the file list for any line where the first char is '/', '\\', or '.'."],"exampleFix":"# before: absolute / dot paths\n/usr/share/icu/res/fur.res\n./cur.res\n\n# after: bare relative names; pass base with -O\nfur.res\ncur.res\n# invoke: pkgdata -O /usr/share/icu/res -F list.txt -p mypkg","handlingStrategy":"validation","validationCode":"# Flag any absolute or dot-relative entry; pkgdata wants bare relative names.\nawk '/^\\// || /^\\.\\// || /^\\.\\.\\// || /^[A-Za-z]:[\\\\\\/]/ || /^\\\\/ {\n  printf \"%s:%d absolute/dot path not allowed: %s\\n\", FILENAME, FNR, $0; exit 1\n}' reslist.txt","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use bare relative names (fur.res) or subpaths (translit/de.res) only.","Supply the base directory with the -O srcDir option instead of per-entry paths.","Strip leading '/', './', '../', and drive letters when generating the list.","Audit generated lists for absolute components before packaging."],"tags":["icu","pkgdata","build-tool","input-validation","paths","u-illegal-argument-error"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}