What would cause "IPC Failed" error (localized description) when trying to load the VPN preferences

Here is the error, 2017-07-25 16:12:00.647170-0500 VPNTestApp[14285:5551926] [] -[NEConfigurationManager loadC:1673 Failed to load configurations: Error Domain=NEConfigurationErrorDomain Code=11 "IPC failed" UserInfo={NSLocalizedDescription=IPC failed}


The code is very simple. I have a single view app in Xcode 9 beta 3 (also happens in xcode 8). In the overridden function, viewWillAppear, I execute the function call:

vpnManager.loadFromPreferences(completionHandler: self.vpnLoadHandler)


vpnManager has been set with by executing:

let vpnManager = NEVPNManager.shared()


Have tried with Swift 3 & 4. Network Extensions have been been added as has Personal VPN. Xcode is being run on a Macbook Pro, osx 10.12.5

What would cause "IPC Failed" error …

That’s a very weird error. Does it persist after you restart the device?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Yes, it persists on the device as well as in the XCode simulator.

Honestly, I’m at a loss here. I tried what you suggested, at least as far as I can tell, and it works just fine. Here’s exactly what I did:

  1. I’m working with Xcode 9.0b4 running on macOS 10.12.6 targeting iOS 11.0b4.

  2. I created a new app from the iOS > Single View App template.

  3. In the Capabilities tab of the target editor, I enabled Personal VPN.

  4. In

    ViewController.swift
    I added the following code to the end of the
    viewDidLoad()
    method:
    NEVPNManager.shared().loadFromPreferences { (error) in
        if let error = error as NSError? {
            NSLog("error, %@ / %d", error.domain, error.code)
            return
        }
        NSLog("success")
    }

    I also added an import of the

    NetworkExtension
    framework so that it would compile.
  5. I ran the app on the device.

As expected, it printed:

2017-08-03 11:26:30.034255+0100 VPNTest[631:181487] success

Please repeat this test and let me know what you get.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi,

ok, I did everything you asked except that my device is 10.3, iTunes does not give me the option to update to 11.0 yet. Everything else was the same. I ran your example code and it worked as you expected. So I then tried your code in the simulator and it failed as it did before. I then tried my code in the simulator and it failed. So I restarted everything, Mac, device, etc. Opened xcode and ran my code first without any simulator ever having been run and I did NOT get the IPC Error. I did however get an error starting the vpn connection, probably because the ip address is a string of x's. 😉 So it appears that the simulator has something to do with this. While I would like to be able to use the simulator, I have limited access to different devices, I can still move forward with what I have. I will just make sure that I use only the actual device. I realize that this is anecdotal only with no real evidence to point a finger at the simulator. But at this point in time I need to move forward with what I know works and not spend time troubleshooting something that may be a configuration issue on my mac. Thank you for your help!

So it appears that the simulator has something to do with this.

Ah, I didn’t realise that you were working with the simulator here. In that case there’s a straightforward answer: Network Extension framework is not supported in the simulator. For more background on why this is the case, see this post.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
What would cause "IPC Failed" error (localized description) when trying to load the VPN preferences
 
 
Q