Unhandled exception during run, while printing from Sd LCD MENU

Basic Information: Unhandled exception during run

Printer Model: Kreator A1
MCU / Printerboard: MKS Gen L v2.1
klippy.log
klippy_ldcF.log (1.4 MB)

Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed

Describe your issue: I’m using Graphics LCD 128*64. When trying to print from LCD menu SD Print mainSail os restarts and shows Unhandled exception during run .

Config:

[virtual_sdcard]
path = ~/gcode_files
on_error_gcode = 
	CANCEL_PRINT

Error:

virtual_sdcard get_file_list
Traceback (most recent call last):
  File "/home/debian/klipper/klippy/extras/virtual_sdcard.py", line 78, in get_file_list
    filenames = os.listdir(self.sdcard_dirname)
OSError: [Errno 2] No such file or directory: '/home/debian/gcode_files'
Unhandled exception during run
Traceback (most recent call last):

/home/debian/gcode_files seems not existing

1 Like

I have been using just:

[virtual_sdcard]
path: ~/gcode_files

Shouldn’t that cancel print automatically if there is an error returned?

In a Linux path the ~ is expanded to the user’s home folder, so
~/gcode_files is the same as /home/debian/gcode_files (given your current user is debian)

The error handler is meant to react if something goes wrong during a print from the virtual_sdcard and not as a safeguard when the folder does not even exists.

Good to know - then the

> on_error_gcode = 
> 	CANCEL_PRINT

statement should be added (always)?

Surely does not hurt. See virtual_sdcard: Adds `on_error_gcode` by pedrolamas · Pull Request #5491 · Klipper3d/klipper · GitHub

1 Like

Thank you.

I’m going to start a new thread on printer.cfg standards that is an offshoot from this.