{"record":{"id":"062f11fd10de09a3","repo":"theonedev/onedev","slug":"undefined-property-propertyname","errorCode":null,"errorMessage":"Undefined property: ${propertyName}","messagePattern":"Undefined property: (.+?)","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/util/interpolative/JobVariableInterpolator.java","lineNumber":86,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new ExplicitException(\"Undefined param: \" + paramName);\n\t\t\t} else if (t.startsWith(PREFIX_PROPERTY) || t.startsWith(\"properties:\")) {\n\t\t\t\tString propertyName;\n\t\t\t\tif (t.startsWith(PREFIX_PROPERTY))\n\t\t\t\t\tpropertyName = t.substring(PREFIX_PROPERTY.length());\n\t\t\t\telse\n\t\t\t\t\tpropertyName = t.substring(\"properties:\".length());\n\n\t\t\t\tJobProperty property = build.getSpec().getPropertyMap().get(propertyName);\n\t\t\t\tif (property != null) {\n\t\t\t\t\treturn property.getValue();\n\t\t\t\t} else {\n\t\t\t\t\tfor (var projectProperty : build.getProject().getHierarchyJobProperties()) {\n\t\t\t\t\t\tif (projectProperty.getName().equals(propertyName))\n\t\t\t\t\t\t\treturn projectProperty.getValue();\n\t\t\t\t\t}\n\t\t\t\t\tthrow new ExplicitException(\"Undefined property: \" + propertyName);\n\t\t\t\t}\n\t\t\t} else if (t.startsWith(PREFIX_SECRET) || t.startsWith(\"secrets:\")) {\n\t\t\t\tString secretName;\n\t\t\t\tif (t.startsWith(PREFIX_SECRET))\n\t\t\t\t\tsecretName = t.substring(PREFIX_SECRET.length());\n\t\t\t\telse\n\t\t\t\t\tsecretName = t.substring(\"secrets:\".length());\n\t\t\t\treturn build.getJobAuthorizationContext().getSecretValue(secretName);\n\t\t\t} else if (t.startsWith(PREFIX_SCRIPT) || t.startsWith(\"scripts:\")) {\n\t\t\t\tString scriptName;\n\t\t\t\tif (t.startsWith(PREFIX_SCRIPT))\n\t\t\t\t\tscriptName = t.substring(PREFIX_SCRIPT.length());\n\t\t\t\telse\n\t\t\t\t\tscriptName = t.substring(\"scripts:\".length());\n\n\t\t\t\tMap<String, Object> context = new HashMap<>();\n\t\t\t\tcontext.put(\"build\", build);\n\t\t\t\tObject result = GroovyUtils.evalScriptByName(scriptName, context);","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/util/interpolative/JobVariableInterpolator.java#L68-L104","documentation":"JobVariableInterpolator resolves @property:name@ (or 'properties:name') references by first checking the current property values, then walking the project hierarchy's job properties (getHierarchyJobProperties). If no property with that name exists anywhere in the hierarchy, it throws ExplicitException 'Undefined property'. This enforces that only defined project/job properties can be interpolated.","triggerScenarios":"An expression like '@property:myProp@' where no property named 'myProp' is defined on the current job's project or any project in its hierarchy — e.g. the property was deleted, defined on an unrelated project, or misspelled.","commonSituations":"Defining the property on a sibling project instead of an ancestor; deleting a project property still referenced by job configurations; case-sensitivity/typo mismatches in property names; copying job configs between projects that lack the property.","solutions":["Define the property with that exact name on the project (or a parent project) that owns the job.","Fix the property name in the expression to match an existing property definition.","Remove the @property:...@ reference if the property is obsolete.","Verify name and casing against getHierarchyJobProperties (the lookup is exact-match)."],"exampleFix":"// before (property 'registry_url' not defined on this project)\nString expr = \"@property:registry_url@/myapp\";\n// after: add property registry_url on the project, or reference an existing one\nString expr = \"@property:dockerRegistry@/myapp\";","handlingStrategy":"validation","validationCode":"boolean propertyDefined(Project project, String name) {\n    return project.getHierarchyJobProperties().stream()\n        .anyMatch(pp -> pp.getName().equals(name));\n}","typeGuard":null,"tryCatchPattern":"try {\n    value = interpolate(\"@property:foo@\");\n} catch (ExplicitException e) {\n    if (e.getMessage().startsWith(\"Undefined property\")) {\n        value = defaultValue; // or prompt to define the property\n    } else throw e;\n}","preventionTips":["Define required properties on ancestor projects so hierarchy lookup succeeds.","When deleting a property, search job configs for @property:<name>@ references first.","Match property names exactly (case-sensitive)."],"tags":["ci-cd","interpolation","undefined-variable"],"backgroundTag":"resource-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}