You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NSInvalidArgumentException: *** -[NSURL initFileURLWithPath:]: nil string parameter
?, in -[RCTVideo playerItemForSource:withCallback:]
?, in __19-[RCTVideo setSrc:]_block_invoke
File "main.swift", line 7, in main
...
(12 additional frame(s) were not displayed)
@twstokes, it seems like a new issue introduced in 23.8.
I found a very similar crash with its first occurrence in 23.0 (4 months ago). The stack trace is identical, so I presume this is not a new crash in 23.8.
This is currently crash #4 of the WPiOS' list of crashes affecting its crash-free session rate (see p1716963424975869/1716781896.201749-slack-C012H19SZQ8). It's the top unresolved crash (as the other ones in the top 5 have been resolved, but are not necessarily deployed to most users yet).
From glancing at the error, logs, and aforementioned fix for video/audio inserted from a URL, my thought is that we may need to guard against invalid URLs being passed to react-native-video when video/audio is inserted via upload. It could be that we are receiving an unexpected, invalid URL value from the host app during the upload process (e.g., odd returns from upload successes/failures).
👋 Thanks for the bump @guarani and suggestion @dcalhoun! @geriux I wouldn't mind trying to help out with this one. I was thinking of implementing the logic (as David suggests) on the insert via upload side.
Reacted by Gerardo Pacheco, David Calhoun and Paul Von Schrottky
Simulator test plan (goal: reproduce). Sign in using docs/simulator-sign-in.md. Build from current trunk.
Setup: WordPress.com site on a plan that allows video and audio. Add a 50–100 MB MP4 and an MP3 with xcrun simctl addmedia. Use the default React Native editor (Experimental Features › Experimental Block Editor off). Use a debug build with the Xcode debugger attached, and set an Objective-C exception breakpoint. iPhone simulator. Either scheme.
The suspected path: the Video/Audio block's insert-via-upload path doesn't validate the URL before passing it to react-native-video (RCTVideo setSrc:). The insert-from-URL path was guarded upstream.
New post › Video block › Choose from device › the MP4. Mid-upload, turn on a 100% loss Network Link Conditioner profile until the block fails, then turn it off and retry or remove the block.
Repeat, but cancel the upload from the block's menu partway through.
Leave the editor mid-upload, delete the item in My Site › Media, then reopen the post.
Repeat steps 1–3 with an Audio block and the MP3.
Kill the app mid-upload, relaunch, and reopen the draft.
Pass / report: Reproduced if NSInvalidArgumentException: -[NSURL initFileURLWithPath:]: nil string parameter fires in -[RCTVideo playerItemForSource:withCallback:]. Attach the backtrace, the src value (from LLDB) and the triggering step. Name the host callback that sends an empty URL and suggest a guard. If nothing crashes after 3 rounds, report not reproduced and list the paths covered.
What might stop it from triggering: the bad URL may come from a race that simulator timing doesn't hit.
Unless the plan says otherwise, build the Jetpack scheme and use bundle ID com.automattic.jetpack in the sign-in commands. The WordPress app hides Reader, Notifications, Stats and the dashboard cards for WordPress.com accounts.
When you're done: post the results here. If you now have reliable steps, remove [Status] Needs Repro. If you found the cause and a fix approach, remove [Status] Needs Plan and add [Status] Ready for Dev. If a "confirm" plan didn't reproduce, say so and recommend closing. Remove Simulator Testable when you're finished.
Activity
kean commentedon Dec 19, 2023
@twstokes, it seems like a new issue introduced in 23.8.
twstokes commentedon Dec 19, 2023
Thanks @kean.
sentry commentedon Dec 19, 2023
Sentry issue: JETPACK-IOS-16VJ
sentry commentedon Dec 19, 2023
Sentry issue: JETPACK-IOS-14QD
sentry commentedon Dec 19, 2023
Sentry issue: WORDPRESS-IOS-44WZ
fluiddot commentedon Dec 19, 2023
I found a very similar crash with its first occurrence in 23.0 (4 months ago). The stack trace is identical, so I presume this is not a new crash in
23.8.dcalhoun commentedon Dec 19, 2023
Noting that we attempted to resolve an identical stack trace in wordpress-mobile/gutenberg-mobile#6233. The solution was guarding against invalid media URLs in WordPress/gutenberg#54834.
It could be the solution needs to be applied elsewhere or that the solution was incomplete.
fluiddot commentedon Jan 17, 2024
Based on the Sentry events, we still get reports of this crash in version 23.9.1.0.
guarani commentedon May 29, 2024
This is currently crash #4 of the WPiOS' list of crashes affecting its crash-free session rate (see p1716963424975869/1716781896.201749-slack-C012H19SZQ8). It's the top unresolved crash (as the other ones in the top 5 have been resolved, but are not necessarily deployed to most users yet).
dcalhoun commentedon May 29, 2024
From glancing at the error, logs, and aforementioned fix for video/audio inserted from a URL, my thought is that we may need to guard against invalid URLs being passed to
react-native-videowhen video/audio is inserted via upload. It could be that we are receiving an unexpected, invalid URL value from the host app during the upload process (e.g., odd returns from upload successes/failures).Currently, we guard insert from a URL, but we do not apply the same logic for insert via upload. This applies to both Video and Audio blocks, as
react-native-videois also used for Audio blocks on iOS.twstokes commentedon May 30, 2024
👋 Thanks for the bump @guarani and suggestion @dcalhoun! @geriux I wouldn't mind trying to help out with this one. I was thinking of implementing the logic (as David suggests) on the insert via upload side.
dangermattic commentedon Oct 31, 2026
Thanks for reporting! 👍
jkmassel commentedon Oct 31, 2026
Simulator test plan (goal: reproduce). Sign in using
docs/simulator-sign-in.md. Build from currenttrunk.Setup: WordPress.com site on a plan that allows video and audio. Add a 50–100 MB MP4 and an MP3 with
xcrun simctl addmedia. Use the default React Native editor (Experimental Features › Experimental Block Editor off). Use a debug build with the Xcode debugger attached, and set an Objective-C exception breakpoint. iPhone simulator. Either scheme.The suspected path: the Video/Audio block's insert-via-upload path doesn't validate the URL before passing it to
react-native-video(RCTVideo setSrc:). The insert-from-URL path was guarded upstream.Pass / report: Reproduced if
NSInvalidArgumentException: -[NSURL initFileURLWithPath:]: nil string parameterfires in-[RCTVideo playerItemForSource:withCallback:]. Attach the backtrace, thesrcvalue (from LLDB) and the triggering step. Name the host callback that sends an empty URL and suggest a guard. If nothing crashes after 3 rounds, report not reproduced and list the paths covered.What might stop it from triggering: the bad URL may come from a race that simulator timing doesn't hit.
Unless the plan says otherwise, build the
Jetpackscheme and use bundle IDcom.automattic.jetpackin the sign-in commands. The WordPress app hides Reader, Notifications, Stats and the dashboard cards for WordPress.com accounts.When you're done: post the results here. If you now have reliable steps, remove
[Status] Needs Repro. If you found the cause and a fix approach, remove[Status] Needs Planand add[Status] Ready for Dev. If a "confirm" plan didn't reproduce, say so and recommend closing. RemoveSimulator Testablewhen you're finished.Generated by Claude Code