Start An NEPacketTunnelProvider Fail

My App is a VPN APP, use [com.apple.networkextension.packet-tunnel] extension app to provider a VPN service. A problem puzzled me for a long time: Sometimes the VPN doesn't start successfully, until the user restart the iOS System or reinstall my APP.

The detail is : The user use the app normally for many times, and suddenly can't start the vpn service, the APP log show API "startVPNTunnelWithOptions" call success, and return success. but the VPN extension status(NEVPNStatus) change from Disconnect to Connecting and then nothing happen, the VPN process not started, and not any log of the VPN extension created, my VPN log is start from the init function of the class inherit from PacketTunnelProvider, so can see that the vpn process not started.

My NETunnelProviderProtocol is :

    NETunnelProviderProtocol *tunnel = [[NETunnelProviderProtocol alloc] init];
    tunnel.providerBundleIdentifier = kTunBundleId;
    tunnel.serverAddress = @"";
    tunnel.disconnectOnSleep = NO;
    [self.providerManager setEnabled:YES];
    [self.providerManager setProtocolConfiguration:tunnel];
    self.providerManager.localizedDescription = kAppName;

very simple, because my app use openvpn3 to provide the vpn service,so no need to set the serverAddress.

Because when this problem happened, I can't get any useful log (because APP can't get the iOS system log), so this is a really trouble for me. Could any body help !

Answered by icefire_wang in 723436022

The trick here is to have the user trigger a sysdiagnose log as soon as they see the problem. Then can then pass this on to your for analysis. For more information about this, see Your Friend the System Log.

this can get entire iOS system log ? I don't find the way to do this after I read the documents.

I said before:

because APP can't get the iOS system log

means, the log of my app is no useful, because the APP seems ok. The job to start the NetworkExtension Process is not the host APP( MY APP).

Host APP only setup the configuration and call the system API, and the log of my app show nothing wrong here.

The log of my APP shows: when after call startVPNTunnelWithOptions: success, the NEVPNStatus change from NEVPNStatusDisconnected to NEVPNStatusConnecting (from NEVPNStatusDidChangeNotification) but long time (about 1 mins) the VPN Process not created, and status change to disconnect.

So I think if i want to known why the VPN process not create success, I need to got the entiry iOS system log, this may show why the iOS system start the process fail.

Realistically, you’re not going to be able to debug this by looking at your code; you need to see the system log. Apropos that:

because APP can't get the iOS system log

The trick here is to have the user trigger a sysdiagnose log as soon as they see the problem. Then can then pass this on to your for analysis. For more information about this, see Your Friend the System Log.

One key technique here is to use the system log for your own log points, so that you can correlate the failure as you see it from your code with the logging done by the rest of the system.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

The trick here is to have the user trigger a sysdiagnose log as soon as they see the problem. Then can then pass this on to your for analysis. For more information about this, see Your Friend the System Log.

this can get entire iOS system log ? I don't find the way to do this after I read the documents.

I said before:

because APP can't get the iOS system log

means, the log of my app is no useful, because the APP seems ok. The job to start the NetworkExtension Process is not the host APP( MY APP).

Host APP only setup the configuration and call the system API, and the log of my app show nothing wrong here.

The log of my APP shows: when after call startVPNTunnelWithOptions: success, the NEVPNStatus change from NEVPNStatusDisconnected to NEVPNStatusConnecting (from NEVPNStatusDidChangeNotification) but long time (about 1 mins) the VPN Process not created, and status change to disconnect.

So I think if i want to known why the VPN process not create success, I need to got the entiry iOS system log, this may show why the iOS system start the process fail.

his can get entire iOS system log ?

Yes. Quoting the post I referenced previously:

Every sysdiagnose log includes a snapshot of the system log, which is ideal for debugging hard-to-reproduce problems. For more information about sysdiagnose logs, see the info on Bug Reporting > Profiles and Logs.

The resulting sysdiagnose log file is a .tar.gz file. When you unpack that you’ll find a .logarchive file that’s a snapshot of the system log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for your help, I got a issue log

默认	2022-10-04 18:54:48.576621 +0800	nesessionmanager	Got a new session client connection from SecureLink(38652)
默认	2022-10-04 18:54:48.578365 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Adding a connection for client SecureLink[38652]
信息	2022-10-04 18:54:52.068309 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:54:57.049618 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 131072Bps
信息	2022-10-04 18:54:57.049736 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 131072Bps
信息	2022-10-04 18:54:57.049818 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 131072Bps
默认	2022-10-04 18:54:58.074353 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Received a start command from SecureLink[38652]
默认	2022-10-04 18:54:58.075090 +0800	nesessionmanager	Registering session NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]
信息	2022-10-04 18:54:58.075097 +0800	nesessionmanager	Loading configuration with identifier 7484326F-D1AF-42E9-BCFB-F5FBF750D021
信息	2022-10-04 18:54:58.075875 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: enabled = 1
默认	2022-10-04 18:54:58.076153 +0800	nesessionmanager	: Register Enterprise VPN Session: NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]
默认	2022-10-04 18:54:58.076173 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Successfully registered
信息	2022-10-04 18:54:58.081989 +0800	nesessionmanager	 starting with configuration: 
信息	2022-10-04 18:54:58.082178 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] is no longer idle, beginning transaction
信息	2022-10-04 18:54:58.082834 +0800	nesessionmanager	Active session count is greater than 0, setting hasActiveSessions flag
默认	2022-10-04 18:54:58.082882 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: status changed to connecting
信息	2022-10-04 18:55:00.058831 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:00.058995 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:00.059099 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:16.307030 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 65536Bps
信息	2022-10-04 18:55:16.307672 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 65536Bps
信息	2022-10-04 18:55:16.307995 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 65536Bps
信息	2022-10-04 18:55:19.179449 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:19.179502 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:19.179538 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:22.318582 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:55:22.318690 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:55:22.318875 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:55:25.220932 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:25.221080 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:25.221189 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:34.015438 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:34.015567 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:34.015652 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:55:36.352962 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:36.353084 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:55:36.353163 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:01.284121 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 2097152Bps
信息	2022-10-04 18:56:01.284220 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 2097152Bps
信息	2022-10-04 18:56:01.284301 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 2097152Bps
信息	2022-10-04 18:56:04.610959 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:04.611036 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:04.611079 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:07.304120 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:07.304631 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:07.305120 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:10.239430 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:10.239542 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:10.239600 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:46.123889 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:46.125252 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:46.125416 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:52.340200 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:52.340338 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:52.340384 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:56:57.908056 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:57.908128 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:56:57.908174 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:57:00.422055 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:00.426429 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:00.436578 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:04.685925 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:57:04.685996 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:57:04.686033 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 524288Bps
信息	2022-10-04 18:57:07.206120 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 131072Bps
信息	2022-10-04 18:57:07.206222 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 131072Bps
信息	2022-10-04 18:57:07.206280 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 131072Bps
信息	2022-10-04 18:57:10.209973 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:10.210027 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:10.210095 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:16.098539 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:57:16.098664 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive, estimated download: 262144Bps
信息	2022-10-04 18:57:16.098789 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive, estimated download: 262144Bps
默认	2022-10-04 18:57:16.240931 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Received a stop command from SecureLink[38652] with reason 1
信息	2022-10-04 18:57:16.240937 +0800	nesessionmanager	Setting last stop reason to 1
默认	2022-10-04 18:57:16.241202 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Changing pause level 0 -> 1
默认	2022-10-04 18:57:16.246514 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] in state NESMVPNSessionStateIdle: received stop message
默认	2022-10-04 18:57:16.246532 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Leaving state NESMVPNSessionStateIdle
默认	2022-10-04 18:57:16.247433 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Entering state NESMVPNSessionStateStopping, timeout 20 seconds
默认	2022-10-04 18:57:16.247489 +0800	nesessionmanager	: Request to uninstall session: NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]
默认	2022-10-04 18:57:16.247514 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: status changed to disconnecting
默认	2022-10-04 18:57:16.247571 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Updated network agent (inactive, compulsory, not-user-activiated, not-kernel-activated)
默认	2022-10-04 18:57:16.248703 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Leaving state NESMVPNSessionStateStopping
默认	2022-10-04 18:57:16.248765 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Entering state NESMVPNSessionStateDisposing, timeout 5 seconds
默认	2022-10-04 18:57:16.248806 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] in state NESMVPNSessionStateDisposing: no plugins to dispose
默认	2022-10-04 18:57:16.248820 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Leaving state NESMVPNSessionStateDisposing
默认	2022-10-04 18:57:16.248836 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Entering state NESMVPNSessionStateIdle
信息	2022-10-04 18:57:16.248878 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] is now idle, ending transaction
信息	2022-10-04 18:57:16.248881 +0800	nesessionmanager	Active session count is equal to 0, clearing hasActiveSessions flag
默认	2022-10-04 18:57:16.248944 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: status changed to disconnected, last stop reason Stop command received
信息	2022-10-04 18:57:16.249571 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Request to clear network agent from all interfaces
默认	2022-10-04 18:57:16.251719 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Received a start command from SecureLink[38652]
默认	2022-10-04 18:57:16.251751 +0800	nesessionmanager	Registering session NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]
信息	2022-10-04 18:57:16.251759 +0800	nesessionmanager	Loading configuration with identifier 7484326F-D1AF-42E9-BCFB-F5FBF750D021
信息	2022-10-04 18:57:16.251868 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: enabled = 1
默认	2022-10-04 18:57:16.253087 +0800	nesessionmanager	: Register Enterprise VPN Session: NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]
默认	2022-10-04 18:57:16.253107 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Successfully registered
默认	2022-10-04 18:57:16.253120 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: Changing pause level 1 -> 0
信息	2022-10-04 18:57:16.254446 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] starting with configuration: {
    name = <10-char-str>
    identifier = 7484326F-D1AF-42E9-BCFB-F5FBF750D021
    applicationName = SecureLink
    application = xxxxxx
    grade = 1
    VPN = {
        enabled = YES
        onDemandEnabled = NO
        disconnectOnDemandEnabled = NO
        onDemandUserOverrideDisabled = NO
        protocol = {
            type = plugin
            identifier = 77CCDCFF-6583-4448-8354-B79DD37A842C
            serverAddress = <0-char-str>
            identityDataImported = NO
            disconnectOnSleep = NO
            disconnectOnIdle = NO
            disconnectOnIdleTimeout = 0
            disconnectOnWake = NO
            disconnectOnWakeTimeout = 0
            includeAllNetworks = NO
            excludeLocalNetworks = YES
            enforceRoutes = NO
            pluginType = xxxxx
            authenticationMethod = 0
            reassertTimeout = 0
            providerConfiguration = {
                ovpn = {length = 4659, bytes = 0x636c6965 6e740a64 65762074 756e0a70 ... 35302039 30303100 }
            }
            providerBundleIdentifier = xxxxx
        }
        tunnelType = packet
    }
}
信息	2022-10-04 18:57:16.254632 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)] is no longer idle, beginning transaction
信息	2022-10-04 18:57:16.254641 +0800	nesessionmanager	Active session count is greater than 0, setting hasActiveSessions flag
默认	2022-10-04 18:57:16.254663 +0800	nesessionmanager	NESMVPNSession[Primary Tunnel:SecureLink:7484326F-D1AF-42E9-BCFB-F5FBF750D021:(null)]: status changed to connecting
信息	2022-10-04 18:57:18.503528 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:18.503671 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:18.503735 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[nr_sa_sub6], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:20.521631 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [0D46363F-2B83-4D93-98AA-35C4349A663F  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[lte], scoped, ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:20.521789 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [85A1973C-66EC-4467-9C92-BBEC84652437  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[lte], ipv4, ipv6, dns, expensive
信息	2022-10-04 18:57:20.521893 +0800	nesessionmanager	nw_path_necp_update_evaluator_block_invoke [88040277-1449-4D9B-8BCC-50DAB4DE2A05  generic, attribution: developer]
	path: satisfied (Path is satisfied), interface: pdp_ip0[lte], scoped, ipv4, ipv6, dns, expensive
It seems to be stuck by nw_path_necp_update_evaluator_block_invoke could you tell me what is this, and how can I avoid this.

Hello, I have the same question. The user use the app normally for many times, and suddenly can't start the vpn service, the APP log show API "startVPNTunnelWithOptions" call success, and return success.But the TunnelExtension process is not running, and there is nothing in the logs I have logged in the PacketTunnelProvider.Is there a solution to this problem now?

     [NETunnelProviderManager loadAllFromPreferencesWithCompletionHandler:^(NSArray<NETunnelProviderManager *> * _Nullable managers, NSError * _Nullable error) {
        if (managers.count > 0) {
            self.manager = [managers objectAtIndex:0];
            self.manager.localizedDescription = @"APP-VPN";
            self.manager.enabled = YES;
            self.manager.onDemandEnabled = YES;
        } else {
            NETunnelProviderProtocol *protocol = [[NETunnelProviderProtocol alloc] init];
            protocol.providerBundleIdentifier = @"com.***.***.extension";
            protocol.serverAddress = controlUrl;
            self.manager = [[NETunnelProviderManager alloc] init];
            self.manager.protocolConfiguration = protocol;
            self.manager.localizedDescription = @"APP-VPN";
            self.manager.enabled = YES;
            self.manager.onDemandEnabled = YES;
        }
        WS(weakSelf);
        [self.manager saveToPreferencesWithCompletionHandler:^(NSError * __nullable error) {
            SS(strongSelf);
            if (error) {
                NSLog(@"Error when saveToPreferencesWithCompletionHandler: %@", error);
            } else {
                    [strongSelf.manager loadFromPreferencesWithCompletionHandler:^(NSError * _Nullable error)  {
                            NSError *startError = nil;
                            BOOL isSucces = [strongSelf.manager.connection startVPNTunnelWithOptions:settDic andReturnError:&startError];
                            if (isSucces) {
                                NSLog(@"success");
                            } else {
                                NSLog(@"startError");
                            }
                    }];
                }
        }];
    }];
Start An NEPacketTunnelProvider Fail
 
 
Q