Config Class Errors
This page collects issues related to config section conflicts, parameter spelling, include files, and SAVE_CONFIG. After modifying configurations, 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.
Root 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 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 exists in the specified config section.
Common Causes:
- Misspelled option name, e.g.,
sensor_pinwritten assensor_ping. - Options from another section mistakenly pasted into the current one, e.g.,
[probe]options written in[stepper_z]. - After a Klipper version upgrade, options supported in the old version have been removed or renamed.
- Comment content that is not an actual parameter, e.g.,
default_parameter_z.
Solution:
- Carefully check the config section and option name indicated in the error to confirm 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 invalid options or move them to the correct config section.
Related configuration reference: Configuration Modification Guide.
Section 'xxx' is not a valid config section
Error Message: Section 'xxx' is not a valid config section, Unknown config object, or a config section cannot be recognized by Klipper.
Common Causes:
- Misspelled section name, e.g.,
[bed_mesh]written as[bedmesh]. - The current Klipper version does not support this section, or the config format is incompatible after an update/downgrade.
- A third-party plugin configuration is copied, but the corresponding plugin, extension module, or Klipper branch is not installed.
- Include files retain sections meant for another machine or motherboard.
Solution:
- Locate the corresponding section in
printer.cfgand all include files based on the section name in the error. - Confirm the spelling matches the Klipper configuration reference; do not use Chinese brackets or full-width symbols for 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 section's purpose, comment it out, restart, and test, then restore items one by one.
Related configuration reference: Configuration Modification Guide.
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 has been accidentally deleted. - The sub-configuration file referenced by
[include]does not exist or the file name does not match. - Installation tools like KIAUH automatically generate
[include]references, but the corresponding cfg file is not installed. - Permission issues prevent Klipper from reading the configuration file.
Solution:
- Confirm that
printer.cfgexists in the Klipper configuration directory, usually~/printer_data/config/printer.cfg. - Check all
[include xxx.cfg]lines to ensure the referenced files actually exist. - If
fluidd.cfgormainsail.cfgis missing, refer to the corresponding Web interface installation documentation to add the configuration. - Ensure configuration file permissions are correct:
ls -la ~/printer_data/config/.
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 parameters are missing, e.g.,
[extruder]missingstep_pin,dir_pin,heater_pin, orsensor_type. - Parameter format is incorrect, e.g., requiring a number but providing text, or requiring a coordinate list but missing a comma.
- Parameter value exceeds Klipper's allowed range, e.g., unreasonable
run_current,max_temp, orposition_maxsettings. - Chinese punctuation, full-width symbols, or invisible characters are retained when copying configuration.
Solution:
- According to the config section and parameter name in the error, go back to the corresponding
.cfgfile and check each 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 revert to the official example or values recommended by the motherboard tutorial. - After saving, execute
RESTART. If it still fails, check the first configuration error inklippy.log.
Related configuration reference: Configuration Modification Guide.
Unknown pin chip name / pin used multiple times
Error Message: Unknown pin chip name 'xxx', Invalid pin description 'xxx', pin xxx used multiple times in config.
Common Causes:
- In a multi-MCU configuration, the pin prefix is incorrect, e.g., should write
EBBCan:PB0but wrote a non-existent MCU name. - Pin name spelling error, or directly copying pins from one motherboard's tutorial to another.
- The same physical pin is used by multiple functions, e.g., fan, heater, and endstop all using the same pin.
- Pin inversion
!, pull-up^, pull-down~are written in the wrong position.
Solution:
- Check if the name in
[mcu xxx]is exactly the same as the pin prefix, including case sensitivity. - Compare with the motherboard pinout diagram to confirm each
pin:,step_pin:,dir_pin:,heater_pin:belongs to the current motherboard. - Search for the error pin in all include files, delete or replace duplicate entries.
- Pin modifiers should be written before the pin name, e.g.,
^PB7,!PC13,mcu2:^PB7.
Related configuration reference: Configuration Modification Guide, Fan Reference Configuration.
gcode command XXX already registered
Error Message: Error: gcode command XXX already registered.
Root Cause: Two different macros or system modules register the same G-code command name, e.g., both macros define [gcode_macro NEXT].
Common Scenarios:
- User-defined macros conflict 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 conflicting
[gcode_macro]. - Check commonly used macros like
[homing_override],[gcode_macro PAUSE],[gcode_macro RESUME],[gcode_macro CANCEL_PRINT].
Related configuration reference: Macros Introduction.
Unknown command:"XXX"
Error Message: In the console or klippy.log, occurrences like Unknown command:"PRINT_START", Unknown command:"START_PRINT", Unknown command:"M600", Unknown command:"EXCLUDE_OBJECT_START", Unknown command:"EXCLUDE_OBJECT_END", Unknown command:"M106", Unknown command:"M201", Unknown command:"M203", Unknown command:"M205".
Common Causes:
- The slicer's start or end G-code calls a macro that does not exist in Klipper, e.g., the slicer sends
PRINT_START, but the configuration only defines[gcode_macro START_PRINT]. - Commands migrated from Marlin are used, which Klipper does not support by default or requires macros to be compatible.
- The exclude object function is enabled, but the slicer, Moonraker, or Klipper configuration is incomplete, causing
EXCLUDE_OBJECT_START/EXCLUDE_OBJECT_ENDto be unrecognized. - Fans use
[fan_generic]or[output_pin], but the slicer still sends defaultM106/M107. - When using third-party macro packages, include files are missing, or macro names don't match the names filled in the slicer.
Solution:
- Search for the command name in the error within
printer.cfgand all include files to confirm if the corresponding[gcode_macro XXX]exists. - Ensure the names of start, end, filament change, fan, and exclude object commands in the slicer match the Klipper macros.
- For Marlin commands, prioritize deleting unnecessary ones; if compatibility is genuinely needed, add explicit Klipper macros.
- For exclude object related errors, simultaneously check if the slicer outputs object labels, if Moonraker has object processing enabled, and if Klipper has
[exclude_object]. - For fan command errors, confirm whether
[fan]should be used, or add matching control macros for[fan_generic]/[output_pin].
Related configuration reference: Macros Introduction, Configuration Modification Guide.
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 does not pass the parameters required by the macro, e.g., the macro reads
params.HOTEND, but the slicer does not passHOTEND=. - Parameter names are inconsistent, e.g., the macro needs
BED/HOTEND, but the slicer actually passesBED_TEMP/EXTRUDER_TEMP. - The macro references a non-existent object, e.g., there is no
[heater_bed]in the configuration, but the macro readsprinter.heater_bed. - Jinja2 syntax is used in the macro, but the parentheses, quotes, filters, or default values are written incorrectly.
- A command executed within the macro errors first, and the outer layer only shows
Error evaluating.
Solution:
- View the full Traceback below
Error evaluatinginklippy.logto confirm which variable or command is causing the error. - Compare with the slicer's start G-code to confirm the parameter names passed in exactly match
params.xxxin the macro, including case sensitivity. - 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 modules exist in the configuration. - If the macro comes from a third-party configuration package, confirm all dependent include files and base macros are loaded.
Related configuration reference: Macros Introduction.
SAVE_CONFIG failure or configuration conflict
Error Message: After executing SAVE_CONFIG, prompts like Unable to write config, Option conflict, Cannot save config, or the printer fails to start after saving.
Common Causes:
printer.cfgfile permissions are insufficient, and the Klipper process cannot write, commonly after editing the configuration file usingsudo.- Configuration items in the auto-save area (
#*#marked block) conflict with the same options in manual[include]files. - The MCU is already in a shutdown state, preventing
SAVE_CONFIGfrom properly issuing new configurations. - Syntax errors or truncation at the end of the
printer.cfgfile cause the auto-save area to fail to write. - Multiple include files redundantly define parameters that should not be saved automatically by
SAVE_CONFIG, such as PID, Z offset.
Solution:
-
Confirm 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 fails to start after
SAVE_CONFIG, openprinter.cfgand check the#*#auto-save area at the bottom. -
If the same option also exists in an include file, delete the duplicate item in the auto-save area, or manage it uniformly in the include file.
-
If the MCU is in a shutdown state, first execute
FIRMWARE_RESTART, then re-executeSAVE_CONFIG. -
If permissions are normal but writing still fails, check disk space:
df -h ~/printer_data/.
Related configuration reference: Configuration Modification Guide.