{"record":{"id":"c21afe14e69a4dc6","repo":"windmill-labs/windmill","slug":"failed-to-get-url-from-git-repo-resource-please-c","errorCode":null,"errorMessage":"Failed to get url from git repo resource, please check that the resource has the correct type (git_repository)","messagePattern":"Failed to get url from git repo resource, please check that the resource has the correct type \\(git_repository\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-worker/src/ansible_executor.rs","lineNumber":1730,"sourceCode":"                    validate_relative_path(&p, \"delegate_to_git_repo.inventories_location\")?;\n                    Ok(p)\n                })\n                .transpose()?;\n\n            let serde_json::Value::Object(git_repo_resource) = client\n                .get_resource_value_interpolated::<serde_json::Value>(\n                    &delegated_git_repo.resource,\n                    Some(job.id.to_string()),\n                )\n                .await?\n            else {\n                return Err(windmill_common::error::Error::BadRequest(\n                    \"Git repository resource is not an object\".to_string(),\n                ));\n            };\n\n            let secret_url = git_repo_resource.get(\"url\").and_then(|s| s.as_str()).map(|s| s.to_string())\n                .ok_or(anyhow!(\"Failed to get url from git repo resource, please check that the resource has the correct type (git_repository)\"))?;\n\n            #[cfg(feature = \"enterprise\")]\n            let is_github_app = git_repo_resource.get(\"is_github_app\").and_then(|s| s.as_bool())\n                .ok_or(anyhow!(\"Failed to get `is_github_app` field from git repo resource, please check that the resource has the correct type (git_repository)\"))?;\n            #[cfg(not(feature = \"enterprise\"))]\n            let is_github_app = false;\n\n            let branch = Some(git_repo_resource.get(\"branch\").and_then(|s| s.as_str()).map(|s| s.to_string())\n                .ok_or(anyhow!(\"Failed to get branch from git repo resource, please check that the resource has the correct type (git_repository)\"))?).filter(|s| !s.is_empty());\n\n            let target_path = DELEGATE_GIT_REPO_TARGET.to_string();\n\n            let repo = GitRepo {\n                url: secret_url,\n                commit: interpolated_commit.clone(),\n                branch,\n                target_path,\n            };","sourceCodeStart":1712,"sourceCodeEnd":1748,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-worker/src/ansible_executor.rs#L1712-L1748","documentation":"handle_ansible_job reads the job's git-repo dependency resource and requires a string `url` field. If the resource object has no `url` string (or the resource isn't a git_repository-shaped object), this error tells the user the resource type/content is wrong.","triggerScenarios":"An ansible job declares a git repo dependency whose bound resource path resolves to an object lacking a `url` string field — e.g. the resource was created with the wrong type or an incomplete JSON payload.","commonSituations":"Resource typed as something other than git_repository; hand-edited resource JSON missing `url`; `url` stored as a non-string (number/null); resource path typo resolving to a different object.","solutions":["Open the resource in the Windmill UI and confirm its type is `git_repository`.","Add/fix the `url` field so it is a string containing the repo URL.","Check the job's dependency settings point at the intended resource path.","Recreate the resource from the git_repository template if the payload is malformed."],"exampleFix":"// resource payload\n// before\n{ \"type\": \"git_repository\", \"branch\": \"main\" }\n// after\n{ \"type\": \"git_repository\", \"url\": \"https://github.com/org/repo.git\", \"branch\": \"main\" }","handlingStrategy":"validation","validationCode":"// validate the resource payload before binding it to a job:\nconst r = /* resource object */;\nif (typeof r !== 'object' || typeof r.url !== 'string' || r.url.length === 0) {\n  throw new Error('resource must be a git_repository with a string url');\n}","typeGuard":"function isGitRepoResource(v: unknown): v is { url: string; [k: string]: unknown } {\n  return typeof v === 'object' && v !== null && typeof (v as any).url === 'string';\n}","tryCatchPattern":"try {\n  const url = gitRepoResource.url;\n} catch (e) {\n  throw new Error('git_repository resource invalid: check type and url field');\n}","preventionTips":["Create resources only through the git_repository resource type in the UI","Never hand-edit resource JSON without validating schema","Double-check the resource path referenced by the job dependency"],"tags":["validation","resources","git"],"backgroundTag":"invalid-resource-shape","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}