Printer_data/gcodes folder not accessible

Basic Information:

Printer Model: Custom CoreXY
MCU / Printerboard: Manta M8P with CM4/EBB42
klippy.log (38.0 KB)

After updating my printer.cfg to handle the individual “toolhead” pin files, I did an update on the printer from the Mainsail console and then noticed that I couldn’t access any gcode files and there was nothing listed under the “G-Code Files” Mainsail page. I tried dragging and dropping a file, but it went into /home/biqu/printer_data/config and not /home/biqu/printer_data/gcodes.

(As a note, I set up my systems with the user being “biqu” so that it would match the CB1.)

I did go through the printer.cfg file as well as the ebb42toolhead.cfg which I created for the toolhead pin definition and couldn’t find anything amiss.

The next step was thinking I screwed something up with the update so I reimaged the SD Card, copied the printer.cfg and ebb42toolhead.cfg files back in, tested basic operation (heating the extruder and bed as well as homing the extruder) and still get the same problem - dragging and dropping gcode files end up in /home/biqu/printer_data/config and could not be seen in /home/biqu/printer_data/gcodes. Using NotePad++, I manually put a gcode file into /home/biqu/printer_data/gcodes and it was not visible from Mainsail.

The attached klippy.log was produced after the reimaging.

I’m sure it’s something I’ve done but, for the life of me, I can’t see it.

Please show the moonraker log. Did you also restart moonraker?

Here is the Moonraker log: moonraker.log (111.2 KB)

No, I didn’t restart Moonraker - but I just did. No change in behaviour.

Hmm, strange. I do not see anything apparently amiss.
Have you checked file and folder permissions?

In /home/biqu/ run (delete the logs folder before to reduce noise):

  • fgrep -r "/printer_data/config" *
  • fgrep -r "/printer_data/gcodes" *

and check if there are “strange” occurrences of these paths

In terms of folder permissions:

biqu@book:~ $ ls printer_data -l
total 36
drwxr-xr-x 3 biqu biqu 4096 Oct 27 00:08 backup
drwxr-xr-x 2 biqu biqu 4096 Oct 27 00:01 certs
drwxr-xr-x 2 biqu biqu 4096 Oct 27 02:27 comms
drwxr-xr-x 2 biqu biqu 4096 Oct 27 02:27 config
drwxr-xr-x 2 biqu biqu 4096 Oct 27 00:08 database
drwxr-xr-x 2 biqu biqu 4096 Oct 27 00:01 gcodes
drwxr-xr-x 2 biqu biqu 4096 Oct 27 00:16 logs
-rw-r--r-- 1 biqu biqu  131 Oct 27 00:08 moonraker.asvc
drwxr-xr-x 2 biqu biqu 4096 Oct 27 00:08 systemd
biqu@book:~ $ ls printer_data/config -l
total 24
lrwxrwxrwx 1 biqu biqu   37 Oct 27 00:16 mainsail.cfg -> /home/biqu/mainsail-config/client.cfg
-rw-r--r-- 1 biqu biqu  385 Oct 27 00:22 mcu.cfg
-rw-r--r-- 1 biqu biqu  730 Oct 27 00:16 moonraker.conf
-rw-r--r-- 1 biqu biqu 9112 Oct 27 00:23 printer.cfg
-rw-r--r-- 1 biqu biqu 1690 Oct 27 00:22 toolhead.cfg
biqu@book:~ $ ls printer_data/gcodes -l
total 0

As for the commands you are asking for:

biqu@book:~ $ fgrep -r "/printer_data/config" *
kiauh/scripts/utilities.sh:    cfg_dirs+=("${HOME}/printer_data/config")
kiauh/scripts/mainsail.sh:    target_folders+=("${HOME}/printer_data/confi ")
kiauh/docs/changelog.md:Once everything is installed again, you need to manually copy your configuration files from the old `~/klipper_config` folder to the new `~/printer_data/config` folder.
mainsail-config/README.md:ln -sf ~/mainsail-config/mainsail.cfg ~/printer_data/config/mainsail.cfg
mainsail-config/README.md:ln -sf ~/mainsail-config/mainsail-moonraker-update.conf ~/printer_data/config/mainsail-moonraker-update.conf
moonraker/docs/installation.md:KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer_data/config/printer.cfg -l /home/pi/printer_data/logs/klippy.log -a /tmp/klippy_uds"
moonraker/docs/installation.md:mkdir ~/printer_data/config
moonraker/docs/installation.md:mv printer.cfg ~/printer_data/config
moonraker/docs/installation.md:`$HOME/printer_data/config/moonraker.conf`, however the location of the
moonraker/docs/installation.md:  `/home/pi/printer_data/config/moonraker.conf`.
moonraker/docs/installation.md:- `config file`: `$HOME/printer_data/config/moonraker.conf`
moonraker/docs/installation.md:MOONRAKER_CONFIG_PATH="/home/pi/printer_data/config/moonraker-1.conf"
moonraker/docs/web_api.md:        "path": "/home/pi/printer_data/config",
printer_data/logs/klippy.log: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']
printer_data/logs/klippy.log: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']
printer_data/logs/moonraker.log:config_file: /home/biqu/printer_data/confi /moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 00:08:43,394 [confighelper.py:read_file()] - Configuration File '/home/biqu/printer_data/config/moonraker.conf' parsed, total size: 448 B
printer_data/logs/moonraker.log:/home/biqu/printer_data/config/moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 00:08:44,983 [confighelper.py:create_backup()] - Backing up last working configuration to '/home/biqu/printer_data/config/.moonraker.conf.bkp'
printer_data/logs/moonraker.log:config_file: /home/biqu/printer_data/confi /moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 00:16:28,551 [confighelper.py:read_file()] - Configuration File '/home/biqu/printer_data/config/moonraker.conf' parsed, total size: 730 B
printer_data/logs/moonraker.log:/home/biqu/printer_data/config/moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 00:16:29,367 [confighelper.py:create_backup()] - Backing up last working configuration to '/home/biqu/printer_data/config/.moonraker.conf.bkp'
printer_data/logs/moonraker.log:config_file: /home/biqu/printer_data/confi /moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 00:20:17,464 [confighelper.py:read_file()] - Configuration File '/home/biqu/printer_data/config/moonraker.conf' parsed, total size: 730 B
printer_data/logs/moonraker.log:/home/biqu/printer_data/config/moonraker.conf
printer_data/logs/moonraker.log:config_file: /home/biqu/printer_data/confi /moonraker.conf
printer_data/logs/moonraker.log:2023-10-27 02:27:06,229 [confighelper.py:read_file()] - Configuration File '/home/biqu/printer_data/config/moonraker.conf' parsed, total size: 730 B
printer_data/logs/moonraker.log:/home/biqu/printer_data/config/moonraker.conf
printer_data/systemd/klipper.env:KLIPPER_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"

I’m not sure about the first message kiauh/docs/changelog.md:Once everything is installed again, you need to manually copy your configuration files from the old ~/klipper_configfolder to the new~/printer_data/config folder. as this is a fresh install.

And finally:

biqu@book:~ $ fgrep -r "/printer_data/gcodes" *
mainsail-config/client.cfg:path: ~/printer_data/gcodes
moonraker/docs/installation.md:path: ~/printer_data/gcodes
moonraker/docs/web_api.md:        "path": "/home/pi/printer_data/gcodes",
printer_data/logs/klippy.log:path = /home/biqu/printer_data/gcodes
printer_data/logs/klippy.log:path = /home/biqu/printer_data/gcodes
printer_data/config/printer.cfg:path: /home/biqu/printer_data/gcodes

Other than the strange message I noted above, I don’t see anything out of place.

Sorry, I hit “Reply” before I fully reviewed everything.

There is one other thing that jumps out at me as being strange, the second line of the fgrep -r "/printer_data/config" * response:

kiauh/scripts/mainsail.sh:    target_folders+=("${HOME}/printer_data/confi ")

I would imagine that the target folders should include .../printer_data/gcodes and not .../printer_data/confi .

Yeah, saw this as well but I do not think it is the root of your issues. Check the file and compare https://github.com/dw-0/kiauh/blob/899b204dc746b16055d00faa633cbf4a8b8a3bf3/scripts/mainsail.sh#L455

Really weird, sorry no clue currently.

From the GitHub link:

and from the mainsail.sh on the CM4:

I was looking at this already and don’t see any differences here.

Try running https://github.com/Arksine/moonraker/blob/master/scripts/data-path-fix.sh

Now we’re getting somewhere:

biqu@book:~ $ curl -sSL https://raw.githubusercontent.com/Arksine/moonraker/master/scripts/data-path-fix.sh | bash
Error: unable to find config: /home/biqu/klipper_config/moonraker.conf
biqu@book:~ $ ls klipper_config -l
ls: cannot access 'klipper_config': No such file or directory

Why do you think klipper_config is not there (after the fresh install) and why is it wasn’t there after the original update?

Hmm, on second thought, this is not applicable. klipper_config is legacy before moving to printer_data

Try deleting printer_data/database/* and then run

./install-moonraker.sh -r

from the moonraker/scripts folder

Edit: Forgot the -r option

Did

biqu@book:~ $ sudo rm printer_data/database/*

Followed by:

biqu@book:~ $ ./moonraker/scripts/install-moonraker.sh


###### Running apt-get update...
Hit:1 http://raspbian.raspberrypi.com/raspbian bookworm InRelease
Hit:2 http://archive.raspberrypi.com/debian bookworm InRelease
Reading package lists... Done
W: http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.


###### Installing Moonraker Dependencies:


###### python3-virtualenv python3-dev python3-libgpiod liblmdb-dev libopenjp2-7 libsodium-dev zlib1g-dev libjpeg-dev packagekit wireless-tools curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-virtualenv is already the newest version (20.17.1+ds-1).
python3-dev is already the newest version (3.11.2-1).
python3-libgpiod is already the newest version (1.6.3-1+rpi1+b2).
liblmdb-dev is already the newest version (0.9.24-1).
libopenjp2-7 is already the newest version (2.5.0-2).
libsodium-dev is already the newest version (1.0.18-1).
zlib1g-dev is already the newest version (1:1.2.13.dfsg-1).
libjpeg-dev is already the newest version (1:2.1.5-2).
packagekit is already the newest version (1.2.6-5).
wireless-tools is already the newest version (30~pre9-14).
curl is already the newest version (7.88.1-10+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


###### Installing python virtual environment...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Ignoring tornado: markers 'python_version == "3.7"' don't match your environment
Ignoring pillow: markers 'python_version == "3.7"' don't match your environment
Ignoring streaming-form-data: markers 'python_version == "3.7"' don't match your environment
Requirement already satisfied: tornado==6.3.3 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 3)) (6.3.3)
Requirement already satisfied: pyserial==3.4 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 4)) (3.4)
Requirement already satisfied: pyserial-asyncio==0.6 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 5)) (0.6)
Requirement already satisfied: pillow==10.0.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 7)) (10.0.1)
Requirement already satisfied: lmdb==1.4.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 8)) (1.4.1)
Requirement already satisfied: streaming-form-data==1.13.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 10)) (1.13.0)
Requirement already satisfied: distro==1.8.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 11)) (1.8.0)
Requirement already satisfied: inotify-simple==1.3.5 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 12)) (1.3.5)
Requirement already satisfied: libnacl==1.8.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 13)) (1.8.0)
Requirement already satisfied: paho-mqtt==1.6.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 14)) (1.6.1)
Requirement already satisfied: zeroconf==0.69.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 15)) (0.69.0)
Requirement already satisfied: preprocess-cancellation==0.2.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 16)) (0.2.0)
Requirement already satisfied: jinja2==3.1.2 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 17)) (3.1.2)
Requirement already satisfied: dbus-next==0.2.3 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 18)) (0.2.3)
Requirement already satisfied: apprise==1.3.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (1.3.0)
Requirement already satisfied: ldap3==2.9.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 20)) (2.9.1)
Requirement already satisfied: smart-open>=6.0 in ./moonraker-env/lib/python3.11/site-packages (from streaming-form-data==1.13.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 10)) (6.4.0)
Requirement already satisfied: ifaddr>=0.1.7 in ./moonraker-env/lib/python3.11/site-packages (from zeroconf==0.69.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 15)) (0.2.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./moonraker-env/lib/python3.11/site-packages (from jinja2==3.1.2->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 17)) (2.1.3)
Requirement already satisfied: certifi in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2023.7.22)
Requirement already satisfied: requests in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2.31.0)
Requirement already satisfied: requests-oauthlib in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (1.3.1)
Requirement already satisfied: click>=5.0 in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (8.1.7)
Requirement already satisfied: markdown in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.5)
Requirement already satisfied: PyYAML in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (6.0.1)
Requirement already satisfied: pyasn1>=0.4.6 in ./moonraker-env/lib/python3.11/site-packages (from ldap3==2.9.1->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 20)) (0.5.0)
Requirement already satisfied: charset-normalizer<4,>=2 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.3.1)
Requirement already satisfied: idna<4,>=2.5 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2.0.7)
Requirement already satisfied: oauthlib>=3.0.0 in ./moonraker-env/lib/python3.11/site-packages (from requests-oauthlib->apprise==1.3.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.2.2)


###### Initializing Moonraker Data Path at /home/biqu/printer_data


###### Installing PolKit Rules


###### PolicyKit Version 122 Detected


###### Installing PolicyKit Rules to /usr/share/polkit-1/rules.d/moonraker.rules...


###### Launching Moonraker API Server...

Tried dragging and dropping in a gcode file, no difference it still ends up in the config folder.

Rebooted the system and tried again: with identical results.

Sorry no luck here.

Sorry, no further idea right now. :man_shrugging:

New data point: I just set up a Raspberry Pi 4B with the same installation I did with the CM4:

  • Load SD Card with Raspberry Pi OS 32-Bit Lite from Raspberry Pi Imager
  • sudo apt update
  • sudo apt upgrade -y
  • sudo apt-get install git -y
  • git clone https://github.com/dw-0/kiauh.git
  • ./kiauh/kiauh.sh and then installed Klipper, Moonraker & Mainsail
  • git clone https://github.com/Arksine/Katapult
  • sudo apt install python3-serial

Went to the Mainsail web page and dragged a gcode file into it and:

Things work the way I expect them to.

I’m repeating the install process again on an unconnected CM4 to see if there is a difference there.

Any other ideas?

Just did a fresh install on a stand alone CM4, tried dragging and dropping a gcode file into it:

Now, the software installation process seemed to go very quickly - I’ve been doing emails while things have been going on here.

Thoughts on next steps?

@Sineos

I reloaded everything again using the process above on the printer and…

Everything seems to be working now.

Any idea why doing an update (from Mainsail) followed by a reimaging yesterday would have a problem? I know it’s not a precise observation - but it took an awfully long time to do the updates (in excess of an hour) and the imaging of the new SD Card took over two hours.

I did email while it was going on so I didn’t go to the next step absolutely immediately but the three times I imaged SD Cards today, I was about to do each in around 30 minutes (38 minutes for the last one, what is shown in the screen shot above) while working at the same time. So, again, there was definitely a difference in the amount of time taken but I don’t have a precise number nor did I look for any specific messages.

My only guess is that something either didn’t install or was a corrupted install for the problem update and imaging done yesterday. Thoughts?

I guess this is resolved as I’ve gone through the process four times now (on three printers and one stand alone Raspberry Pi) without an issue.

Fully agree, this is quite strange. However I do not have an idea or explanation how and under which circumstances such is possible.
“Unfortunately” it solved itself, so we probably never find out.

1 Like

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