Skip to content

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

Open

Description

@sentry

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)

Activity

  1. kean commented on Dec 19, 2023

    @kean
    Contributor

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

  2. twstokes commented on Dec 19, 2023

    @twstokes
    Contributor

    Thanks @kean.

  3. sentry commented on Dec 19, 2023

    @sentry
    Author

    Sentry issue: JETPACK-IOS-16VJ

  4. sentry commented on Dec 19, 2023

    @sentry
    Author

    Sentry issue: JETPACK-IOS-14QD

  5. sentry commented on Dec 19, 2023

    @sentry
    Author

    Sentry issue: WORDPRESS-IOS-44WZ

  6. fluiddot commented on Dec 19, 2023

    @fluiddot
    Contributor

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

  7. dcalhoun commented on Dec 19, 2023

    @dcalhoun
    Member

    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.

  8. fluiddot commented on Jan 17, 2024

    @fluiddot
    Contributor

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

  9. guarani commented on May 29, 2024

    @guarani
    Contributor

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

  10. dcalhoun commented on May 29, 2024

    @dcalhoun
    Member

    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.

  11. twstokes commented on May 30, 2024

    @twstokes
    Contributor

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

  12. removed their assignment
    on Jul 9, 2024
  13. added
    [Status] Needs Repro
    on Oct 31, 2026
  14. dangermattic commented on Oct 31, 2026

    @dangermattic
    Collaborator

    Thanks for reporting! 👍

  15. jkmassel commented on Oct 31, 2026

    @jkmassel
    Contributor

    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.

    1. 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.
    2. Repeat, but cancel the upload from the block's menu partway through.
    3. Leave the editor mid-upload, delete the item in My Site › Media, then reopen the post.
    4. Repeat steps 1–3 with an Audio block and the MP3.
    5. 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.


    Generated by Claude Code

  16. added
    Simulator Testable
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Posting/EditingSimulator Testable[Status] Needs Repro[Type] Crash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions