VPN automatically disconnects on iOS 16.5+

Since upgrading the system to iOS 16.5+, when the device storage space is seriously insufficient, the VPN will be forcibly disconnected and stopTunnel will not be called.

A few colleagues and I tested products from several different companies and all had the same problem. How should we get around it?

23:01:26.000901+0800    PacketTunnel    nw_protocol_tcp_log_summary [C10.1.1:3] 
    [5663B3D8-E097-4FE1-8E53-B56B45A8F902 <private>:49887<-><private>:443]
    Init: 1, Conn_Time: 44.751ms, SYNs: 1, WR_T: 0/0, RD_T: 0/0, TFO: 0/0/0, ECN: 0/0/0, TS: 1, TSO: 0
    rtt_cache: process, rtt_upd: 4, rtt: 20.875ms, rtt_var: 12.000ms rtt_nc: 38.593ms, rtt_var_nc: 21.437ms base rtt: 8ms
    ACKs-compressed: 0, ACKs delayed: 0 delayed ACKs sent: 0
23:01:26.000935+0800    PacketTunnel    nw_protocol_tcp_disconnect [C10.1.1:3] send disconnect to input protocol
23:01:26.000972+0800    PacketTunnel    nw_flow_disconnected [C10 IPv4#10918632:443 cancelled parent-flow ((null))] Output protocol disconnected
23:01:26.000999+0800    PacketTunnel    nw_endpoint_handler_cancel [C10.1 Hostname#099ac075:443 ready resolver (satisfied (Path is satisfied), interface: en0[802.11], scoped, ipv4, dns)]
23:01:26.001223+0800    PacketTunnel    nw_association_schedule_deactivation <nw_association Hostname#099ac075:443> will become dormant after 10000ms of inactivity
23:01:26.001247+0800    PacketTunnel    nw_endpoint_handler_cancel [C10.1.1 IPv4#10918632:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0[802.11], scoped, ipv4, dns)]
23:01:26.001336+0800    PacketTunnel    nw_association_schedule_deactivation <nw_association IPv4#10918632:443> will become dormant after 10000ms of inactivity
23:01:26.001365+0800    PacketTunnel    nw_protocol_tcp_disconnect [C10.1.1:3] input protocol initiated disconnect
23:01:26.001427+0800    PacketTunnel    nw_connection_report_state_with_handler_on_nw_queue [C10] reporting state cancelled
23:01:26.001527+0800    PacketTunnel    Connection 10: done
23:01:26.001573+0800    PacketTunnel    [C10 Hostname#099ac075:443 tcp, url hash: f279b86d, tls, definite, attribution: developer] dealloc
23:01:26.001650+0800    PacketTunnel    tcp_output [C10.1.1:3] flags=[F.] seq=2497755765, ack=631888768, win=2048 state=FIN_WAIT_1 rcv_nxt=631888768, snd_una=2497755734
23:01:26.022263+0800    PacketTunnel    tcp_input [C10.1.1:3] flags=[F.] seq=631888768, ack=2497755765, win=245 state=FIN_WAIT_1 rcv_nxt=631888768, snd_una=2497755734
23:01:26.022464+0800    PacketTunnel    tcp_output [C10.1.1:3] flags=[F.] seq=2497755765, ack=631888769, win=2048 state=CLOSING rcv_nxt=631888769, snd_una=2497755765
23:01:36.014524+0800    PacketTunnel    nw_association_schedule_deactivation_block_invoke <nw_association Hostname#099ac075:443> becoming dormant
23:01:36.014708+0800    PacketTunnel    nw_association_schedule_deactivation_block_invoke <nw_association IPv4#10918632:443> becoming dormant
23:01:44.587233+0800    runningboardd   Requesting plugIn hold for <RBSProcessPredicate <RBSProcessBundleIdentifiersPredicate| {(
    "x.y.z.Shortcuts",
    "x.y.z",
    "x.y.z.PacketTunnel"
)}>>
23:01:44.587261+0800    runningboardd   skipping plugin hold for termination request without bundle ID or beforeTranslocationBundlePath <RBSProcessPredicate <RBSProcessBundleIdentifiersPredicate| {(
    "x.y.z.Shortcuts",
    "x.y.z",
    "x.y.z.PacketTunnel"
)}>>
23:01:44.587543+0800    runningboardd   Acquiring assertion targeting system from originator [osservice<com.apple.mobile.cache_delete_app_container_caches>:400] with description <RBSAssertionDescriptor| "CacheDeleteAppContainerCaches requesting termination assertion for x.y.z" ID:31-400-9890 target:system attributes:[
    <RBSPreventLaunchLimitation| <RBSProcessPredicate <RBSProcessBundleIdentifiersPredicate| {(
    "x.y.z.Shortcuts",
    "x.y.z",
    "x.y.z.PacketTunnel"
)}>> allow:(null)>
    ]>
23:01:44.588473+0800    runningboardd   Executing termination request for: <RBSProcessPredicate <RBSProcessBundleIdentifiersPredicate| {(
    "x.y.z.Shortcuts",
    "x.y.z",
    "x.y.z.PacketTunnel"
)}>>
23:01:44.590075+0800    runningboardd   [xpcservice<x.y.z.PacketTunnel([osservice<com.apple.neagent-ios>:998:998])>:1455] Terminating with context: <RBSTerminateContext| code:0xBADDD15C explanation:CacheDeleteAppContainerCaches requesting termination assertion for x.y.z reportType:None maxTerminationResistance:NonInteractive attrs:[
    <RBSPreventLaunchLimitation| <RBSProcessPredicate <RBSProcessBundleIdentifiersPredicate| {(
    "x.y.z.Shortcuts",
    "x.y.z",
    "x.y.z.PacketTunnel"
)}>> allow:(null)>
    ]>
23:01:44.591253+0800    neagent Extension x.y.z.PacketTunnel died unexpectedly

when the device storage space is seriously insufficient

What do you specifically mean by this? Do you mean that there is absolutely no disk space left on the device or that it's being utilized up to 80%? If there is absolutely no storage left on the device I could see where things would start failing because data in some cases is being updated on disk. I suspect other extensions and apps will have issues too until storage is freed up on disk.

VPN automatically disconnects on iOS 16.5+
 
 
Q