frappe-errors-serverscripts

Diagnose Frappe Server Script failures across Document Event, API, and Scheduler contexts.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-errors-serverscripts-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-errors-serverscripts
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/errors/frappe-errors-serverscripts
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-errors-serverscripts-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you diagnose and resolve the most common, production-breaking errors in Frappe Server Scripts—especially sandbox ImportError/NameError issues, misconfigured script type/event problems, permission failures, missing scheduler commits, and API scripts returning empty or incorrect responses.

Core Features & Use Cases

  • Server Script sandbox error mapping: Translates common sandbox error messages into precise causes and safe fixes, focusing on restricted imports, blocked try/except/raise, and restricted builtins.
  • Correct script type and event troubleshooting: Guides you to verify Document Event vs API vs Scheduler context so the right variables are available (or not) and the script actually runs as intended.
  • Production guardrails for scheduler and API scripts: Ensures scheduler changes persist via required commit behavior, and ensures API scripts always populate frappe.response["message"] with the correct structure.
  • Security hardening: Prevents SQL injection by requiring frappe.db.escape() (or safe query approaches) when user input affects SQL conditions.

Quick Start

Use the frappe-errors-serverscripts skill to debug your failing Server Script by pasting the exact error text and describing whether it is a Document Event, API script, or Scheduler script.

Frequently Asked Questions about frappe-errors-serverscripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Frappe Server Script throw an ImportError or NameError in the sandbox?

Frappe Server Script sandbox ImportErrors and NameErrors occur when scripts use restricted imports or builtins. You must replace standard imports with safe alternatives like frappe.utils and frappe.parse_json to resolve the sandbox restriction failures.

How do I fix an empty API response from a Frappe Server Script?

To fix an empty Frappe API Server Script response, you must explicitly populate frappe.response["message"] with the correct data structure. API scripts require this assignment to return data successfully instead of yielding an empty response.

Why are my Frappe Scheduler script database changes not persisting?

Frappe Scheduler script changes fail to persist when the script omits the required database commit. You must explicitly call frappe.db.commit in your Scheduler scripts to ensure data modifications are saved to the production database.

Can I use try/except and raise statements inside Frappe Server Scripts?

You cannot use standard raise statements or try/except blocks inside Frappe Server Scripts due to sandbox restrictions. You must replace raise with frappe.throw to handle exceptions and return errors safely within the execution context.

How do I prevent SQL injection in Frappe Server Scripts with user input?

To prevent SQL injection in Frappe Server Scripts, you must escape any user input affecting SQL conditions using frappe.db.escape(). This security hardening ensures safe query construction and blocks malicious database operations.

Why does my Frappe Document Event script not execute or have the wrong variables?

Frappe Document Event scripts fail to execute or lack variables when the script type or event is misconfigured. You must verify the Document Event context versus API or Scheduler scripts to ensure the correct variables are available.