ApolloSchemaDownloader.run Fails After Upgrading to Apollo iOS 0.44.0

Hello, we recently updated Apollo iOS to 0.44.0, but codegen using Swift scripting is now failing. Here’s the output:

**[DEBUG - ApolloCodegenLib:CLIDownloader.swift:72] - Downloading zip file with the CLI...**

**2021-07-06 15:29:58.717009-0600 Codegen[77203:4668352] [logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags**

**2021-07-06 15:29:58.717573-0600 Codegen[77203:4668352] [logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags**

**2021-07-06 15:29:58.722605-0600 Codegen[77203:4668352] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=77203**

**2021-07-06 15:29:58.722713-0600 Codegen[77203:4668352] SecTaskCopyDebugDescription: Codegen[77203]/0#-1 LF=0**

**2021-07-06 15:29:58.781263-0600 Codegen[77203:4668352] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=77203**

**2021-07-06 15:29:58.781377-0600 Codegen[77203:4668352] SecTaskCopyDebugDescription: Codegen[77203]/0#-1 LF=0**

**2021-07-06 15:29:58.912642-0600 Codegen[77203:4669499] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 140.82.113.3:443 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed**

**2021-07-06 15:29:58.912786-0600 Codegen[77203:4669499] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 140.82.113.3:443 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed**

**2021-07-06 15:29:59.104521-0600 Codegen[77203:4668352] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 185.199.109.154:443 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed**

**2021-07-06 15:29:59.104560-0600 Codegen[77203:4668352] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 185.199.109.154:443 ready socket-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed**

**(lldb)**

Per the help doc, I verified that all folders exist at the correct path. Any other obvious things I should look at before digging in deeper?

Seems quite odd that SQLite is mentioned anywhere in here, there’s zero use of it by the library directly (I can’t speak for the filesystem itself), and I’ve never seen logs like that before.

I think the [connection] logs are coming from deep within URLSession - I’ve seen them in a couple other places where someone is not able to connect because of issues with app transport security, but if you’re just creating a command line app that shouldn’t be an issue.

I would start by looking at permissions in the directory where you’re trying to download stuff and its parent directories - are they all set to allow you to write to that directory? After that I’d compare your setup to the example setup we have here to see if anything jumps out at you.

If nothing comes from any of that, could you share your swift script? Thanks!

1 Like

Thanks, @designatednerd. I’ll start with the permissions and then go from there. I will say we setup this codegen probably a year or so ago, so it looks significantly different than the setup you linked to. If the permissions don’t do the trick, I’ll work to update our codegen to match the template.

After digging into this, we were able to resolve the issue by increasing the downloadTimeout on ApolloSchemaOptions from 1.0 to 10.0. It appears that the size of our database schema has increased. Such a simple fix!

Thanks for your help, @designatednerd.