{"record":{"id":"faf1ab8a1f52117a","repo":"badges/shields","slug":"invalid-config-yml","errorCode":null,"errorMessage":"invalid config.yml","messagePattern":"invalid config\\.yml","errorType":"exception","errorClass":"InvalidResponse","httpStatus":424,"severity":"error","filePath":"services/conan/conan-version-helpers.js","lineNumber":11,"sourceCode":"import * as yaml from 'js-yaml'\nimport { NotFound, InvalidResponse } from '../index.js'\nimport { latest } from '../version.js'\n\nexport function parseLatestVersionFromConfig(configYaml) {\n  let versions\n  try {\n    const config = yaml.load(configYaml)\n    versions = Object.keys(config.versions)\n  } catch (err) {\n    throw new InvalidResponse({\n      prettyMessage: 'invalid config.yml',\n      underlyingError: err,\n    })\n  }\n  const version = latest(versions)\n  if (version == null) {\n    throw new NotFound({ prettyMessage: 'no versions found' })\n  }\n  return version\n}\n","sourceCodeStart":1,"sourceCodeEnd":22,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/conan/conan-version-helpers.js#L1-L22","documentation":"Conan's config.yml parsing helper throws InvalidResponse with 'invalid config.yml' when yaml.load fails on the fetched config.yml content. This indicates the recipe repository's config.yml could not be parsed as valid YAML or lacked a versions mapping.","triggerScenarios":"Calling parseLatestVersionFromConfig with a configYaml string that is not valid YAML, is empty (e.g. 404 page HTML or empty file), or has no `versions` key (accessing config.versions throws).","commonSituations":"Remote recipe repository moved or removed so the fetch returned HTML/error text, malformed hand-edited config.yml, or upstream repo renames on GitHub/Bincrafters/ConanCenter.","solutions":["Open the recipe repository's config.yml in a browser and confirm it is valid YAML with a top-level `versions` key","Validate the YAML locally (e.g. with a YAML linter) to find the syntax error","Confirm the recipe repo URL used by the badge still exists and was not renamed/moved","Retry if the fetch was transiently truncated or an upstream outage returned garbage"],"exampleFix":"// config.yml before (broken indentation)\nversions:\n1.2.0:\n  folder: all\n// after\nversions:\n  \"1.2.0\":\n    folder: all","handlingStrategy":"try-catch","validationCode":"const yaml = require('js-yaml');\nfunction isValidConfigYml(text) {\n  try { const c = yaml.load(text); return c != null && typeof c.versions === 'object'; }\n  catch { return false; }\n}","typeGuard":"function isParsedConfig(c) { return c != null && typeof c === 'object' && c.versions != null && typeof c.versions === 'object'; }","tryCatchPattern":"try {\n  const version = await fetchConanLatestVersion(repoUrl);\n} catch (e) {\n  if (e.message.includes('invalid config.yml')) console.warn('config.yml at recipe repo is not valid YAML — inspect upstream');\n  else throw e;\n}","preventionTips":["Validate the recipe repo's config.yml with a YAML linter","Confirm the recipe repository URL has not been renamed or moved","Check that the fetch returned YAML, not an HTML 404 page","Pin/tag the recipe repo reference if possible"],"tags":["yaml","parse-error","conan","invalid-response"],"backgroundTag":"invalid-config-file","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}