Skip to content

Commit

Permalink
feat(apple): add troubleshooting for Cocoapods user script sandbox se…
Browse files Browse the repository at this point in the history
…tup (#12742)
  • Loading branch information
philprime authored Feb 19, 2025
1 parent 2efa3ab commit f386233
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/platforms/apple/common/install/cocoapods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ end
```

Afterwards run `pod install`.

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.
24 changes: 24 additions & 0 deletions docs/platforms/apple/common/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ SentrySDK.start { options in
options.swizzleClassNameExcludes = ["RoomPlanWrapper"]
}
```

```objc {tabTitle:Objective-C}
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.swizzleClassNameExcludes = [NSSet setWithObjects: @"RoomPlanWrapper", nil];
Expand Down Expand Up @@ -156,3 +157,26 @@ say it is due to a bug in Xcode 15.4. They recommend sticking to Xcode 15.3 unti
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.
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.
## Sandbox Error Using Cocoapods
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:
```
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')
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')
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')
mkdir -p <path/to/your/app>/Frameworks
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"
building file list ... done
rsync: opendir "<path/to/your/app>/Frameworks/Sentry.framework/Sentry.bundle" failed: Operation not permitted (1)
IO error encountered -- skipping file deletion
Sentry.framework/_CodeSignature/CodeResources
rsync: mkstemp "<path/to/your/app>/Frameworks/Sentry.framework/_CodeSignature/.CodeResources.a2sA9v" failed: Operation not permitted (1)

sent 15034 bytes received 42 bytes 30152.00 bytes/sec
total size is 4950281 speedup is 328.36
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]
```

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 comments on commit f386233

Please sign in to comment.