Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watched folder / Watchdog causes TypeError when plugin is enabled #321

Closed
ido-nl opened this issue Dec 26, 2021 · 2 comments
Closed

Watched folder / Watchdog causes TypeError when plugin is enabled #321

ido-nl opened this issue Dec 26, 2021 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@ido-nl
Copy link

ido-nl commented Dec 26, 2021

Using Dashboard version 1.19.5 on my Raspberry Pi - Octoprint v1.7.2,
OctoPi Version 0.17.0, running on Raspberry Pi 3 Model B Rev 1.2

  • When I start my Pi with Octoprint it connects the watched folder to a folder on my NAS.
  • It used to process the files and add them to the print queue, now it renames the files to .failed
  • When I add files to my NAS folder (watched folder) when the Pi is already running, it works as expected.
  • It used to work without any issues, not sure when it stopped.
  • I am sure it is the dashboard plugin, I tried to enable/disable the plugins one by one, and this one caused it, after disabling it, no error. Enable the plugin, error returns.

I get this error

2021-12-25 12:45:19,893 - octoprint.server.util.watchdog - ERROR - There was an error while processing the file /home/pi/.octoprint/watched/idotest1.gcode in the watched folder
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/util/watchdog.py", line 162, in _upload
    allow_overwrite=True,
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/filemanager/__init__.py", line 743, in add_file
    display=display,
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/filemanager/storage.py", line 909, in add_file
    file_object.save(file_path)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/filemanager/util.py", line 105, in save
    shutil.copyfileobj(source, dest)
  File "/home/pi/oprint/lib/python3.7/shutil.py", line 79, in copyfileobj
    buf = fsrc.read(length)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/filemanager/util.py", line 217, in read
    processed_line = self.process_line(line)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_dashboard/__init__.py", line 68, in process_line
    if re.match(self.layer_move_pattern, line) is not None:
  File "/home/pi/oprint/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object

Hope it can be fixed, gotten used to the nice dashboard.

@ido-nl ido-nl added the bug Something isn't working label Dec 26, 2021
@j7126
Copy link
Owner

j7126 commented Jan 27, 2022

There was another issue with network filesystems a little while ago #300 that I was unable to figure out the cause of, not sure if it is the same issue here, but I will have to take a look.

j7126 added a commit that referenced this issue Mar 10, 2022
@j7126 j7126 added this to the 1.20.0 milestone Mar 10, 2022
@j7126
Copy link
Owner

j7126 commented Mar 10, 2022

Hi @ido-nl

It seems that for some reason the gcode was not being decoded correctly when being loaded from the NAS. I have added an extra check to make sure that it is properly decoded, which should fix the issue.

This change will be included in the next release, you can try it out by installing the version from development branch https://github.com/j7126/OctoPrint-Dashboard/archive/development.zip

Please let me know if this solves the problem.

@j7126 j7126 closed this as completed Jul 25, 2023
@j7126 j7126 modified the milestones: 1.20.0, 1.19.10 Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants