{"record":{"id":"c782a0dd5cce1f3a","repo":"laurent22/joplin","slug":"cannot-find-s-c782a0","errorCode":null,"errorMessage":"Cannot find \"%s\".","messagePattern":"Cannot find \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-cli/app/command-geoloc.ts","lineNumber":20,"sourceCode":"import app from './app';\nimport { _ } from '@joplin/lib/locale';\nimport { ModelType } from '@joplin/lib/BaseModel';\nimport Note from '@joplin/lib/models/Note';\n\nclass Command extends BaseCommand {\n\tpublic override usage() {\n\t\treturn 'geoloc <note>';\n\t}\n\n\tpublic override description() {\n\t\treturn _('Displays a geolocation URL for the note.');\n\t}\n\n\tpublic override async action(args: { note: string }) {\n\t\tconst title = args['note'];\n\n\t\tconst item = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });\n\t\tif (!item) throw new Error(_('Cannot find \"%s\".', title));\n\t\tconst url = Note.geolocationUrl(item);\n\t\tthis.stdout(url);\n\n\t\tapp()\n\t\t\t.gui()\n\t\t\t.showConsole();\n\t}\n}\n\nmodule.exports = Command;\n","sourceCodeStart":2,"sourceCodeEnd":31,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/app-cli/app/command-geoloc.ts#L2-L31","documentation":"Thrown by `geoloc <note>` when `app().loadItem(ModelType.Note, title, { parent: app().currentFolder() })` returns null. Like export --note, the lookup is scoped to the current notebook. Note.geolocationUrl requires the note to carry latitude/longitude metadata; the error here fires earlier, before geolocationUrl is reached, so it is purely a lookup failure, not a missing-coordinates problem.","triggerScenarios":"Note title typo; note exists in a different notebook than `currentFolder()`; note was deleted; partial note id <2 chars.","commonSituations":"Running `geoloc` after switching notebooks; referencing a note by a display title that differs from its stored title field.","solutions":["Switch to the notebook containing the note: `joplin use <notebook>`","Use the exact title from `joplin ls` or the full/short note id","Confirm the note actually has geolocation metadata if lookup succeeds but the URL is empty (separate concern)"],"exampleFix":"// before\njoplin geoloc \"Trip\"   // throws if \"Trip\" is not in current notebook\n\n// after\njoplin use Travel\njoplin geoloc Trip\n// or by id:\njoplin geoloc <note-id>","handlingStrategy":"validation","validationCode":"import app from './app';\nimport { ModelType } from '@joplin/lib/BaseModel';\n\nasync function resolveNoteForGeoloc(title: string) {\n  if (!app().currentFolder()) throw new Error('Select a notebook first.');\n  const item = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });\n  if (!item) throw new Error(`Cannot find \"${title}\". Verify with \\`ls\\` or use the note id.`);\n  return item;\n}","typeGuard":"const isNoteWithGeo = (n: any): n is { id: string; latitude?: number; longitude?: number } =>\n  !!n && typeof n.id === 'string';","tryCatchPattern":null,"preventionTips":["Run `geoloc` from the notebook that contains the note","Use full note ids to avoid title collisions and current-notebook scoping","Confirm the note actually carries geo metadata if you need a non-empty URL"],"tags":["cli","geolocation","note-lookup","validation"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}