# Error when trying to stop print

**URL:** <https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562>\
**Category:** General Discussion\
**Created:** [December 24, 2023, 2:43am UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562 "2023-12-24T02:43:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![3DLimey](https://avatars.discourse-cdn.com/v4/letter/3/57b2e6/32.png) [@3DLimey](https://klipper.discourse.group/u/3DLimey)\
**Post date:** [December 24, 2023, 2:43am UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/1 "2023-12-24T02:43:00Z")

</div>

Basic Information:  
Printer Model: Creality K1 MAX  
MCU / Printerboard: CR4CU220812S12\_32\_TMC2209\_X2000E  
MCU: chip: GD32F303RET6 version: CR4CU220812S12  
[klippy.log](https://klipper.discourse.group/uploads/short-url/kJtfGrfnaOoBIHdyPgjiNU7mvWe.log) (3.6 MB)

When trying to stop the print either on the touchscreen or in fluidd after the print has started and while currently printing, it throws an error {“code”:“key165”, “msg”: "Error evaluating ‘gcode\_macro M107:gcode’: jinja2.exceptions.UndefinedError: ‘dict object’ has no attribute ‘S’  
", “values”: [“gcode\_macro M107:gcode”, "jinja2.exceptions.UndefinedError: ‘dict object’ has no attribute ‘S’  
"]}

when I look at the macro in fluidd it shows:  
[gcode\_macro M107]  
gcode:  
{% set fans = printer[“gcode\_macro PRINTER\_PARAM”].fans|int %}  
{% if params.P is defined %}  
{% if params.P|int \< fans %}  
SET\_PIN PIN=fan{params.P|int} VALUE=0  
{% else %}  
SET\_PIN PIN=fan0 VALUE=0  
{% endif %}  
{% else %}  
SET\_PIN PIN=fan0 VALUE=0  
SET\_PIN PIN=fan2 VALUE=0  
{% endif %}

In the klippy log it shows:  
[gcode\_macro M107]  
gcode =  
{% set s = params.S|float %}  
SET\_TEMPERATURE\_FAN\_TARGET TEMPERATURE\_FAN=chamber\_fan TARGET={s}  
{ action\_respond\_info(“Chamber fan target temperature: %s°C” % (s)) }  
description = Set Chamber Temperature with slicers

My printer is rooted per Guilouz/GitHub instructions. I am at a loss as to the error and what I should change to fix the error for the attribute ‘S’, especially as in the config file it shows differently than on the klippy log.

TIA!!

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [December 24, 2023, 7:30am UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/2 "2023-12-24T07:30:41Z")

</div>

Check your printer.cfg. There is the mentioned M107 with parameter S.  
Seems to come after your known macro and overwrites it as it is processed later.

---

<div class="post-metadata">

**Author:** ![3DLimey](https://avatars.discourse-cdn.com/v4/letter/3/57b2e6/32.png) [@3DLimey](https://klipper.discourse.group/u/3DLimey)\
**Post date:** [December 24, 2023, 8:08pm UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/3 "2023-12-24T20:08:04Z")

</div>

can’t find anything in printer.cfg file, no mention of m107 or any macros within that file.

no attribute s shows within the gcode macro.cfg file to even investigate or change, but it does show within the klippy log.

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [December 24, 2023, 8:48pm UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/4 "2023-12-24T20:48:27Z")

</div>

It is contained in the klippy.log so it must be in any of the included files.

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [December 25, 2023, 7:40am UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/5 "2023-12-25T07:40:48Z")

</div>

@3DLimey

The klippy.log looks quite unusual.  
Do you run on a not genuine Klipper system?

And why does Fluidd provide another M107 macro?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [February 23, 2024, 7:40am UTC](https://klipper.discourse.group/t/error-when-trying-to-stop-print/12562/6 "2024-02-23T07:40:55Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
