{"record":{"id":"7e47890bd845cb33","repo":"aaif-goose/goose","slug":"failed-to-read-the-selected-file","errorCode":null,"errorMessage":"Failed to read the selected file.","messagePattern":"Failed to read the selected file\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/desktop/src/components/schedule/ScheduleModal.tsx","lineNumber":139,"sourceCode":"        setCronExpression('0 0 14 * * *');\n        if (initialDeepLink) {\n          setSourceType('deeplink');\n          handleDeepLinkChange(initialDeepLink);\n        }\n      }\n    }\n  }, [isOpen, schedule, initialDeepLink, handleDeepLinkChange]);\n\n  const handleBrowseFile = async () => {\n    const fileResponse = await window.electron.selectRecipeFile();\n    if (fileResponse) {\n      if (fileResponse.filePath.endsWith('.yaml') || fileResponse.filePath.endsWith('.yml')) {\n        setRecipeSourcePath(fileResponse.filePath);\n        setInternalValidationError(null);\n\n        try {\n          if (!fileResponse.found || fileResponse.error) {\n            throw new Error(intl.formatMessage(i18n.failedReadFile));\n          }\n          const recipe = await parseRecipeFromFile(fileResponse.file);\n          if (!recipe) {\n            throw new Error(intl.formatMessage(i18n.failedParseRecipe));\n          }\n          setParsedRecipe(recipe);\n          if (recipe.title) {\n            setScheduleIdFromTitle(recipe.title);\n          }\n        } catch (e) {\n          setParsedRecipe(null);\n          setInternalValidationError(\n            e instanceof Error ? e.message : intl.formatMessage(i18n.failedParseRecipe)\n          );\n        }\n      } else {\n        setInternalValidationError(intl.formatMessage(i18n.invalidFileType));\n      }","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/ui/desktop/src/components/schedule/ScheduleModal.tsx#L121-L157","documentation":"Shown by the schedule modal in the goose desktop app after the Electron file dialog returns a result. window.electron.selectRecipeFile() resolves with {filePath, found, error, file}; when found is false or error is set, the file at the picked path could not be read back, and the modal surfaces the localized 'Failed to read the selected file.' message as an internal validation error. This is a filesystem-level read failure at the selected path, not a YAML problem.","triggerScenarios":"The picked .yaml/.yml file is deleted or moved between the dialog opening and the read; the file exists but the process lacks read permission; the file lives on disconnected removable storage; the IPC handler returns an error field for any other IO reason.","commonSituations":"Reselecting a path remembered from a previous session after the file moved; files on network mounts or USB drives that went away; permission changes on the file since it was last scheduled.","solutions":["Click Browse again and reselect the file so a fresh read is attempted","Verify the path still exists and is readable (ls -l on the printed recipeSourcePath)","If the error field carries a specific message, address that underlying IO cause (remount storage, fix permissions)","Move the recipe to a stable local location and update the schedule to point there"],"exampleFix":"// before\nif (!fileResponse.found || fileResponse.error) {\n  throw new Error(intl.formatMessage(i18n.failedReadFile));\n}\n\n// after\nif (!fileResponse.found || fileResponse.error) {\n  setParsedRecipe(null);\n  setInternalValidationError(\n    (typeof fileResponse.error === 'string' && fileResponse.error) ||\n      intl.formatMessage(i18n.failedReadFile)\n  );\n  return;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const res = await window.electron.selectRecipeFile();\n  if (!res?.found || res.error) {\n    setParsedRecipe(null);\n    setInternalValidationError(String(res?.error ?? intl.formatMessage(i18n.failedReadFile)));\n    return;\n  }\n  setParsedRecipe(await parseRecipeFromFile(res.file));\n} catch (e) {\n  setParsedRecipe(null);\n  setInternalValidationError(e instanceof Error ? e.message : intl.formatMessage(i18n.failedReadFile));\n}","preventionTips":["Keep scheduled recipe files in a stable local directory","Reselect via Browse after moving or replacing recipe files","Surface the IPC error field verbatim — it usually names the real IO cause"],"tags":["electron","file-io","recipe","ipc","scheduling"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}