Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Network Extension fails starting with NEVpnConnectionError.PluginFailed #27037

Closed
giovannisch opened this issue Jan 9, 2025 · 0 comments
Closed
Labels
platform/iOS 🍎 t/bug Something isn't working

Comments

@giovannisch
Copy link

Description

I'm working on creating an application for iOS, that establishes a VPN connection via a custom protocol.
I created a main project (the app container) which includes a secondary project (the Network Extension).
In the secondary project I created a class which inherits from NEPacketTunnelProvider, in which is overridden the method StartTunnel (so the first method that should be called as soon as the extension starts).

The problem is that when I launch the app for the first time after installation in Release mode (in Debug configuration it never happened) and I try to start a new VPN connection sometimes (the fact that I can't consistently reproduce the problem prevents me from deriving much information on the cause of the problem) it fails to establish the connection.

Then, in the main application, after the call to vpnTunnelProviderManager.Connection.StartVpnTunnel(startOptions, out var error) (which returns true anyway) I call await vpnTunnelProviderManager.Connection.FetchLastDisconnectErrorAsync() it throws a NSErrorException ex with ex.Domain equals to "NEVpnConnectionError" the and ex.Code equals to 12 (which corresponds to NEVpnConnectionError.PluginFailed code).

It doesn't always happen, however, I would say it happens about 10% of the time.

Apple documentation about this failure code is nearly 0 (https://developer.apple.com/documentation/networkextension/nevpnconnectionerror/pluginfailed) and from the logs I think the Network Extension is not being lunched.

This is the most I could get out of device logs.
Image

I tested it on an iPhone 15 and iPad (10th generation) both with OS version 18.2.1.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.100 SR10

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 18.2.1

Did you find any workaround?

No response

Relevant log output

@giovannisch giovannisch added the t/bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants