# Tip: Cryptic macOS file error

**URL:** <https://discourse.nodered.org/t/tip-cryptic-macos-file-error/96036>\
**Category:** General\
**Created:** [16 March 2025 17:24 UTC](https://discourse.nodered.org/t/tip-cryptic-macos-file-error/96036 "2025-03-16T17:24:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hepcat72](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hepcat72/32/8078_2.png) [@hepcat72](https://discourse.nodered.org/u/hepcat72)\
**Post date:** [16 March 2025 17:24 UTC](https://discourse.nodered.org/t/tip-cryptic-macos-file-error/96036/1 "2025-03-16T17:24:52Z")

</div>

Just thought I'd share a tip I just learned while investigating why one of my flows randomly stopped working back on Feb 21, 2025. This may have coincided with a macOS update...

I previously dealt with a file access issue after an update to Sonoma that is well described in my post on the [Apple Developer Forum](https://developer.apple.com/forums/thread/760291) (you may or may not need an account to access it?). Briefly, on top of file system permissions, you need to grant file access to a process (`node`). Basically, you have to add `node` to either `Files and Folders` or `Full Disk Access` in the System Settings, and check the access you want to grant it. There is a specific `iCloud Drive` toggle under `Files and Folders`.

I have a flow that writes to a file in iCloud Drive. I had no reason to believe that anything about that file had changed, so it took me awhile to figure out why my `file` node was throwing the following cryptic error:

```auto
failed to write to file: Error: Unknown system error -11: Unknown system error -11, open '/Users/robleach/Library/Mobile Documents/com~apple~CloudDocs/Automations/SpokenReminders/motion_reminder_active_states.txt'

```

It turned out to have been simple: the file's permissions (via some mysterious means) had been changed to read only. My guess is that a recent macOS update had changed it due to some security policy, but I don't know for sure. I was able to add write permission via `chmod` and everything was good to go.

Since googling (even portions of) that error yields no relevant results, I figured I wanted to post _somewhere_ about it. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 June 2025 17:25 UTC](https://discourse.nodered.org/t/tip-cryptic-macos-file-error/96036/2 "2025-06-14T17:25:17Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
