Repository navigation
Open
Labels
Media[Pri] Medium[Status] Needs InfoBlocked on information or access that a maintainer needs to supply.Blocked on information or access that a maintainer needs to supply.[Status] Needs ReproNot reproduced on current trunk yet, or no reliable steps to reproduce it.Not reproduced on current trunk yet, or no reliable steps to reproduce it.[Type] Bug
Description
Expected behavior
Uploading a very large video (e.g. larger than 500mb) to the Media Library (either from the Media Library itself or via the block editor's Video block) should work without error.
Actual behavior
Sometimes the video fails to upload.
Steps to reproduce the behavior
You'll need a large video for this (over 500mb) for either scenario below.
Scenario 1
- Open the WPiOS app and create a new post using the block editor
- Add a video block
- Choose the large video and wait for it to upload
- Observe the image upload fails (it's hard to say if this will happen every time)
- Go to the app activity log (Profile icon > Help & Support > Activity Logs > Current) and scroll to the bottom to see the latest logs
- Observe an error in the logs similar to:
2020-09-06 20:00:20:394 🔵 Tracked: media_service_upload_failed <error_code: -1001, error_description: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=
The request timed out., NSErrorFailingURLStringKey=https://public-api.wordpress.com/rest/v1.1/sites/xxxxxxxxxx/media/new?locale=en, NSErrorFailingURLKey=https://public-api.wordpress.com/rest/v1.1/sites/xxxxxxxxxx/media/new?locale=en, _kCFStreamErrorDomainKey=4}, error_domain: NSURLErrorDomain>
Scenario 2
- Open the WPiOS app and navigate to the Media Library
- Add the large video and wait for it to upload
- Observe the image upload fails
- Go to the app activity log (Profile icon > Help & Support > Activity Logs > Current) and scroll to the bottom to see the latest logs
- Observe the same error as before
Reported by user on an iPhone 11 Pro Max, iOS 13.6.1, WPiOS 15.5 (15.5.0.3)
Additional info
- A user who tried uploading a 1.05 gb video could upload the same video using mobile Safari via Gutenberg web (https://wordpress.com/block-editor/) but not from the app (note: WordPress.com recommends videos smaller than 1 GB)
- Cutting the large video in two and uploading each part separately sometimes worked for the user
- The videos in question are .MOV
- Possibly related: Videos added/edited on the web don't load in mobile editor gutenberg-mobile#1152
(internal reference: p4a5px-2D2-p2
Reacted by Eric Gunawan
Metadata
Metadata
Assignees
Labels
Media[Pri] Medium[Status] Needs InfoBlocked on information or access that a maintainer needs to supply.Blocked on information or access that a maintainer needs to supply.[Status] Needs ReproNot reproduced on current trunk yet, or no reliable steps to reproduce it.Not reproduced on current trunk yet, or no reliable steps to reproduce it.[Type] Bug
Activity
guarani commentedon Oct 22, 2020
One possible lead here (noting down for future reference) is that when I background the WPiOS app during a video upload, I can pretty consistently reproduce a failed upload (app needs to be backgrounded for ~30 seconds).
The logs show that the
media_service_upload_failedhappened as soon as I foregrounded the app (after it was in the background for 30 seconds) and the error is a "The network connection was lost."guarani commentedon Feb 26, 2021
Un-assigning myself because I'm not actively working on this.
guarani commentedon Feb 18, 2022
I was not able to diagnose this issue after spending a couple of days on it.
Please note: the sample videos I used were MP4s. I didn't use other formats such as .MOV because I didn't have access to sample in these formats. The videos are:
Video upload tests
Tests using the WordPress for iOS app
Environment
Tests
† Test performed while monitoring network traffic via Charles proxy.
Observations
It seems to me that uploads failed more often when Charles was used. I got this impression from the above tests and other tests I did.
Another oddity with Charles: even after an upload failed, the request status in Charles was often still be "Sending request body...". This would then change a few minutes after as noted in the above tests.
Tests using WordPress.com on different web browsers
Environment
I also did tests on WordPress.com using different browsers and platforms to see if there were problems there. I didn't use Charles proxy in the below tests.
Tests
Debugging the WordPress for iOS app via Xcode
Environment
I ran the latest code from the
trunkbranch and paid special attention to these methods:uploadMedia:requestEnqueued:success:failure, which calls into:multipartPost(parameters:fileParts:requestEnqueued:success:failure)A timeout error:
See error
2022-02-15 17:01:44:417 WordPress[1319:255550] 🔵 Tracked: media_service_upload_failed .<68>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalUploadTask .<68>" ), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, NSErrorFailingURLKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, _kCFStreamErrorDomainKey=4}, error_domain: NSURLErrorDomain> 2022-02-15 17:01:44:443 WordPress[1319:255550] Error uploading media: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x11015b420 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask .<68>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalUploadTask .<68>"A "cannot parse response" error:
See error
2022-02-15 17:31:22:862 WordPress[1397:269654] 🔵 Tracked: media_service_upload_failed .<26>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalUploadTask <346B91B7-062D-4D4D-BF88-11D3EB54C49B>.<26>" ), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, NSErrorFailingURLKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, _kCFStreamErrorDomainKey=4}, error_domain: NSURLErrorDomain> 2022-02-15 17:31:22:928 WordPress[1397:269654] Error uploading media: Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x110255670 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={_kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <346B91B7-062D-4D4D-BF88-11D3EB54C49B>.<26>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalUploadTask <346B91B7-062D-4D4D-BF88-11D3EB54C49B>.<26>" ), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, NSErrorFailingURLKey=https://public-api.wordpress.com/rest/v1.1/sites/202830077/media/new?locale=en, _kCFStreamErrorDomainKey=4}The "cannot parse response" especially deserves more investigation, but I didn't dig into it further.
Next steps
I spent a lot of time with Charles proxy but don't feel like that was the right approach since requests seemed to fail more when the proxy was connected. I think digging further into the issue through Xcode's debugger would be the best next step.
Other options suggested to me are (h/t to @twstokes here):
guarani commentedon Feb 21, 2022
Unassigning myself since I wasn't able to find a solution during groundskeeping.
twstokes commentedon Jul 8, 2022
Just wanted to note that this issue may be improved by recent .com server side tweaks. ref: pgbkb-8lq-p2
dangermattic commentedon Mar 5, 2026
Thanks for reporting! 👍
jkmassel commentedon Oct 31, 2026
Simulator test plan (goal: confirm). Sign in using
docs/simulator-sign-in.md. Build from currenttrunk.Setup: WordPress.com site on a plan that allows video uploads (VideoPress). Create a large test video on the host, for example
ffmpeg -f lavfi -i testsrc=size=1920x1080:rate=30 -t 900 -b:v 6M big.mp4(about 650 MB). Add it (and a.movcopy) withxcrun simctl addmedia. Debug builds enable Media Library v2; turn Media Library v2 off in Me › App Settings › Debug › Feature Flags (then relaunch) to test the shipping library. Use the default React Native editor (Experimental Features › Experimental Block Editor off). iPhone simulator.xcrun simctlor the UI) about 10 s into the upload, wait 30–40 s, then bring the app back.media_service_upload_failedand NSURLError -1001/-1005.Pass / report: Reproduced if an upload fails with an NSURLError although the server accepts the file (upload it from the web to check). Attach log excerpts and screenshots. If nothing fails after 3 tries of each, recommend closing; if only the backgrounded case fails, report that as the remaining bug.
What might stop it from triggering: the original failures were intermittent and may have been network- or server-dependent.
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
jkmassel commentedon Oct 31, 2026
Repro run (2026-10-31, trunk e64c851)
Result: Blocked: needs info ⏸
Needs: a WordPress.com site on a plan that allows video uploads, plus permission to upload a large test video to it. The upload is a WordPress.com write. A mocked API could cover the app's side of this, but not how the real server behaves. That wasn't tried.
Generated by Claude Code