#Error: An unexpected error occurred during post-processing

8 messages · Page 1 of 1 (latest)

tranquil sluice
#

Vcore 3.1 500 IDEX. Was working fine before updating ratos. seems trivial, hopefully it is.
I'm using an orangePi board. I know... but it is working fine. until now.

I just updated my ratos (it has been a while). I re-sliced a file and now I'm getting this error in the logs. I'm unable to print any files. all have this exdev error.

{"level":50,"time":1746683589892,"pid":6531,"hostname":"ratos","source":"cli","err":{"type":"Error","message":"EXDEV: cross-device link not permitted, rename '/tmp/zx-dd6anrb2pzu' -> '/home/pi/printer_data/gcodes/cali_1-r_0.2mm_ABS_14m15s.gcode'","stack":"Error: EXDEV: cross-device link not permitted, rename '/tmp/zx-dd6anrb2pzu' -> '/home/pi/printer_data/gcodes/cali_1-r_0.2mm_ABS_14m15s.gcode'\n    at Object.renameSync (node:fs:1035:3)\n    at _Command.<anonymous> (file:///home/pi/ratos-configurator/app/bin/ratos.mjs:109626:13)\n    at async _Command.parseAsync (file:///home/pi/ratos-configurator/app/bin/ratos.mjs:1781:9)\n    at async file:///home/pi/ratos-configurator/app/bin/ratos.mjs:110104:3","errno":-18,"syscall":"rename","code":"EXDEV","path":"/tmp/zx-dd6anrb2pzu","dest":"/home/pi/printer_data/gcodes/cali_1-r_0.2mm_ABS_14m15s.gcode"},"msg":"Unexpected error while processing gcode file"}

I think it may have to do with my tmp directory not being on the same filesystem as my sd?

The fix would seem to be, have the postprocessor use a directory that is on the same device. (Perhaps /home/pi/printer_data/gcodes/tmp) Is there a way to specify this?
I'm not sure why the tmp location would differ on my opi vs the rpi. but this must be it. Any ideas? Thanks for your time.

dire dirgeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

tranquil sluice
#

I FIXED IT. It appears to be a bug in how the postprocessor tries to rename a file using node.js, which can't be on a different device (ie ramdisk). I modified the TMPDIR environment variable for this function to point to a tmp directory on the sdcard for the process_gcode_file function in ratos.py. This way the function works as it should since the files are on the same device. See below:

I created /home/pi/printer_data/gcodes/tmp Then I edited ratos.py located at /home/pi/ratos-configurator/configuration/klippy/ratos.py under the function def process_gcode_file I modified with the following

        import os
        env = os.environ.copy()
        env["TMPDIR"] = "/home/pi/printer_data/gcodes/tmp"
        process = subprocess.Popen(
            args,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            env=env
        )

Hopefully this helps anyone who had this issue. I thought maybe it's because I'm runinng an opi, but rpi should use the same ramfs for tmp. so, I'm not sure why mine was different. mabye @shrewd parcel could look at this and see if I'm just crazy. Anyways, great os, great printer! Just glad to be printing again!

dire dirgeBOT
tranquil sluice
#

maybe something can be done so I don't have to keep a dirty repo? (and anyone else as well?)

shrewd parcel
#

the latter should be symlinked to ~/.profile.d/ratos.sh, you can just edit that instead

#

~/.ratos.env won't override values in /usr/local/etc/.ratos.env, only keys that aren't already set are loaded.