App occasionally fails to connect to Access Point (iPhone17 / iOS26)

Hi,

My app uses the NetworkExtension framework to connect to an access point.

For some reason, my app occasionally fails to find and/or connect to my AP (which I know is online and beaconing on a given frequency). This roughly happens 1/10 times.

I am using an iPhone 17, running iOS 26.0.1. I am connecting to a WPA2-Personal network.

In the iPhone system logs, I see the following:

Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: Dequeuing command type: "Scan" pending commands: 0
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceCopyPreparedScanResults: network records count: 0
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: WiFi infra  associated, NAN DISABLED, , DFS state Off, IR INACTIVE, llwLink ACTIVE, RTM-DP 0,  allowing scans
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: isScanDisallowedByAwdl[1148] : InfraScanAllowed 1 (RTModeScan 0 NonSteering 0 assistDisc 0 HTMode 0 RTModeNeeded 0 Immin 0 ScanType 1 Flags 0 ScanOn2GOnly 0 DevAllows2G 1)
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: IO80211PeerManager::setScanningState:5756:_scanningState:0x2(oldState 0) on:1, source:ScanManagerFamily, err:0
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: setScanningState:: Scan request from ScanManagerFamily. Time since last scan(1.732 s)  Number of channels(0), 2.4 only(no), isDFSScan 0, airplaying 0, scanningState 0x2
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: IO80211PeerManager::setScanningState:5756:_scanningState:0x2(oldState 0) on:1, source:ScanManagerFamily, err:0
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: Controller Scan Started, scan state  0 -> 2
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: IO80211PeerManager::setScanningState:5756:_scanningState:0x0(oldState 2) on:0, source:ScanError, err:3766617154
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: setScanningState[23946]:: Scan complete for source(8)ScanError. Time(0.000 s), airplaying 0, scanningState 0x0 oldState 0x2 rtModeActive 0 (ProxSetup 0 curSchedState 3)
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: IO80211PeerManager::setScanningState:5756:_scanningState:0x0(oldState 2) on:0, source:ScanError, err:3766617154
Oct 10 10:34:10 kernel()[0] <Notice>: wlan0:com.apple.p2p: Controller  Scan Done, scan state  2 -> 0
Oct 10 10:34:10 wifid(IO80211)[54] <Notice>: Apple80211IOCTLSetWrapper:6536 @[35563.366221] ifname['en0'] IOUC type 10/'APPLE80211_IOC_SCAN_REQ', len[5528] return -528350142/0xe0820442
Oct 10 10:34:10 wifid[54] <Notice>: [WiFiPolicy] {SCAN-} Completed Apple80211ScanAsync on en0 (0xe0820442) with 0 networks
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Error>: __WiFiDeviceCreateFilteredScanResults: null scanResults
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceCreateFilteredScanResults: rssiThresh 0, doTrimming 0, scanResultsCount: 0, trimmedScanResultsCount: 0, filteredScanResultsCount: 0, nullNetworksCount: 0
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceManagerDispatchUserForcedAssociationCallback: result 1
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Error>: __WiFiDeviceManagerForcedAssociationCallback: failed to association error 1
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: WiFiLocalizationGetLocalizedString: lang='en_GB' key='WIFI_JOIN_NETWORK_FAILURE_TITLE' value='Unable to join the network
\M-b\M^@\M^\%@\M-b\M^@\M^]'
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: WiFiLocalizationGetLocalizedString: lang='en_GB' key='WIFI_FAILURE_OK' value='OK'
Oct 10 10:34:10 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceManagerUserForcedAssociationScanCallback: scan results were empty

It looks like there is a scan error, and I see the error: failed to association error 1.

I have also seen the iOS device find the SSID but fail to associate (associated error 2):

Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Notice>: __WiFiMetricsManagerCopyLinkChangeNetworkParams: updating AccessPointInfo: {
    DeviceNameElement = testssid;
    ManufacturerElement = " ";
    ModelName = " ";
    ModelNumber = " ";
}
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Notice>: __WiFiMetricsManagerCopyLinkChangeNetworkParams: minSupportDataRate 6, maxSupportDataRate 54
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Error>: Disassociated.
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Error>: __WiFiMetricsManagerUpdateDBAndSubmitAssociationFailure: Failed to append deauthSourceOUI to CA event
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Error>: __WiFiMetricsManagerUpdateDBAndSubmitAssociationFailure: Failed to append bssidOUI to CA event
..... <log omitted>
..... <log omitted>
Oct  8 12:25:52 wifid(CoreWiFi)[54] <Notice>: [corewifi] END REQ [GET SSID] took 0.005530542s (pid=260 proc=mediaplaybackd bundleID=com.apple.mediaplaybackd codesignID=com.apple.mediaplaybackd service=com.apple.private.corewifi-xpc qos=21 intf=(null) uuid=D67EF err=-528342013 reply=(null)
Oct  8 12:25:52 SpringBoard(SpringBoard)[244] <Notice>: Presenting a CFUserNotification with reply port: 259427 on behalf of: wifid.54
Oct  8 12:25:52 SpringBoard(SpringBoard)[244] <Notice>: Received request to activate alertItem: <SBUserNotificationAlert: 0xc20a49b80; title: Unable to join the network
\M-b\M^@\M^\\134^Htestssid\134^?\M-b\M^@\M^]; source: wifid; pid: 54>
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceManagerUserForcedAssociationCallback: failed forced association
Oct  8 12:25:52 SpringBoard(SpringBoard)[244] <Notice>: Activation - Presenting <SBUserNotificationAlert: 0xc20a49b80; title: Unable to join the network
\M-b\M^@\M^\\134^Htestssid\134^?\M-b\M^@\M^]; source: wifid; pid: 54> with presenter: <SBUnlockedAlertItemPresenter: 0xc1d9f6530>
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Notice>: __WiFiDeviceManagerDispatchUserForcedAssociationCallback: result 2
Oct  8 12:25:52 SpringBoard(SpringBoard)[244] <Notice>: Activation - Presenter:<SBUnlockedAlertItemPresenter: 0xc1d9f6530> will present presentation: <SBAlertItemPresentation: 0xc1cd40820; alertItem: <SBUserNotificationAlert: 0xc20a49b80; presented: NO>; presenter: <SBUnlockedAlertItemPresenter: 0xc1d9f6530>>
Oct  8 12:25:52 wifid(WiFiPolicy)[54] <Error>: __WiFiDeviceManagerForcedAssociationCallback: failed to association error 2

Anyone able to help with this?

Answered by DTS Engineer in 864219022
Sorry for the late response!

No worries. I have plenty of other things to do (-:

We have not seen the issue when we connect to the AP through Settings > Wi-Fi.

OK.

The reason I asked is that here on the Apple Developer Forums our primary focus is on APIs. If you were able to reproduce the problem in Settings then that’d eliminate any possibility that your iOS code is incorrect.

Without being able to reproduce it in Settings, it’s possible that this is a bug in your app (you occasionally pass in the wrong Wi-Fi details) or in the Network Extension layer that you’re calling (as opposed to the core Wi-FI layer that does all the heavy lifting here).

However, the actual error you’re seeing here, failed to association error 1, is a strong indication of an issue in the core Wi-Fi code. If I’m reading it right, that error 1 means ‘fail to find the network’. Which gels with the __WiFiDeviceCreateFilteredScanResults messages prior to that.

Given that, it’s not something can help you with. As I mentioned earlier, our focus here is on APIs. I have a couple of suggestions for you:

  • You can file a bug requesting that Apple’s Wi-Fi engineering team look into this.
  • You can investigate the on-the-‘wire’ behaviour yourself.

And there’s nothing stopping you from doing both.

If you do file a bug:

  • Make sure to enable additional Wi-Fi logging via the Wi-Fi for iOS/iPadOS debug profile on our Bug Reporting > Profiles and Logs page.
  • Attach a sysdiagnose log taken on the affected device immediately after seeing the problem.
  • Post your bug number here, just for the record.

If you want to dig into this yourself, you’ll neet to investigate this at the Wi-Fi level. Recording a Wi-Fi Packet Trace explains how you can do this with your Mac, but you might have better tools for this elsewhere, for example, on the AP itself.

It’s possible that your investigation will indicate a problem on the iOS side, in which case you’ll have better evidence, like a Wi-Fi packet trace, to include in your bug report (-:

Share and Enjoy

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

If you manually join the access point, using Settings > Wi-Fi, do you see the same 10% failure rate?

Share and Enjoy

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

Sorry for the late response!

We have not seen the issue when we connect to the AP through Settings > Wi-Fi. However, we have done some more testing, and it seems very sporadic in the sense that we are sometimes unable to reproduce it at all.

Sorry for the late response!

No worries. I have plenty of other things to do (-:

We have not seen the issue when we connect to the AP through Settings > Wi-Fi.

OK.

The reason I asked is that here on the Apple Developer Forums our primary focus is on APIs. If you were able to reproduce the problem in Settings then that’d eliminate any possibility that your iOS code is incorrect.

Without being able to reproduce it in Settings, it’s possible that this is a bug in your app (you occasionally pass in the wrong Wi-Fi details) or in the Network Extension layer that you’re calling (as opposed to the core Wi-FI layer that does all the heavy lifting here).

However, the actual error you’re seeing here, failed to association error 1, is a strong indication of an issue in the core Wi-Fi code. If I’m reading it right, that error 1 means ‘fail to find the network’. Which gels with the __WiFiDeviceCreateFilteredScanResults messages prior to that.

Given that, it’s not something can help you with. As I mentioned earlier, our focus here is on APIs. I have a couple of suggestions for you:

  • You can file a bug requesting that Apple’s Wi-Fi engineering team look into this.
  • You can investigate the on-the-‘wire’ behaviour yourself.

And there’s nothing stopping you from doing both.

If you do file a bug:

  • Make sure to enable additional Wi-Fi logging via the Wi-Fi for iOS/iPadOS debug profile on our Bug Reporting > Profiles and Logs page.
  • Attach a sysdiagnose log taken on the affected device immediately after seeing the problem.
  • Post your bug number here, just for the record.

If you want to dig into this yourself, you’ll neet to investigate this at the Wi-Fi level. Recording a Wi-Fi Packet Trace explains how you can do this with your Mac, but you might have better tools for this elsewhere, for example, on the AP itself.

It’s possible that your investigation will indicate a problem on the iOS side, in which case you’ll have better evidence, like a Wi-Fi packet trace, to include in your bug report (-:

Share and Enjoy

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

Thanks very much for looking into this! I have now filed a bug: FB20976002.

I do have a PCAP already that confirms the SSID is beaconing on the given channel, but there is no activity (e.g. probe request) coming from the iOS device, so I would guess there is something going on on the iOS side here. :)

I have attached both syslogs (pulled with idevicesyslog while reproducing) and a PCAP to the bug. Hopefully this is sufficient. Otherwise I will see if I can enable additional Wi-Fi Logging.

@sengui Tagging you here as I am for some reason unable to add a comment in the above thread.

Regarding FB20976002, I can let you know here once I get a response from Apple.

Would you mind sharing how the problem manifests itself in your case? Do you see the same logs (e.g. "failed to association error 1/2"?

for some reason unable to add a comment in the above thread.

You’re bumping into a known problems with the forums (i. 098923968). Your comments were applied, but the page failed to refresh, so there are not lots of copies of the same comment )-:

I generally recommend that you avoid using comments. See tip 5 in Quinn’s Top Ten DevForums Tips.

I have now filed a bug: FB20976002.

Thanks.

Otherwise I will see if I can enable additional Wi-Fi Logging.

Given that you have solide evidence that this is a client-side issue, that additional logging is likely to be quite important.

Share and Enjoy

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

for some reason unable to add a comment in the above thread.

You’re bumping into a known problems with the forums (i. 098923968). Your comments were applied, but the page failed to refresh, so there are now a lot of copies of the same comment )-:

I generally recommend that you avoid using comments, although for different reasons. See tip 5 in Quinn’s Top Ten DevForums Tips.

I have now filed a bug: FB20976002.

Thanks.

Otherwise I will see if I can enable additional Wi-Fi Logging.

Given that you have solid evidence that this is a client-side issue, that additional logging is likely to be quite important.

Also, I don’t see any actual sysdiagnose logs attached to you bug. It’s really important that you include those because:

  • The text copies of the system log that you attached contain much less information that what’s captured by a sysdiagnose log.
  • Apple’s bug tracking system uses the sysdiagnose log to run various automated processes.

Share and Enjoy

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

App occasionally fails to connect to Access Point (iPhone17 / iOS26)
 
 
Q