When printing SD card files, octoprint can not get the correct state of printer by pausing printer printing or canceling printer printing

What is the problem?

  1. When the SD card file is printed by octoprint, the status is normal when the pause button is clicked, and then when the Cancel button is clicked, the octoprint service loses its response, so I can't get the follow-up status. I found the document that I could not click the paused button in octoprint. I needed to click the paused button on the printer. So I went to click the paused button on the printer. At this time, octoprint got the status of Printing from SD, while the printer status was print paused. After I stopped printing on the printer, the octoprint status was still Printing from SD.

  2. Similarly, when my printer connects to octoprint and chooses to print the file, I cancel the printing task directly on the printer, at which time octoprint still gets the state Printing from SD and cannot get the correct state Operational. When I disconnect the printer and reconnect, the printer state becomes Operational.
    What should I do with these situations?How can I get the correct state from octoprint.

What did you already try to solve it?
I can only restart the octoprint service

Logs (octoprint.log, serial.log or output on terminal tab, browser error console ...)
This is the log file for Question 1

2019-10-11 13:55:57,298 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Starting print from SD"
2019-10-11 13:55:57,299 - octoprint.printer.standard.job - INFO - Print job started - origin: sdcard, path: 1-126s.gco, owner: zhangke, user: zhangke
2019-10-11 13:55:57,302 - octoprint.events - INFO - Executing a system command
2019-10-11 13:55:57,357 - octoprint.util.comm - INFO - Changing monitoring state from "Starting print from SD" to "Printing from SD"
2019-10-11 13:55:58,436 - octoprint.plugins.tracking - INFO - Sent tracking event print_started, payload: {'origin': 'sdcard', 'file': '9a39a4e293abc1979176a2154e71c461b1100fab'}
2019-10-11 13:55:59,362 - octoprint.util.comm - INFO - Printer seems to support the busy protocol, will adjust timeouts and set busy interval accordingly
2019-10-11 13:58:19,150 - octoprint.util.comm - INFO - Telling the printer to set the busy interval to our "communicationBusy" timeout - 1s = 2s
2019-10-11 13:59:53,342 - octoprint.util.comm - INFO - Changing monitoring state from "Printing from SD" to "Pausing"
2019-10-11 13:59:53,345 - octoprint.util.comm - INFO - Pausing print job due to command M25
2019-10-11 13:59:56,552 - octoprint.printer.standard.job - INFO - Print job paused - origin: sdcard, path: 1-126s.gco, owner: zhangke, user: zhangke
2019-10-11 13:59:56,555 - octoprint.events - INFO - Executing a system command
2019-10-11 13:59:56,559 - octoprint.util.comm - INFO - Changing monitoring state from "Pausing" to "Paused"
2019-10-11 14:00:42,180 - octoprint.util.comm - INFO - Changing monitoring state from "Paused" to "Cancelling"
2019-10-11 14:00:42,184 - octoprint.printer.standard.job - INFO - Print job cancelled - origin: sdcard, path: 1-126s.gco, owner: zhangke, user: zhangke
2019-10-11 14:00:42,187 - octoprint.util.comm - INFO - Pausing print job due to command M25
2019-10-11 14:00:42,193 - octoprint.events - INFO - Executing a system command
2019-10-11 14:00:43,559 - octoprint.plugins.tracking - INFO - Sent tracking event print_cancelled, payload: {'origin': 'sdcard', 'file': '9a39a4e293abc1979176a2154e71c461b1100fab', 'elapsed': 284}
2019-10-11 14:00:45,378 - octoprint.plugins.tracking - INFO - Sent tracking event print_failed, payload: {'origin': 'sdcard', 'reason': 'cancelled', 'file': '9a39a4e293abc1979176a2154e71c461b1100fab', 'elapsed': 284}

This is the log file for Question 2
2019-10-11 14:02:41,226 - octoprint.plugins.tracking - INFO - Sent tracking event printer_connected, payload: {u'printer_baudrate': 0, u'printer_port': u'AUTO', 'firmware_name': 'Marlin Creality 3D'}
2019-10-11 14:02:42,670 - octoprint.printer.standard.job - INFO - Print job selected - origin: sdcard, path: 1-126s.gco, owner: carl, user: carl
2019-10-11 14:02:45,413 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Starting print from SD"
2019-10-11 14:02:45,414 - octoprint.printer.standard.job - INFO - Print job started - origin: sdcard, path: 1-126s.gco, owner: carl, user:carl
2019-10-11 14:02:45,420 - octoprint.events - INFO - Executing a system command
2019-10-11 14:02:45,483 - octoprint.util.comm - INFO - Changing monitoring state from "Starting print from SD" to "Printing from SD"
2019-10-11 14:02:47,532 - octoprint.util.comm - INFO - Printer seems to support the busy protocol, will adjust timeouts and set busy interval accordingly
2019-10-11 14:04:08,993 - octoprint.util.comm - INFO - Telling the printer to set the busy interval to our "communicationBusy" timeout - 1s = 2s

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ...)
Ender-3s printer, OctoPrint 1.3.11,