Configuration Class Errors
This page compiles issues related to configuration section conflicts, parameter spelling, include files, and SAVE_CONFIG problems. After modifying the configuration, first check the first configuration error in klippy.log, then address them one by one.
homing_override method always homes X and Y before homing Z
Error Message: Safe Z homing conflicts with homing override configuration.
Cause: Both [safe_z_home] and [homing_override] are configured, causing Klipper to be unable to determine which homing logic to use.
Solution:
- Search for
[safe_z_home]and[homing_override]in the configuration file. - Keep only one of them based on the actual homing logic of the machine.
- Save and restart Klipper.
Related configuration reference: Homing and Direction Calibration Guide, Homing Override Reference Configuration.
Option 'xxx' is not valid in section 'yyy'
Error Message: Option 'xxx' is not valid in section 'yyy', indicating an unrecognized option name in the specified configuration section.
Common Causes:
- Spelling error in the option name, e.g.,
sensor_pinwritten assensor_ping. - Options from another configuration section pasted incorrectly under the current section, e.g., writing a
[probe]option under[stepper_z]. - After a Klipper version upgrade, options supported in the older version have been removed or renamed.
- Using comment content that is not an actual parameter, e.g.,
default_parameter_z.
Solution:
- Carefully check the configuration section and option name indicated in the error to confirm the spelling.
- Refer to the Klipper Configuration Reference to confirm which section the option belongs to.
- If Klipper was recently upgraded, check the Configuration Changes to see if the option has changed.
- Delete the invalid option or move it to the correct configuration section.
Related configuration reference: Configuration Modification Instructions.
Section 'xxx' is not a valid config section
Error Message: Section 'xxx' is not a valid config section, Unknown config object, or a configuration section cannot be recognized by Klipper.
Common Causes:
- Spelling error in the configuration section name, e.g.,
[bed_mesh]written as[bedmesh]. - The current Klipper version does not support this configuration section, or the configuration format is incompatible after an update/downgrade.
- Copied a third-party plugin configuration, but the corresponding plugin, extension module, or Klipper branch is not installed.
- The include file retains configuration sections from another machine or motherboard.
Solution:
- Based on the configuration section name in the error, locate the corresponding paragraph in
printer.cfgand all include files. - Confirm the spelling matches the Klipper configuration reference. Do not use Chinese brackets or full-width symbols for configuration section names.
- If the configuration comes from a third-party plugin or custom macro package, confirm the corresponding plugin is installed and compatible with the current Klipper version.
- If unsure about the purpose of the paragraph, comment out the configuration section first and restart for testing, then restore them one by one.
Related configuration reference: Configuration Modification Instructions.
Unable to open config file / Include file does not exist
Error Message: Unable to open config file /home/xxx/printer_data/config/printer.cfg or Include file 'xxx.cfg' does not exist.
Common Causes:
- The
printer.cfgfile path is incorrect or the file was accidentally deleted. - The sub-configuration file referenced by
[include]does not exist or the filename does not match. - Installation tools like KIAUH automatically generated
[include]references, but the corresponding cfg files were not installed. - Permission issues prevent Klipper from reading the configuration file.
Solution:
- Confirm that
printer.cfgexists in the Klipper configuration directory, typically~/printer_data/config/printer.cfg. - Check all
[include xxx.cfg]lines to confirm the referenced files actually exist. - If missing
fluidd.cfgormainsail.cfg, refer to the corresponding Web interface's installation documentation to supplement the configuration. - Ensure the configuration file permissions are correct:
ls -la ~/printer_data/config/.
Fluidd / Mainsail Basic Configuration Missing
Error Message: Fluidd or Mainsail indicates basic configuration is missing. Common keywords include:
[virtual_sdcard] not found in printer configuration.
[pause_resume] not found in printer configuration.
[display_status] is required if you do not have a [display] defined.
CANCEL_PRINT macro not found in configuration.
Fluidd prompt example:
Mainsail prompt example:
Common Causes:
[include fluidd.cfg]or[include mainsail.cfg]is not enabled inprinter.cfg.fluidd.cfg/mainsail.cfgis missing from the configuration directory, or the include filename is misspelled.[virtual_sdcard],[pause_resume],[display_status]were omitted during manual configuration.- The
CANCEL_PRINTmacro is not defined, or the macro file is not included.
Solution:
-
Must prioritize using the default frontend configuration file. It is not recommended for general users to bypass the prompting by manually adding only a few configuration sections. The default
fluidd.cfg/mainsail.cfgwill simultaneously provide the basic configurations needed by the frontend, such as virtual SD card, pause/resume, display status, and cancel print macros. -
Confirm that
printer.cfgincludes the include corresponding to the currently used frontend at the top:[include fluidd.cfg]or:
[include mainsail.cfg] -
If using a FLY preset system or official reference configuration, confirm that the
fluidd.cfg/mainsail.cfgfiles exist in the~/printer_data/config/directory. -
If the corresponding files do not exist, re-supplement the default frontend configuration file, or refer to the Fluidd Initial Setup Instructions.
-
After enabling the default frontend configuration file, if you need to modify the position and retraction parameters for pause, resume, and cancel print, then add
_CLIENT_VARIABLEaccording to the Custom Pause and Cancel Print Positions. Do not directly copy or rewrite the defaultCANCEL_PRINT/PAUSE/RESUMEmacros. -
Only consider manually supplementing the basic sections when maintaining a custom system and you clearly know the frontend macro dependency relationships. This method is not recommended for general users. It must at least include:
[virtual_sdcard]path: ~/printer_data/gcodeson_error_gcode: CANCEL_PRINT[pause_resume][display_status]A functional
[gcode_macro CANCEL_PRINT]must also be provided, otherwise the frontend will still promptCANCEL_PRINT macro not found in configuration. -
Save the configuration and execute
RESTART. If it still prompts missing, continue to check if all include files are actually being read by Klipper.
Frontend Macro Usage Method: Custom Pause and Cancel Print Positions Macro Configuration Reference: Macro Introduction
Unable to parse option / Option must be specified
Error Message: Unable to parse option 'xxx' in section 'yyy', Option 'xxx' in section 'yyy' must be specified, or must have minimum/maximum, must be above/below.
Common Causes:
- Required parameter is missing, e.g.,
[extruder]missingstep_pin,dir_pin,heater_pin, orsensor_type. - Parameter format is incorrect, e.g., requiring a number but text was entered, or requiring a coordinate list but a comma is missing.
- Parameter value is outside the allowed range for Klipper, e.g., unreasonable settings for
run_current,max_temp,position_max. - Retained Chinese punctuation, full-width symbols, or invisible characters when copying configuration.
Solution:
- Based on the configuration section and parameter name in the error, go back to the corresponding
.cfgfile and check item by item. - For numbers, coordinates, and list parameters, confirm the format matches the example, e.g.,
mesh_min: 20, 20. - For
must be above/beloworminimum/maximum, first restore to the official example or the value recommended by the motherboard tutorial. - Save and execute
RESTART. If it still fails, check the first configuration error inklippy.log.
Related configuration reference: Configuration Modification Instructions.
Unknown pin chip name / Pin is not a valid pin name / Pin used multiple times
Error Message: Unknown pin chip name 'xxx', Pin 'PB12' is not a valid pin name on mcu 'mcu', Invalid pin description 'xxx', pin xxx used multiple times in config.
Common Causes:
- The pin prefix is wrong in a multi-MCU configuration, e.g., should be
toolboard:PB0but written as a non-existent MCU name. - The MCU ID (
canbus_uuidorserial) is configured incorrectly, causing pin mapping to the wrong device which does not have the corresponding pin. - Spelling error in the pin name, or directly copying a pin from a motherboard tutorial to a different motherboard.
- The same physical pin is occupied by multiple functions, e.g., fan, heater, endstop using the same pin.
- Pin inversion
!, pull-up^, pull-down~are written in the wrong position.
Solution:
- Check if the name of
[mcu xxx]exactly matches the pin prefix, including case sensitivity. - Verify that the
canbus_uuidorserialof the[mcu xxx]section matches the actual device (can be confirmed usingls /dev/serial/by-id/orpython3 -c "import can; ..."). - Compare with the motherboard pinout diagram to confirm that each
pin:,step_pin:,dir_pin:,heater_pin:belongs to the current motherboard. - Search for the error-reported pin in all include files, and delete or change the duplicate occupancy item.
- Pin modifiers should be written before the pin name, e.g.,
^PB7,!PC13,mcu2:^PB7.
Related configuration reference: Configuration Modification Instructions, Fan Reference Configuration.
G-code command XXX already registered
Error Message: Error: gcode command XXX already registered.
Cause: Two different macros or system modules registered the same G-code command name, e.g., both macros define [gcode_macro NEXT].
Common Scenarios:
- User-defined macro conflicts with Klipper system modules or third-party configurations.
- Multiple definitions of
[gcode_macro M600].
Solution:
- Search for duplicate definitions in
printer.cfgand all[include]files. - Delete or rename the conflicting
[gcode_macro]. - Check common macros such as
[homing_override],[gcode_macro PAUSE],[gcode_macro RESUME],[gcode_macro CANCEL_PRINT].
Related configuration reference: Macro Introduction.
Unknown command:"XXX"
Error Message: Unknown command:"PRINT_START", Unknown command:"START_PRINT", Unknown command:"M600", Unknown command:"EXCLUDE_OBJECT_DEFINE", Unknown command:"EXCLUDE_OBJECT_START", Unknown command:"EXCLUDE_OBJECT_END", Unknown command:"M106", Unknown command:"M201", Unknown command:"M203", Unknown command:"M205" appearing in the console or klippy.log.
Common Causes:
- The slicer's start or end G-code calls a macro that doesn't exist in Klipper, e.g., the slicer sends
PRINT_START, but only[gcode_macro START_PRINT]is defined. - Used commands migrated from Marlin, which Klipper does not support by default or needs a macro for compatibility.
- Exclude object functionality is enabled, but the slicer, Moonraker, or Klipper configuration is incomplete, causing commands like
EXCLUDE_OBJECT_DEFINE,EXCLUDE_OBJECT_START,EXCLUDE_OBJECT_ENDto be unrecognized. - The fan uses
[fan_generic]or[output_pin], but the slicer still sends defaultM106/M107. - Missing include files for a third-party macro package, or the macro name is inconsistent with the name written in the slicer.
Solution:
- Search for the command name from the error in
printer.cfgand all include files to confirm if a corresponding[gcode_macro XXX]exists. - Make the names of start, end, filament change, fan, and exclude object commands in the slicer consistent with the Klipper macros.
- For Marlin commands, prioritize deleting unnecessary commands; only add explicit Klipper macros for compatibility if truly needed.
- For exclude object related errors, simultaneously check if the slicer outputs object labels, if Moonraker enables object processing, and if Klipper has
[exclude_object]. - For fan command errors, confirm whether
[fan]should be used, or add a matching control macro for[fan_generic]/[output_pin].
EXCLUDE_OBJECT_DEFINE / START / END
Error Meaning: EXCLUDE_OBJECT_DEFINE is used to define a print object, EXCLUDE_OBJECT_START / EXCLUDE_OBJECT_END is used to mark which object the current G-code belongs to, so the frontend can display and exclude specific objects during multi-object printing. If klippy.log repeatedly shows Unknown command:"EXCLUDE_OBJECT_DEFINE", Unknown command:"EXCLUDE_OBJECT_START", or Unknown command:"EXCLUDE_OBJECT_END", it means the G-code already contains object exclusion commands, but the current Klipper configuration is not correctly handling these commands.
Priority Checks:
- Confirm the presence of the following in
printer.cfgor a configuration file that is included:
[exclude_object]
- After modification, execute
RESTART, then re-upload the G-code file for testing. Old files that have already been uploaded may not have been processed with the latest configuration. It is recommended to re-slice or re-upload. - Check if Moonraker configuration enables object processing. Common configuration location is
moonraker.conf:
[file_manager]
enable_object_processing: True
- Check if the slicer has enabled output for object labels / exclude objects. The names vary by slicer, but a common indication is the presence of
EXCLUDE_OBJECT_DEFINE,EXCLUDE_OBJECT_START,EXCLUDE_OBJECT_END, or object names in the G-code. - If the goal is just to temporarily complete a print without needing object exclusion, disable the object exclusion related output in the slicer and re-slice; do not just delete some object commands from the file, as this may cause anomalies in the frontend object list.
Guidance for Diagnosis:
- Only reports
EXCLUDE_OBJECT_START/EXCLUDE_OBJECT_END: Prioritize adding[exclude_object], then restart Klipper. - Frontend has no object list, but Klipper no longer reports Unknown command: Prioritize checking Moonraker's object processing and whether the G-code was re-uploaded.
- Cannot find object-related commands at all in the file: Indicates the slicer did not output object labels. Enable this in the slicer settings.
Related configuration reference: Macro Introduction, Configuration Modification Instructions.
Error evaluating 'gcode_macro XXX:gcode'
Error Message: Error evaluating 'gcode_macro PRINT_START:gcode', jinja2.exceptions.UndefinedError, 'dict object' has no attribute 'BED', 'dict object' has no attribute 'HOTEND', 'dict object' has no attribute 'extrude', 'dict object' has no attribute 'heater_bed', gcode.CommandError.
Common Causes:
- The slicer did not pass parameters required by the macro, e.g., the macro reads
params.HOTEND, but the slicer does not passHOTEND=. - Parameter name mismatch, e.g., the macro needs
BED/HOTEND, but the slicer passesBED_TEMP/EXTRUDER_TEMP. - The macro references a non-existent object, e.g.,
[heater_bed]is not in the configuration, but the macro readsprinter.heater_bed. - The macro uses Jinja2 syntax with errors in parentheses, quotes, filters, or default values.
- A command executed within the macro fails first, and the outer scope only shows it as
Error evaluating.
Solution:
- Check the full Traceback below
Error evaluatinginklippy.logto identify which variable or command caused the error. - Compare with the slicer's start G-code to confirm that the parameter names passed match
params.xxxin the macro exactly, including case. - Set default values for optional parameters, e.g.,
params.BED|default(60)|float, to avoid errors when parameters are empty. - Search for
printer.xxxobjects used in the macro to confirm the corresponding module exists in the configuration. - If the macro comes from a third-party configuration package, confirm that all dependent include files and base macros are loaded.
Related configuration reference: Macro Introduction.
SAVE_CONFIG Failure or Configuration Conflict
Error Message: Unable to write config, Option conflict, Cannot save config after executing SAVE_CONFIG, or the printer cannot start after saving.
Common Causes:
- Insufficient permissions for the
printer.cfgfile; the Klipper process cannot write, often caused by editing the configuration file withsudo. - Configuration items in the auto-save area (
#*#marked block) conflict with the same options in manually managed[include]files. - The MCU is in a shutdown state, preventing
SAVE_CONFIGfrom properly issuing the new configuration. - Syntax errors or truncation at the end of the
printer.cfgfile, causing the auto-save area write to fail. - Multiple include files redundantly define parameters that should not be automatically saved by
SAVE_CONFIG, such as PID, Z offset.
Solution:
-
Confirm the configuration file permissions:
ls -la ~/printer_data/config/printer.cfgIf the owner is not the current user, execute:
sudo chown $USER:$USER ~/printer_data/config/printer.cfg -
If the printer cannot start after
SAVE_CONFIG, openprinter.cfgand check the#*#auto-save area at the bottom. -
If the same option exists in an include file, delete the duplicate entry in the auto-save area, or change to manage it uniformly in the include file.
-
If the MCU is in a shutdown state, execute
FIRMWARE_RESTARTfirst, then re-executeSAVE_CONFIG. -
If permissions are normal but writing is still not possible, check disk space:
df -h ~/printer_data/.
Related configuration reference: Configuration Modification Instructions.
SDCARD_RESET_FILE cannot be run from the sdcard
Error Message: SDCARD_RESET_FILE cannot be run from the sdcard.
Common Causes:
- The
SDCARD_RESET_FILEcommand was executed during an SD card print. This command cannot be called during an SD card print. - The slicer's start G-code or a macro incorrectly includes
SDCARD_RESET_FILE.
Solution:
- Check the slicer's start G-code and custom macros, and delete or comment out the
SDCARD_RESET_FILEcall. - If resetting the SD card file status is truly necessary, execute it manually after the print is finished, not during the print process.
- If using a
PRINT_STARTmacro, confirm it does not call this command.