wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.96k stars 1.31k forks source link

Media: upload failure "Error uploading media: expected 2845 bytes but received 2846" #9441

Closed designsimply closed 2 years ago

designsimply commented 5 years ago

Some self-hosted sites are unable to upload media with the following error:

Error uploading media: expected 2845 bytes but received 2846

Summary:

App logs:

01 – [Mar-15 18:02 UTILS] WordPress.onCreate
02 – [Mar-15 18:02 API] Dispatching action: ListAction-REMOVE_EXPIRED_LISTS
03 – [Mar-15 18:02 API] PostStore onRegister
04 – [Mar-15 18:02 API] QuickStartStore onRegister
05 – [Mar-15 18:02 STATS] 🔵 Tracked: deep_link_not_default_handler, Properties: {“interceptor_classname”:”com.android.internal.app.ResolverActivity”}
06 – [Mar-15 18:02 UTILS] App comes from background
07 – [Mar-15 18:02 STATS] 🔵 Tracked: application_opened
08 – [Mar-15 18:02 API] Dispatching action: SiteAction-FETCH_SITE
09 – [Mar-15 18:02 UTILS] Deferred Initialisation
10 – [Mar-15 18:02 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
11 – [Mar-15 18:02 UTILS] trackLastActivity, activityId: My Site
12 – [Mar-15 18:02 STATS] The passed blog obj is null or it’s not a wpcom or Jetpack. Tracking analytics without blog info
13 – [Mar-15 18:02 STATS] Number of old stats deleted : 0
14 – [Mar-15 18:02 STATS] 🔵 Tracked: my_site_tab_accessed
15 – [Mar-15 18:02 PROFILING] App Startup: begin
16 – [Mar-15 18:02 PROFILING] App Startup: 84 ms, WPLaunchActivity.onCreate
17 – [Mar-15 18:02 PROFILING] App Startup: 55 ms, WPMainActivity.onCreate
18 – [Mar-15 18:02 PROFILING] App Startup: 94 ms, WPMainActivity.onResume
19 – [Mar-15 18:02 PROFILING] App Startup: end, 233 ms
20 – [Mar-15 18:02 API] Dispatching action: SiteAction-FETCH_POST_FORMATS
21 – [Mar-15 18:02 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
22 – [Mar-15 18:02 UTILS] Connection status changed, isConnected=true
23 – [Mar-15 18:02 NOTIFS] Sending GCM token to our remote services: ***REDACTED***
24 – [Mar-15 18:02 API] Dispatching action: SiteAction-FETCHED_POST_FORMATS
25 – [Mar-15 18:02 API] Dispatching action: SiteAction-UPDATE_SITE
26 – [Mar-15 18:02 DB] Site found by (local) ID: 1
27 – [Mar-15 18:02 DB] Updating site: [site name removed for privacy]
28 – [Mar-15 18:02 STATS] The passed blog obj is null or it’s not a wpcom or Jetpack. Tracking analytics without blog info
29 – [Mar-15 18:02 STATS] 🔵 Tracked: site_menu_opened, Properties: {“menu_item”:”media_library”}
30 – [Mar-15 18:03 API] Dispatching action: MediaAction-FETCH_MEDIA_LIST
31 – [Mar-15 18:03 API] Dispatching action: SiteAction-FETCH_SITE
32 – [Mar-15 18:03 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
33 – [Mar-15 18:03 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
34 – [Mar-15 18:03 UTILS] trackLastActivity, activityId: Media Library
35 – [Mar-15 18:03 MEDIA] No more media items to delete. Stopping MediaDeleteService.
36 – [Mar-15 18:03 API] Dispatching action: SiteAction-UPDATE_SITE
37 – [Mar-15 18:03 DB] Site found by (local) ID: 1
38 – [Mar-15 18:03 DB] Updating site: [site name removed for privacy]
39 – [Mar-15 18:03 MEDIA] Fetched media list for site via XMLRPC.GET_MEDIA_LIBRARY
40 – [Mar-15 18:03 API] Dispatching action: MediaAction-FETCHED_MEDIA_LIST
41 – [Mar-15 18:03 UTILS] App goes to background
42 – [Mar-15 18:03 STATS] 🔵 Tracked: application_closed, Properties: {“last_visible_screen”:”Media Library”,”time_in_app”:7}
43 – [Mar-15 18:03 MAIN] ConnectionChangeReceiver successfully unregistered
44 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPDATE_MEDIA
45 – [Mar-15 18:03 STATS] 🔵 Tracked: app_reviews_significant_event_incremented, Properties: {“source”:”media_upload”}
46 – [Mar-15 18:03 STATS] 🔵 Tracked: media_library_photo_added, Properties: {“ext”:”png”,”age_ms”:34978,”bytes”:7681,”mime”:”image\/png”,”megapixels”:0,”via”:”device_library”}
47 – [Mar-15 18:03 UTILS] App comes from background
48 – [Mar-15 18:03 STATS] 🔵 Tracked: application_opened
49 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPDATE_MEDIA
50 – [Mar-15 18:03 UTILS] trackLastActivity, activityId: Media Library
51 – [Mar-15 18:03 MAIN] UploadService > Created
52 – [Mar-15 18:03 MEDIA] MediaUploadHandler > Created
53 – [Mar-15 18:03 POSTS] PostUploadHandler > Created
54 – [Mar-15 18:03 MEDIA] MediaUploadHandler > Dispatching upload action for media with local id: 18 and path: /data/user/0/org.wordpress.android/cache/wmark.png
55 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPDATE_MEDIA
56 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPLOAD_MEDIA
57 – [Mar-15 18:03 MEDIA] starting upload for: 18
58 – [Mar-15 18:03 MEDIA] No more media items to delete. Stopping MediaDeleteService.
59 – [Mar-15 18:03 MEDIA] MediaBrowser onMediaChanged > UPDATE_MEDIA
60 – [Mar-15 18:03 MEDIA] MediaBrowser onMediaChanged > UPDATE_MEDIA
61 – [Mar-15 18:03 API] Dispatching action: UploadAction-UPLOADED_MEDIA
62 – [Mar-15 18:03 MEDIA] media upload failed: java.net.ProtocolException: expected 2845 bytes but received 2846
63 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPLOADED_MEDIA
64 – [Mar-15 18:03 MEDIA] mediaXMLRPCClient: removed id: 18 from current uploads, remaining: 0
65 – [Mar-15 18:03 API] Dispatching action: UploadAction-UPLOADED_MEDIA
66 – [Mar-15 18:03 MEDIA] MediaUploadHandler > 18 – progress: 0.6523512
67 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPLOADED_MEDIA
68 – [Mar-15 18:03 API] Dispatching action: SiteAction-FETCH_SITE
69 – [Mar-15 18:03 MEDIA] MediaUploadHandler > Error uploading media: expected 2845 bytes but received 2846
70 – [Mar-15 18:03 API] Dispatching action: MediaAction-UPDATE_MEDIA
71 – [Mar-15 18:03 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
72 – [Mar-15 18:03 STATS] 🔵 Tracked: media_service_upload_response_error, Properties: {“ext”:”png”,”age_ms”:1267,”bytes”:7681,”mime”:”image\/png”,”megapixels”:0,”error_type”:”GENERIC_ERROR”}
73 – [Mar-15 18:03 STATS] 🔵 Tracked: media_service_upload_started, Properties: {“ext”:”png”,”age_ms”:1272,”bytes”:7681,”mime”:”image\/png”,”megapixels”:0}
74 – [Mar-15 18:03 MEDIA] MediaUploadHandler > No more media items to upload. Skipping this request.
75 – [Mar-15 18:03 MEDIA] MediaUploadHandler > Completed
76 – [Mar-15 18:03 MEDIA] updateNotificationErrorForMedia: Couldn’t perform operation
77 – [Mar-15 18:03 MAIN] UploadService > Completed
78 – [Mar-15 18:03 API] Dispatching action: SiteAction-FETCH_SITE
79 – [Mar-15 18:03 MEDIA] MediaBrowser onMediaChanged > UPDATE_MEDIA
80 – [Mar-15 18:03 API] long type could be misinterpreted when sent to the WordPress XMLRPC end point
81 – [Mar-15 18:03 MAIN] UploadService > Destroyed
82 – [Mar-15 18:03 API] Dispatching action: SiteAction-UPDATE_SITE
83 – [Mar-15 18:03 DB] Site found by (local) ID: 1
84 – [Mar-15 18:03 DB] Updating site: [site name removed for privacy]
85 – [Mar-15 18:03 API] Dispatching action: SiteAction-UPDATE_SITE
86 – [Mar-15 18:03 DB] Site found by (local) ID: 1
87 – [Mar-15 18:03 DB] Updating site: [site name removed for privacy]
88 – [Mar-15 18:03 UTILS] trackLastActivity, activityId: My Site
89 – [Mar-15 18:03 UTILS] trackLastActivity, activityId: Me
90 – [Mar-15 18:03 STATS] 🔵 Tracked: me_tab_accessed
91 – [Mar-15 18:03 UTILS] trackLastActivity, activityId: Help Screen

Note: I tried uploading https://s.w.org/style/images/about/wmark.png to a self-hosted multisite WordPress site with no plugins using WPAndroid alpha-156 (12.0 alpha) on Pixel 3 Android 9 and I was unable to reproduce the problem in testing—all images uploaded normally for me.

(internal reference: p4a5px-2m7-p2)

stale[bot] commented 4 years ago

This issue has been marked as stale because:

Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority (cc @designsimply).

Mimoza commented 3 years ago

Exactely the same issue ! app version 16.5, on galaxy tab S6 with Android 10

stale[bot] commented 2 years ago

This issue has been marked as stale because:

Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions.

antonis commented 2 years ago

This should be fixed with https://github.com/wordpress-mobile/WordPress-Android/pull/16421