Unable to open file error, I've tried everything

Ok, so I am able to upload gcode fine, I can even see it in the /gcodes file in filezilla, but when I go to print it just throws the “Cannot open File” error.

So I was told to update the path fir virtual_sdcard in the printer.cfg and mainsail.cfg file, so I do that


[virtual_sdcard] path = /home/biqu/printer_data/gcodes 
on_error_gcode = CANCEL_PRINT 

I also ran the following to give me access to the gcodes file, just in case… To no avail…

chown pi ~/printer_data/gcodes chmod 777 ~/printer_data/gcodes

So now, when I go to check the log, the only error I see is “configparser.Error: Include file ‘/home/biqu/printer_data/config/generic-bigtreetech-xxx.cfg’ does not exist”, but that file does exist! I literally opened it in filezilla, in the correct file path, although I’m not sure why I even need a generic config file… This is the following code I see in the klippy log.–> Starting Klippy...

Starting Klippy...

Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']

Git version: 'v0.11.0-122-ge6ef48cd'

CPU: 4 core ?

Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'

Start printer at Fri Mar 3 11:24:39 2023 (1677842679.6 34.0)

Config error

Traceback (most recent call last):

File "/home/biqu/klipper/klippy/klippy.py", line 175, in _connect


File "/home/biqu/klipper/klippy/klippy.py", line 134, in _read_config

config = pconfig.read_main_config()

File "/home/biqu/klipper/klippy/configfile.py", line 281, in read_main_config

regular_config = self._build_config_wrapper(regular_data, filename)

File "/home/biqu/klipper/klippy/configfile.py", line 268, in _build_config_wrapper

self._parse_config(data, filename, fileconfig, set())

File "/home/biqu/klipper/klippy/configfile.py", line 256, in _parse_config

self._resolve_include(filename, include_spec, fileconfig,

File "/home/biqu/klipper/klippy/configfile.py", line 229, in _resolve_include

raise error("Include file '%s' does not exist" % (include_glob,))

configparser.Error: Include file '/home/biqu/printer_data/config/generic-bigtreetech-xxx.cfg' does not exist

webhooks client 281472943226448: New connection

webhooks client 281472943226448: Client info {'program': 'Moonraker', 'version': 'v0.8.0-23-g18f5ff4'}

I have no clue what is wrong here, or why it is saying that file does not exist, when it clearly does… but I’ve been at this for hours and it is seriously getting on my nerves! Any help is much appreciated!!

I moved your thread into the correct category.

Configs category is only for sharing working configs and not trouble shooting.

Could you change it to this and test again:

path: /home/biqu/printer_data/gcodes 
on_error_gcode: CANCEL_PRINT 

Carefully reading the error message might have gotten you further, since it is quite obvious:
You have a not existing [include generic-bigtreetech-xxx.cfg] somewhere in your config.

I actually currently have that. The “=” was actually a typo in this post

I did read the error message. In my post it says that that file does exist in the directory it states in the log… So I guess I do not need that file? Or I just don’t need my printer.cfg to be linked to it at all?

So it does not exist though it is there?!

Just for testing purpose comment out the include line and save and restart and check what happens.
You can always undo such a change easily.

Yep, it says it doesn’t exist although it definitely does… So I should comment the line 229 out in the configfile.py? It doesn’t specifically state that file on line 229(see first picture), but I will try commenting 229 out and see what happens.

No! If you comment out something then in the printer.cfg or related cfg-files!

Best is you upload your klippy.log or better your printer.cfg so we can check what you have in there…

klippy.log (296.0 KB)
Yeah, the line that calls the generic-bigtreetech-xxx.cfg file in printer.config is already commented out, I also tried uncommenting it and it kept doing the same thing. My log and config files are attached…
printer.cfg (27.8 KB)

Somehow the printer.cfg does not match the stuff included in the klippy.log and is quite messy due to the amount of comments.
It has the following part in it twice:

path = /home/pi/printer_data/gcodes

But not the corrected one we talked about earlier.

And you have further issues as well:

mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32f446xx_0F0028001350565843333620-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32f446xx_0F0028001350565843333620-if00'

Though there seems to be a connection in between.

Are there further includes in the mainsail.cfg and neopixel.cfg?
If so what are those?

hmmm That is odd I am wondering what that serial port issue is… No includes in the mainsail.cfg or neopixel at all…Oh I did not even notice that link all the way at the bottom of the file! I changed that and now it is working!

Do you by chance know what that port issue is? I am noticing some odd .zip files in my mainsail config page now…

In the end, it might be easier to follow some guides, e.g. Installing Klipper with KIAUH, to get the basic setup correct instead of stumbling from error to error due to “doing something somehow”

1 Like

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