Uploading over http gives "No buffer space available" errors

Hi,

I'm uploading with a NSURLSessionUploadTask using a stream body and getting many "No buffer space available" errors.

I'm uploading files to a google drive bucket with a PUT from a catalyst app on osx. It looks like the connection might be using quic, and I'm doing parallel uploads to the same host.

Does an http connection that choses to use quic expose me to a bunch of unexpected UDP errors?

Might it be a bug causing the stream body to not be buffered correctly, as a file would. Might it be being all read at once?

Or might something else on my system be interfering with the available socket memory?

When it does work it's really very fast but it keeps falling over.

Any suggestions as to how best avoid/fix this?

Thanks,

Paul

getting many "No buffer space available" errors.

To clarify, does this mean that your NSURLSession task is failing with that error? If so, what does the actual error look like? If you can catch this in the debugger, use po to print the error and then post the results here.

Share and Enjoy

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

Yes - taskDidComplete is called with no response and a NSPOSIXErrorDomain error 55 "No buffer space available"

But annoyingly it is not happening today so I can't give you a better error report - I have updated to macOS 12.6 yesterday so maybe it has been fixed, or maybe my office connection is being more heavily shared today so I'm not managing to do such high upload speeds.

What I am seeing today is many connection failures, more than I'd normally expect, and in the console am seeing [quic] and [connection] error messages. I don't know if this is related at all to the 55 errors.

Frustrating - I will send you the 55 error if/when it happens again.

2022-09-15 11:51:47.738190+0100 Edit Board[5383:92489] [quic] _quic_packet_builder_calculate_size packet builder has frames, but none of those frames fit in this packet
---snip
2022-09-15 11:51:49.862534+0100 Edit Board[5383:92489] [quic] _quic_packet_builder_calculate_size packet builder has frames, but none of those frames fit in this packet
2022-09-15 11:51:49.862577+0100 Edit Board[5383:92489] [quic] quic_send_frames_for_key_state no frame fit in current MSS
2022-09-15 11:51:49.863415+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.392817+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.392920+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.392974+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"

---snip
2022-09-15 11:51:50.393870+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.393972+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.397263+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.397354+0100 Edit Board[5383:92489] [connection] nw_read_request_report [C121] Receive failed with error "Software caused connection abort"
2022-09-15 11:51:50.400492+0100 Edit Board[5383:92489] Task <F1C6819F-2456-4684-8584-8A90B8B4E409>.<12> HTTP load failed, 3146053/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400541+0100 Edit Board[5383:92489] Task <0427D095-65A8-430D-A670-59994A49A031>.<8> HTTP load failed, 3146053/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400569+0100 Edit Board[5383:92489] Task <E640CD17-0CC1-4699-B54C-AFCA94BC9567>.<1> HTTP load failed, 3146052/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400593+0100 Edit Board[5383:92489] Task <DDC1F245-87AC-454C-85E9-C7FCD194CE18>.<4> HTTP load failed, 3146054/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400669+0100 Edit Board[5383:92489] Task <0A42C4A6-F341-4D98-AF65-6CF6040BB4F4>.<11> HTTP load failed, 3146052/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400710+0100 Edit Board[5383:92489] Task <7BAE10A2-EAED-42C1-9783-49E5E1EA5D97>.<2> HTTP load failed, 3146054/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400738+0100 Edit Board[5383:92489] Task <CC590885-4B6A-4D1A-A63F-A86BD43C4506>.<6> HTTP load failed, 3146052/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.400764+0100 Edit Bo2022-09-15 11:51:50.400814+0100 Edit Board[5383:92694] Task <F1C6819F-2456-4684-8584-8A90B8B4E409>.<12> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=53, NSUnderlyingError=0x6000021f6a90 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x600000c536b0 [0x7ff8484f4d70]>{length = 16, capacity = 16, bytes = 0x100201bb8efabbea0000000000000000}, _kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <F1C6819F-2456-4684-8584-8A90B8B4E409>.<12>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalUploadTask <F1C6819F-2456-4684-8584-8A90B8B4E409>.<12>"
), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://www.googleapis.com/upload/storage/v1/b/editboard-upload-multi-europe-development/o?uploadType=resumable&name=3f1fc9f4-f7af-415b-91f8-194dda32817c&upload_id=ADPycduDNUqq04vCHR-n8w0fL4HG7jZ8x3lKp7o47vQvsVItYaOcUNzMKDlP8Os6zr-JL7mUCFLdDim-xJqnZuKHlmaxp32G9BQs, NSErrorFailingURLKey=https://www.googleapis.com/upload/storage/v1/b/editboard-upload-multi-europe-development/o?uploadType=resumable&name=3f1fc9f4-f7af-415b-91f8-194dda32817c&upload_id=ADPycduDNUqq04vCHR-n8w0fL4HG7jZ8x3lKp7o47vQvsVItYaOcUNzMKDlP8Os6zr-JL7mUCFLdDim-xJqnZuKHlmaxp32G9BQs, _kCFStreamErrorDomainKey=1}
ard[5383:92489] Task <6224B48D-D4C3-45C7-A54B-D867AFF5AA5E>.<10> HTTP load failed, 3146053/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.415515+0100 Edit Board[5383:92489] Task <A48BD58E-BC32-4C22-8462-57666072A7A7>.<9> HTTP load failed, 3146053/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.415558+0100 Edit Board[5383:92489] Task <BDA94CE7-02E2-4265-AD28-9AE06CFA8536>.<13> HTTP load failed, 3146053/0 bytes (error code: -1005 [1:53])
2022-09-15 11:51:50.415591+0100 Edit Board[5383:92489] Task <9EC1A20D-F55D-4167-BD0D-2A3BE7A5D43F>.<5> HTTP load failed, 3146051/0 bytes (error code: -1005 [1:53])

But annoyingly it is not happening today

Such is the life of a network support person (-:

If you see this again, please trigger a sysdiagnose log as soon as you see it. That’s the best way to gather all the info that Apple’s engineering teams need to investigate errors like this.

You might also consider installing the Network Diagnostics profile, to enable more logging in this space.

For more info on both of these, see our Bug Reporting > Profiles and Logs page.

Share and Enjoy

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

Thanks for the suggestions - I'll have a look at the network profiling stuff and try a useful log of whats happening next week.

P

I have generated a sysdiagnose log hopefully capturing the -1005 error and uploaded it, along with the console output to the Apple feedbackassistant. Issue 11617842. 

I hope this is helpful - I have not seen the "No buffer space available" error again since last week. 

Thanks

Paul

I have also got a log of the NSPOSIXErrorDomain error 55 "No buffer space available" and have uploaded the sysdiagnose to feedbackassistant issue #11618968

It would be helpfully to have the option to turn off http/3 for a request until this is stable as it makes connecting to servers offering http/3 slower than http 1. if I could back off to http1 when I see these errors it would be good.

P

Hi @eskimo - any news about this? A bug or me doing something wrong?

Thanks,

P

A bug or me doing something wrong?

IMO this has always looked like a bug on our side. The ongoing analysis in FB11617842 seems to confirm that. Unfortunately I don’t have info to share as to when we’ll ship a fix.

Share and Enjoy

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

Thanks for the update - I'll keep an eye on the FB issues

Hi @eskimo

FYI there was a fix in iOS 16.2 that seems to have stopped the dropped connections when using quic. Possibly (I'm sort of guessing) at the expense of rate limiting quic uploads but it isn't broken any more.

Thanks you for your help in resolving this. It's actually nice that Apple are responsive to bug reports, as many are not.

Paul

FYI there was a fix in iOS 16.2 that seems to have stopped the dropped connections when using quic.

That gels with my reading of FB11617842. Yay!

Share and Enjoy

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

Uploading over http gives "No buffer space available" errors
 
 
Q