(SOLVED) Can’t open script in iCloud Drive from iPhone, only iPad

I’ve successfully created an action that reads a javascript file from the drafts folder in my iCloud Drive with the require() function. This all works flawlessly on my iPad. However on my iPhone, when I run the action drafts gives me the error message ‘Script error: Error: The file “script.js” couldn’t be opened.’ When I open the files app on my iPhone I find the file in my Drafts/Scripts folder just like I do on my iPad. I don’t understand why one works and the other fails. What am I missing?

TLDR: iPhone drafts can’t open script file from iCloud Drive, but iPad can. Why?!

Definitely not normal.

Have you tried deleting and recreating the file. Could perhaps be some sort of permission glitch from iCloud sync?

Failing that, can you create an action that writes to and reads from that folder? I’m wondering if a more direct file access test like this might provide a more meaningful error message. Hopefully a “why” as to what is stopping the file from now being opened.

There is definitively something weird going on here. On my iPhone drafts can not access the iCloud folders at all.

I made a simple file write action. Works on iPad. Not on iPhone.

I also tried writing directly to the Drafts folder. Same problem.

Looks like this is a problem with iCloud Drive on my IPhone, not with Drafts. I can browse files in iCloud Drive in the files app, but I can’t open them on my phone.

Try rebooting the phone. It sounds like an error I get a lot. I don’t know what triggers it, but a reboot always fixes it.

I turned iCloud Drive off and on - no dice. Then I tried turning iCloud Drive off, rebooting and then turning it on - and it works! Maybe it was just the reboot, as you suggested. Thanks for the help guys!

1 Like

Glad it’s sorted. There’s been a number of issues around corrupt app permissions for iCloud Drive with the various OS updates this Fall…looks like you got hit with one of them.

Sometimes just a reboot fixes. Sometimes toggling off-on the iCloud Drive permissions specifically for the app affected it enough to fix as well.

Typically it will not reoccur once cleared.

I don’t think it’s even specific to iCloud Drive. I got the same thing using Working Copy the Git client. Seems to be some bug in the file subsystem somewhere.