laurent22/joplin · error · Error
Cannot find "%s".
Error message
Cannot find "%s".
What it means
The 'attach' command loads the target note by title via app().loadItem scoped to the current notebook, runs encryptionCheck, then checks for null and throws 'Cannot find' if the note does not exist. The message is i18n-translated.
Source
Thrown at packages/app-cli/app/command-attach.ts:21
import { _ } from '@joplin/lib/locale';
import { ModelType } from '@joplin/lib/BaseModel';
import shim from '@joplin/lib/shim';
class Command extends BaseCommand {
public override usage() {
return 'attach <note> <file>';
}
public override description() {
return _('Attaches the given file to the note.');
}
public override async action(args: { note: string; file: string }) {
const title = args['note'];
const note = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });
this.encryptionCheck(note);
if (!note) throw new Error(_('Cannot find "%s".', title));
const localFilePath = args['file'];
await shim.attachFileToNote(note, localFilePath);
}
}
module.exports = Command;
View on GitHub (pinned to 2654b33620)
Solutions
- Verify the exact title/id with 'ls'.
- Switch to the correct notebook with 'use <notebook>'.
- Sync to pull missing notes.
- Use the note id if the title is ambiguous.
Example fix
# before # joplin attach "shoping" list.txt # typo -> Cannot find # after # joplin attach "shopping" list.txt
Defensive patterns
Strategy: validation
Validate before calling
const note = await app().loadItem(ModelType.Note, title, { parent: app().currentFolder() });
if (!note) {
console.error(`Note not found: ${title}`);
return;
} Try / catch
try {
await shim.attachFileToNote(note, localFilePath);
} catch (e) {
if (/Cannot find/.test(e.message)) console.error(e.message);
} Prevention
- Verify the note title/id with 'ls' before attaching.
- Run 'use <notebook>' to ensure the right notebook is current.
- Sync before attaching to recently created remote notes.
When it happens
Trigger: Running 'attach <note> <file>' where <note> does not match any note title or id in the current notebook.
Common situations: Typo in the note title; note is in a different notebook than the current one; note not yet synced; note was deleted.
Related errors
- More than one item match "%s". Please narrow down your query
- Cannot find "%s".
- No notebook has been specified.
- Cannot find "%s".
- Cannot find "%s".
AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12).
Data as JSON: /api/errors/5b3743ff6f611ebc.
Report an issue: GitHub.