Error: Could not decode a text frame as UTF-8

Hello everyone,

I am using Repetier Server 1.1.0 Pro (Trial) on an RPi 3B+, language is English.

Upon first install it works ok for some time, but then the web interface becomes unusable.  It constantly says "Connection lost, reconnecting" and if I look at the Dev tools I can see:

WebSocket connection to 'ws://192.168.0.6/socket/?lang=en&sess=Z6DUYzJM1j2dd1%23*7JHcroA%25!Gd*%23V%262' failed: Could not decode a text frame as UTF-8.

The printers are ok and SSH is ok.  Restarting does not help.  This is not due to some weird language text or names, it just randomly happens.  I reinstalled, and it happened again randomly after a while. The touch UI is fine, though.  The only solution is to reinstall.

Please provide a remedy, this is not hardware related as I tried another Raspberry Pi and some issue.


Comments

  • The problem is that browser disconnect websockets if they contain non UTF-8 chars. We only allow utf-8 t o flow in or at least we try to prevent it. Can you say what you did when the problem started? That ist most likely the point where you injected non UTF-8 chars. E.g. did you upload a file with strange filename (non ascii).This normally works but you never know. 

    As a test you can login vie ssh and rename your printer data
    sudo -i
    cd /var/lib/Repetier-Server/printer
    mv <yourprinterslugname>  <yourprinterslugname>_tmp
    service RepetierServer restart

    When it then starts to work it comes from one of the printer files in that folder.

    You can rename folder back and go deeper to see what file it could be causing it.

    What also could help is checking websocket that was aborted and see the last frames. See which actions are open so we know one of the open actions - most likely the next one in order to be answered is causing it.
  • That did work, thank you.  I did not upload any unusual files, but I did notice something - I had renamed one of my printers right before the issue and the folder inside /var/lib/Repetier-Server/printer was still the old name.  By removing the old (incorrectly) named folder, the issue was resolved.

    Another thing I noticed - I accidentally selected a .stl file and not the .gcode (dumb mistake, both were side by side) and doing so attempts to start the print but produces tons of printer errors, it might be a good idea to add a check to the web interface to stop "printing" .stl files via direct print.
  • The internal name in fie system never changes since there might be references to it. It is also not always the same - it does not contain non ascii chars to eliminate any problems. It is just change in config so it is displayed with new name.

    Will check what I can do with the stl check. But that is not easy I fear. At least if it should work with all kind of wrong files.
  • I have confirmed this, I can reproduce the issue by uploading an .STL with the "Direct Print" option, any STL file will cause the server to fail as mentioned.  So yeah, user error but maybe some simple file selection box restriction to .gcode extension would be good. 
  • You mean printing stl files cause UTF-8 error? Will try.
  • Ok found it. Sending binary stl causes the problem until you restart server. Will check and fix this way.
Sign In or Register to comment.