terminate called after throwing an instance of 'json_spirit::Error_position'

Server is running on RPi B+ with a 32 GB SD card. After sometime like an hour or so, the server disconnection message appears and the server tries to reconnect every 40 seconds. On running
export LC_ALL=C
sudo -u repetierserver /usr/local/Repetier-Server/bin/RepetierServer -c /usr/local/Repetier-Server/etc/RepetierServer.xml

The following log is generated (The server fails to start. The last line indicates an error after which the restart process is terminated. Any suggestions on this will help. Repetier-Server v35 for Bullseye is on the RPi):
Read configuration file /usr/local/Repetier-Server/etc/RepetierServer.xml
Testing alternative config: "/usr/local/Repetier-Server/etc/RepetierServer-extra.xml"
Testing alternative config: "/var/lib/Repetier-Server/database/RepetierServer.xml"
Reading server settings...
9:40:10.113: Repetier-Server 1.4.8
9:40:10.115: Imported external command Shutdown Server
9:40:10.115: Imported external command Reboot Server
9:40:10.115: Imported allowed execute command shutdown
9:40:10.116: Imported allowed execute command reboot
9:40:10.116: Webdirectory: /usr/local/Repetier-Server/www/
9:40:10.116: Storage directory: /var/lib/Repetier-Server/
9:40:10.116: Configuration file: /usr/local/Repetier-Server/etc/RepetierServer.xml
9:40:10.116: Directory for temporary files: /tmp/
9:40:10.117: Reading firmware data ...
9:40:10.386: Starting Network ...
9:40:10.391: Active features:0
9:40:10.391: Starting user database ...
9:40:10.394: Reading printer configurations ...
9:40:10.411: Reading printer config /var/lib/Repetier-Server/configs/WL216A_Printer.xml
9:40:10.420: Starting printjob manager thread for WL216A_Printer
9:40:10.423: Starting printer threads ...
9:40:10.423: Starting printer thread for WL216A_Printer
9:40:10.423: Starting work dispatcher subsystem ...
9:40:10.426: Importing projects ...
9:40:10.427: Initializing LUA ...
9:40:10.428: Starting wifi watcher ...
9:40:10.433: Register LUA cloud services
9:40:10.434: add G-Code-Renderer
9:40:10.434: LUA initalization finished.
9:40:10.435: Setting up MQTT Client ...
9:40:10.435: Starting web server ...
9:40:10.435: Work dispatcher thread started.
9:40:10.437: Internal work dispatcher thread started.
9:40:10.438: Webserver started.
terminate called after throwing an instance of 'json_spirit::Error_position'
Aborted

Comments

  • Ok that is hard to say from this info. json_spirit is the library used for dataexchange so always used when communication starts and that is exactly when it happens. To narrow it down you need to start it in debugger, but first login via ssh to the raspberry and update it to latest version with:
    installLatestServer

    If you have no gdb command install it with
    sudo apt install gdb

    Now start it in debugger if it still does not work. Enter
    export LC_ALL=C
    sudo gdb --args /usr/local/Repetier-Server/bin/RepetierServer -c /usr/local/Repetier-Server/etc/RepetierServer.xml

    Then when gdb is started add these 2 commands:

    set env LC_ALL=C
    r

    it will crash and now run

    bt

    sometimes this shows an endless list. We only need the start where lines differ. That way we can say in which function it is crashing to narrow the source.

    Me guess would be the printer configuration file /var/lib/Repetier-Server/configs/WL216A_Printer.xml but it can also be anything else. When you post the backtrace I check the code and can say more.
  • Thanks for this @Repetier.  Just want to sat that this needs to be posted as a troubleshooting tip for investigating server crashes.  Especially the repetitive ones!

    GDB gave me the following output and this allowed be to resolve the connection issue I had with the failing printer.  Turns out it was trying to connect to the same printer.  System reboot had readdressed the /dev/ttyUSB* devices.

    -------
    [LWP 11831 exited]
    --Type <RET> for more, q to quit, c to continue without paging--

    Thread 15 "PRT Ender3_S1" received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 11731]
    0x00197190 in repetier::PrinterState::analyseResponse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char&) ()
    (gdb) bt
    #0  0x00197190 in repetier::PrinterState::analyseResponse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char&) ()
    #1  0x00000000 in ?? ()
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    ------

Sign In or Register to comment.