WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

NSInvalidArgumentException: *** -[NSURL initFileURLWithPath:]: nil string parameter

Open sentry-io[bot] opened this issue 1 year ago • 11 comments

Sentry Issue: WORDPRESS-IOS-46M5

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)

sentry-io[bot] avatar Dec 19 '23 02:12 sentry-io[bot]

@twstokes, it seems like a new issue introduced in 23.8.

kean avatar Dec 19 '23 02:12 kean

Thanks @kean.

twstokes avatar Dec 19 '23 02:12 twstokes

Sentry issue: JETPACK-IOS-16VJ

sentry-io[bot] avatar Dec 19 '23 08:12 sentry-io[bot]

Sentry issue: JETPACK-IOS-14QD

sentry-io[bot] avatar Dec 19 '23 08:12 sentry-io[bot]

Sentry issue: WORDPRESS-IOS-44WZ

sentry-io[bot] avatar Dec 19 '23 08:12 sentry-io[bot]

@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.

fluiddot avatar Dec 19 '23 08:12 fluiddot

Noting that we attempted to resolve an identical stack trace in https://github.com/wordpress-mobile/gutenberg-mobile/issues/6233. The solution was guarding against invalid media URLs in https://github.com/WordPress/gutenberg/pull/54834.

It could be the solution needs to be applied elsewhere or that the solution was incomplete.

dcalhoun avatar Dec 19 '23 13:12 dcalhoun

Based on the Sentry events, we still get reports of this crash in version 23.9.1.0.

fluiddot avatar Jan 17 '24 16:01 fluiddot

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).

guarani avatar May 29 '24 15:05 guarani

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).

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-video is also used for Audio blocks on iOS.

dcalhoun avatar May 29 '24 15:05 dcalhoun

👋 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.

twstokes avatar May 30 '24 02:05 twstokes