openaec-foundation/frappe_claude_skill_package/frappe-errors-hooks
Claude Code and agent skill by openaec-foundation/frappe_claude_skill_package
- community
Checking that the SKILL.md file is still in the repository.
Use when debugging hooks.py errors in Frappe/ERPNext. Covers hook not firing (typo, wrong dict structure), circular imports, app_include_js path errors, scheduler_events not running, doc_events on wrong DocType, permission_query_conditions SQL errors, override_doctype_class import failures, extend_doctype_class [v16+] conflicts, fixtures not loading. Error diagnosis by hook type for v14/v15/v16. Keywords: hooks.py error, hook not firing, scheduler not running,, hook not working, scheduler not running, app_include not loading, override not applied. doc_events error, circular import, fixtures error, override class error.
Install
npx vskill@latest install openaec-foundation/frappe_claude_skill_package/frappe-errors-hooksSKILL.md
The same SKILL.md was published earlier as openaec-foundation/frappe_claude_skill_package/frappe-errors-hooks.
Frappe Hooks Error Diagnosis & Resolution
Cross-ref: frappe-syntax-hooks (syntax), frappe-impl-hooks (workflows), frappe-errors-controllers (controller errors).
Error-to-Fix Mapping Table
| Error / Symptom | Cause | Fix | |
|---|---|---|---|
| Hook not firing at all | Typo in dotted path | Verify module path matches actual file location | |
ImportError on bench start | Wrong module path or circular import | Fix import path; break circular dependency | |
AttributeError: module has no attribute | Function name typo in hooks.py | Match function name exactly to Python definition | |
app_include_js not loading | Path missing assets/ prefix or wrong extension | Use "assets/myapp/js/file.js" format | |
| scheduler_events not running | Scheduler disabled or workers down | bench scheduler enable, check bench doctor | |
| doc_events handler never called | DocType name misspelled in dict key | Use exact DocType name with spaces: "Sales Invoice" | |
permission_query_conditions breaks list view | SQL syntax error or frappe.throw() in handler | Return valid SQL string; NEVER throw | |
override_doctype_class import failure | Parent class import path changed between versions | Pin import to correct module path for target version | |
extend_doctype_class [v16+] method conflict | Two extensions define same method name | Rename conflicting methods; check hook resolution order | |
| Fixtures not loading on install | Wrong dt key or DocType doesn't exist on target | Verify DocType exists before export; check filter syntax | |
extend_bootinfo breaks login | Unhandled exception in boot handler | Wrap ALL bootinfo code in try/except | |
Wildcard "*" handler breaks all saves | Unhandled exception in wildcard doc_events | ALWAYS wrap wildcard handlers in try/except | |
| Hook fires but changes lost | Missing frappe.db.commit() in scheduler | Add explicit commit in scheduler/background tasks | |
| Multiple handler chain broken | First handler throws, others never run | Isolate non-critical ops in try/except |
Hook Registration Errors
Hook Not Firing: Diagnosis Checklist
Circular Import Errors
Rule: NEVER import from hooks.py in your event handlers. hooks.py is read by the framework, not imported by your code.
Wrong Dict Structure by Hook Type
app_include_js / app_include_css Errors
Diagnosis: If JS/CSS not loading, check browser DevTools Network tab for 404. Run bench build after adding new files. ALWAYS verify the file exists at myapp/public/js/myapp.js.
scheduler_events Not Running
Diagnosis Steps
Common Scheduler Failures
doc_events Errors
Error Handling by Event Phase
| Event | Throw Effect | Transaction | Pattern | |
|---|---|---|---|---|
validate | Prevents save, full rollback | Pre-write | Collect errors, throw once | |
before_save | Prevents save, full rollback | Pre-write | Same as validate | |
on_update | Doc already saved, error shown | Post-write | Isolate non-critical ops | |
after_insert | Doc already saved, error shown | Post-write | Isolate non-critical ops | |
on_submit | Doc already submitted | Post-write | Isolate non-critical ops | |
on_cancel | Doc already cancelled | Post-write | Isolate non-critical ops |
Multiple Handler Chain Problem
NEVER Commit in doc_events
Permission Hook Errors
permission_query_conditions: NEVER Throw
Note: permission_query_conditions only affects frappe.db.get_list(), NOT frappe.db.get_all().
has_permission: NEVER Throw
Override & Extend Errors
override_doctype_class: Import Failures
Warning: Only ONE app's override_doctype_class is active per DocType ("last writer wins"). Use extend_doctype_class [v16+] for multi-app compatibility.
extend_doctype_class [v16+]: Conflicts
extend_bootinfo Errors
Fixtures Not Loading
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/source/errors/frappe-errors-hooks/SKILL.md
Popularity
- Repository stars
- 88
- Repository forks
- 25
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openaec-foundation/frappe_claude_skill_package/frappe-errors-hooks)