apple / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.27k stars 1.13k forks source link

[SR-10593] Getting SecTaskLoadEntitlements error #3425

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-10593
Radar None
Original Reporter dvreid72 (JIRA User)
Type Bug
Environment Xcode 10.2 Swift 5.0 Vapor 3.+
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 443a4f28f443bf02cd0356c3b2eb9457

Issue Description:

Using Vapor 3.0 an error comes up on a http get request from a RESTful API.

2019-04-25 10:19:21.140809-0500 Run[3144:571110] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=3144
2019-04-25 10:19:21.140870-0500 Run[3144:571110] SecTaskCopyDebugDescription: Run[3144]/0#-1 LF=0

I have 3 calls that are similar and only one is getting the error (first time it is called).

Tanner0101 from Vapor did some digging:

"Hmm... this must be coming from URLSession. I can't think of anything else here that would be using Security.framework. Might be worth reporting to bugs.swift.org."

swift-ci commented 5 years ago

Comment by Doug Reid (JIRA)

function where the error arises:

func getOrganizationTournamentsByAPI(req: Request) -> Future\<[Tournament]> {
print("Get Org Tournaments by API")
let organizationID = try)
let client = try! req.make(Client.self)
let url = "http://localhost:8080/api/organizations/(organizationID)/tournaments"
print("Org Tournament API URL: (url)")
let res = client.get(url).flatMap { tournamentResponse -> Future\<[Tournament]> in
print(tournamentResponse.content)
let tourneys = try tournamentResponse.content.decode([Tournament].self)
print(tourneys)
return tourneys
}
return res
}