{"record":{"id":"43e76149596e0115","repo":"dotnet/runtime","slug":"not-present-at","errorCode":null,"errorMessage":"{} not present at {}","messagePattern":"(.+?) not present at (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/fuzzer_setup.py","lineNumber":149,"sourceCode":"                run_command(\n                    [\"git\", \"clone\", \"--quiet\", \"--no-checkout\", \"--filter=blob:none\",\n                     \"--depth\", \"1\", \"--sparse\", repo_url, tool_code_directory])\n                with ChangeDir(tool_code_directory):\n                    run_command([\"git\", \"sparse-checkout\", \"set\", \"--cone\", sparse_path])\n                    run_command([\"git\", \"checkout\"])\n\n            publish_dir = path.join(tool_code_directory, \"publish\")\n\n            # build the tool\n            with ChangeDir(tool_code_directory):\n                dotnet_cmd = os.path.join(source_directory, \"dotnet.cmd\")\n                if not is_windows:\n                    dotnet_cmd = os.path.join(source_directory, \"dotnet.sh\")\n                run_command([dotnet_cmd, \"publish\", proj_path.replace(\"/\", os.sep), \"-c\", \"Release\", \"--self-contained\", \"-r\", run_configuration, \"-o\", publish_dir], _exit_on_fail=True)\n\n            dll_name = coreclr_args.tool_name + \".dll\"\n            if not os.path.exists(path.join(publish_dir, dll_name)):\n                raise FileNotFoundError(\"{} not present at {}\".format(dll_name, publish_dir))\n\n            # copy tool\n            print('Copying {} -> {}'.format(publish_dir, dst_directory))\n            copy_directory(publish_dir, dst_directory, verbose_output=True, match_func=acceptable_copy)\n    except PermissionError as pe:\n        print(\"Skipping file. Got error: %s\", pe)\n\n    # create a dummy file in the work_item directories, otherwise Helix complains\n    workitem_directory = path.join(source_directory, \"workitem\")\n    os.mkdir(workitem_directory)\n    foo_txt = os.path.join(workitem_directory, \"foo.txt\")\n    with open(foo_txt, \"w\") as foo_txt_file:\n        foo_txt_file.write(\"hello world!\")\n\n    # Set variables\n    print('Setting pipeline variables:')\n    set_pipeline_variable(\"CorrelationPayloadDirectory\", correlation_payload_directory)\n    set_pipeline_variable(\"WorkItemDirectory\", workitem_directory)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/fuzzer_setup.py#L131-L167","documentation":"Raised by fuzzer_setup.py after running 'dotnet publish' on the Antigen or Fuzzlyn tool project. It checks whether the expected output DLL (Antigen.dll or Fuzzlyn.dll) exists in the publish directory. If the publish step failed silently or produced output with a different name, this error fires.","triggerScenarios":"Triggered at line 148-149 when os.path.exists(path.join(publish_dir, dll_name)) returns False after the 'dotnet publish' command completed. The dll_name is constructed as coreclr_args.tool_name + '.dll'. This happens when dotnet publish fails without raising (run_command uses _exit_on_fail=True so it should exit, but a race or partial publish could leave the DLL missing), or when the project's AssemblyName differs from the project/tool name.","commonSituations":"The dotnet SDK version is incompatible with the tool's project file, causing publish to produce incomplete output. The tool repository (jitutils for Antigen, Fuzzlyn repo) was cloned at a commit where the project structure changed. The run configuration (e.g., 'linux-x64') doesn't match any RID the project targets. Network issues during restore prevent assemblies from being built.","solutions":["Manually run 'dotnet publish <proj_path> -c Release --self-contained -r <RID> -o <publish_dir>' and inspect for errors.","Check that the dotnet SDK version in dotnet.sh/dotnet.cmd is compatible with the tool project's target framework.","Verify the cloned repository is at a compatible commit and the .csproj AssemblyName matches the expected tool_name.","Ensure the run configuration string (os_name-arch_name, e.g., 'linux-x64') is a valid RID.","Inspect the publish directory contents to see what was actually produced."],"exampleFix":"# before\ndll_name = coreclr_args.tool_name + \".dll\"\nif not os.path.exists(path.join(publish_dir, dll_name)):\n    raise FileNotFoundError(\"{} not present at {}\".format(dll_name, publish_dir))\n\n# after - list publish dir contents in error to aid debugging\ndll_name = coreclr_args.tool_name + \".dll\"\nif not os.path.exists(path.join(publish_dir, dll_name)):\n    published = os.listdir(publish_dir) if os.path.isdir(publish_dir) else []\n    raise FileNotFoundError(\n        \"{} not present at {}. Publish dir contents: {}\".format(\n            dll_name, publish_dir, published))","handlingStrategy":"validation","validationCode":"import os\n\ndef validate_publish_output(publish_dir: str, tool_name: str) -> bool:\n    \"\"\"Check that dotnet publish produced the expected DLL.\"\"\"\n    dll_name = tool_name + \".dll\"\n    dll_path = os.path.join(publish_dir, dll_name)\n    if not os.path.exists(dll_path):\n        # List what was actually produced for diagnosis\n        if os.path.isdir(publish_dir):\n            contents = os.listdir(publish_dir)\n            dll_files = [f for f in contents if f.endswith('.dll')]\n            print(f\"Expected {dll_name} but found DLLs: {dll_files}\")\n        return False\n    return True","typeGuard":"null","tryCatchPattern":"# run_command with _exit_on_fail=True should prevent reaching this check\n# on publish failure, but as a safety net:\ntry:\n    if not validate_publish_output(publish_dir, coreclr_args.tool_name):\n        raise FileNotFoundError(\n            f\"{coreclr_args.tool_name}.dll not in {publish_dir}. \"\n            f\"Check dotnet publish output for errors.\")\nexcept FileNotFoundError:\n    raise","preventionTips":["Check dotnet publish exit code and stderr output before checking for the DLL.","Verify the dotnet SDK version matches the tool project's requirements.","Ensure the RID (run configuration) is valid for the project.","Clone the tool repo at a known-good commit.","Inspect AssemblyName in the .csproj — it must match the tool_name."],"tags":["dotnet","fuzzer","build","publish","coreclr"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}