Skip to content

Commit f386233

Browse files
authored
feat(apple): add troubleshooting for Cocoapods user script sandbox setup (#12742)
1 parent 2efa3ab commit f386233

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/platforms/apple/common/install/cocoapods.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ end
1515
```
1616

1717
Afterwards run `pod install`.
18+
19+
If you're using Xcode 14 or later, your project might fail to build due to `error: Sandbox: rsync.samba(42924)`. To resolve this you have to disable the "Enable User Script Sandbox" option in the target settings by setting it to `NO`. See <PlatformLink to="/troubleshooting#sandbox-error-using-cocoapods">Troubleshooting</PlatformLink> for more information.

docs/platforms/apple/common/troubleshooting/index.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ SentrySDK.start { options in
109109
options.swizzleClassNameExcludes = ["RoomPlanWrapper"]
110110
}
111111
```
112+
112113
```objc {tabTitle:Objective-C}
113114
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
114115
options.swizzleClassNameExcludes = [NSSet setWithObjects: @"RoomPlanWrapper", nil];
@@ -156,3 +157,26 @@ say it is due to a bug in Xcode 15.4. They recommend sticking to Xcode 15.3 unti
156157
If the release health page shows fewer events in the unhandled tab, your events miss the unhandled property or mach info; please update the Cocoa SDK to version 8.33.0 or above or stay on version 8.30.0.
157158
158159
We introduced a bug with a refactoring [#4101](https://github.com/getsentry/sentry-cocoa/pull/4101) released in 8.30.1, that caused unhandled/crash events to have the unhandled property and mach info missing, which is required for release health to show events in the unhandled tab. It's essential to mention that this bug doesn't impact release health statistics, such as crash-free session or user rates.
160+
161+
## Sandbox Error Using Cocoapods
162+
163+
After setting up Cocoapods using a `Podfile` and running `pod install` to set up the project, you might see the following error when building the target:
164+
165+
```
166+
error: Sandbox: rsync.samba(42924) deny(1) file-read-data <path/to/your/app>/Frameworks/Sentry.framework/Sentry.bundle (in target 'test' from project 'test')
167+
error: Sandbox: rsync.samba(42925) deny(1) file-read-data <path/to/your/app>/Frameworks/Sentry.framework/_CodeSignature/CodeResources (in target 'test' from project 'test')
168+
error: Sandbox: rsync.samba(42925) deny(1) file-write-create <path/to/your/app>/Frameworks/Sentry.framework/_CodeSignature/.CodeResources.a2sA9v (in target 'test' from project 'test')
169+
mkdir -p <path/to/your/app>/Frameworks
170+
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "<path/to/derived/data>/Sentry/Sentry.framework" "<path/to/your/app>/Frameworks"
171+
building file list ... done
172+
rsync: opendir "<path/to/your/app>/Frameworks/Sentry.framework/Sentry.bundle" failed: Operation not permitted (1)
173+
IO error encountered -- skipping file deletion
174+
Sentry.framework/_CodeSignature/CodeResources
175+
rsync: mkstemp "<path/to/your/app>/Frameworks/Sentry.framework/_CodeSignature/.CodeResources.a2sA9v" failed: Operation not permitted (1)
176+
177+
sent 15034 bytes received 42 bytes 30152.00 bytes/sec
178+
total size is 4950281 speedup is 328.36
179+
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/5bb93434-bef0-11ef-bef2-d285688f7a47/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
180+
```
181+
182+
While it seems to be related to Sentry, it is actually caused by the user script sandbox feature introduced in [Xcode 14](https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes), which is enabled by default. In order to fix this, you need to head to the target settings of your project and set the "Enable User Script Sandbox" option to `NO`.

0 commit comments

Comments
 (0)