Skip to content

The issue of Steve's Get Diagnostics request being interrupted when uploading diagnostics.log was interrupted. #444

@GZ-Metal-Cell

Description

@GZ-Metal-Cell

The issue of Steve's "Get Diagnostics" request being interrupted during the upload of diagnostics.log being processed.

I built a simple FTP server using python:

# ftp_server.py
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import TLS_FTPHandler, FTPHandler
from pyftpdlib.servers import FTPServer
import os

authorizer = DummyAuthorizer()
authorizer.add_anonymous(os.getcwd(), perm="elradfmw")
authorizer.add_user("test", "test", os.getcwd(), perm="elradfmw")

handler = FTPHandler
handler.authorizer = authorizer

address = ("0.0.0.0", 21)
server = FTPServer(address, handler) server.serve_forever()

After Steve sends the Get Diagnostics request, the client displays:


[MO] Recv: [2,"0efec649-021a-4816-b0f5-338aa91f5988","GetDiagnostics",{"location":"ftp://test:test@192.168.2.71/"}]

[MO] info (DiagnosticsService.cpp:173): Scheduled Diagnostics upload!

location = ftp://test:test@192.168.2.71/diagnostics.log

retries = 1, retryInterval = 180 startTime = 1970-01-01T00:00:00Z

stopTime = 2027-02-06T05:33:58Z
[MO] debug (DiagnosticsService.cpp:185): Initial try at 2026-02-06T05:34:03Z
[MO] Send: [3,"0efec649-021a-4816-b0f5-338aa91f5988",{"fileName":"diagnostics.log"}]
[MO] debug (DiagnosticsService.cpp:66): Call onUpload
[MO] debug (DiagnosticsService.cpp:376): discovered 8 files
[MO] debug (FtpMbedTLS.cpp:508): init upload ftp://test:test@192.168.2.71/diagnostics.log
[MO] debug (FtpMbedTLS.cpp:833): parsed dir: ; fname: diagnostics.log
[MO] debug (FtpMbedTLS.cpp:858): parsed user: test; pass: te***
[MO] debug (FtpMbedTLS.cpp:875): parsed host: 192.168.2.71; port: 21
[MO] debug (FtpMbedTLS.cpp:578): RECV: 220 pyftpdlib 2.1.0 ready.
[MO] debug (FtpMbedTLS.cpp:612): select user test
[MO] debug (FtpMbedTLS.cpp:433): SEND: USER test
[MO] debug (FtpMbedTLS.cpp:578): RECV: 331 Username ok, send password.
[MO] debug (FtpMbedTLS.cpp:615): enter pass te***
[MO] debug (FtpMbedTLS.cpp:433): SEND: PASS ***
[MO] Send: [2,"1d976162-d4d0-4756-9d80-0f32d4a4b88a","DiagnosticsStatusNotification",{"status":"Uploading"}]
[MO] debug (FtpMbedTLS.cpp:578): RECV: 230 Login successful.
[MO] debug (FtpMbedTLS.cpp:618): select directory /
[MO] debug (FtpMbedTLS.cpp:433): SEND: CWD /
[MO] debug (FtpMbedTLS.cpp:578): RECV: 250 "/" is the current directory.
[MO] debug (FtpMbedTLS.cpp:621): enter passive mode
[MO] debug (FtpMbedTLS.cpp:433): SEND: PASV
[MO] debug (FtpMbedTLS.cpp:578): RECV: 227 Entering passive mode (192,168,2,71,207,22).
[MO] debug (FtpMbedTLS.cpp:647): request upload for diagnostics.log
[MO] debug (FtpMbedTLS.cpp:433): SEND: STOR diagnostics.log
[MO] debug (FtpMbedTLS.cpp:578): RECV: 125 Data connection already open. Transfer starting.
[MO] debug (FtpMbedTLS.cpp:657): data connection accepted
[MO] debug (DiagnosticsService.cpp:458): upload diag chunk (513B)
[MO] Recv: [3,"1d976162-d4d0-4756-9d80-0f32d4a4b88a",{}]
[MO] ERROR (FtpMbedTLS.cpp:552): FTP transfer aborted
[MO] debug (DiagnosticsService.cpp:458): upload diag chunk (513B)
[MO] debug (DiagnosticsService.cpp:458): upload diag chunk (513B)
[MO] ERROR (FtpMbedTLS.cpp:766): mbedtls_ssl_write: -78
[MO] debug (FtpMbedTLS.cpp:372): closing data conn
[MO] info (DiagnosticsService.cpp:466): FTP upload failure (2)
[MO] debug (FtpMbedTLS.cpp:433): SEND: QUIT

[MO] ERROR (FtpMbedTLS.cpp:453): fatal - message on ctrl channel lost: 0,

[MO] warning (DiagnosticsService.cpp:99): Upload timeout or failed

[MO] debug (DiagnosticsService.cpp:112): end upload routine (no more retry)

[MO] Send: [2,"714b7c93-9302-4a1f-b52c-b1aa59fc2ee2","DiagnosticsStatusNotification",{"status":"UploadFailed"}]

[MO] Recv: [3,"714b7c93-9302-4a1f-b52c-b1aa59fc2ee2",{}]

At this point, the server will only receive the truncated diagnostics.log:

### AET1P22-BKLW4CS-7kw Hardware Diagnostics - v. V0.0.1
2026-02-06T05:34:03Z

#OCPP
client_version=1.2.0
uptime=47s
ocpp_status_cId0=Available
ocpp_status_cId1=Available
ws_status=connected
ws_last_conn=22s
ws_last_recv=43s
cId1_hasTx=0
ENABLE_CONNECTOR_LOCK=0
ENABLE_FILE_INDEX=0
ENABLE_V201=0

# Filesystem
ws-conn.jsn
system-params.jsn
client-state.jsn
reservations.jsn
test.txt
test.bin
bootstats.jsn
ocpp-config.jsn


# File ocpp-config.jsn:
{"head":{"content-type":"ocpp_config_file","version":"2.0"},"con

The server log is:

[I 2026-02-06 13:33:43] concurrency model: async
[I 2026-02-06 13:33:43] masquerade (NAT) address: None
[I 2026-02-06 13:33:43] passive ports: None
[I 2026-02-06 13:33:43] >>> starting FTP server on 0.0.0.0:21, pid=37516 <<<
[I 2026-02-06 13:34:04] 192.168.2.72:57805-[] FTP session opened (connect)
[I 2026-02-06 13:34:04] 192.168.2.72:57805-[test] USER 'test' logged in.
[I 2026-02-06 13:34:04] 192.168.2.72:57805-[test] CWD D:\Users\Documents\TPV\Codes\Python\ftp 250
[I 2026-02-06 13:34:05] 192.168.2.72:57805-[test] STOR D:\XXX\diagnostics.log completed=0 bytes=513 seconds=1.126

[I 2026-02-06 13:34:05] 192.168.2.72:57805-[test] FTP session closed (disconnect).


I don't quite understand why the log upload was interrupted. Could you please provide some guidance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions