parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 734 forks source link

i/o failure #1046

Closed cosmicudemy closed 4 years ago

cosmicudemy commented 4 years ago

I have been using Parse to upload file and to save Parse Files through my android app...I tested the app on 4 phone, 3 phones sucessfully upload the file but one phone give an error as below:-

[Ljava.lang.StackTraceElement;@512d2f3 when i do e.getStackTrace() and when i do e.getmessage() it says i/o failure ... I am using 1.18.2 ParseSDK... below is the code which gives error -

ParseObject parseObject = new ParseObject(Variables.videos_TABLE);
            File file = new File(video_path);
            ParseFile videoFile = new ParseFile(file);

            parseObject.put("userid", ParseUser.getCurrentUser());
            parseObject.put("description", videoCaption.getText().toString());
            parseObject.put("videoURL", videoFile);
            parseObject.put("thumbnailURL", ThumbnailFile);
            parseObject.put("tags", mTextHashTagHelper.getAllHashTags());
            parseObject.put("music", music.getText().toString());

            videoFile.saveInBackground(new SaveCallback() {
                public void done(ParseException e) {
                    // Handle success or failure here ...
                    if(e==null){
                    parseObject.saveInBackground(new SaveCallback() {
                        @Override
                        public void done(ParseException e) {
                            if (e == null) {
                                try {
                                    Functions.cancelDeterminentLoader();

//
//
                                    for (int i = 0; i < videoPath.size(); i++) {
                                        File file = new File(videoPath.get(i));
                                        if (file.exists()) {
                                            file.delete();
                                        }
                                    }
//                                          
                                    Toast.makeText(VideoPostActivity.this, "Video Successfully Uploaded", Toast.LENGTH_LONG).show();
                                    finish();

//                                        }
//                                    })
//                                  
                                } catch (Exception er) {
                                    finish();
                                    Functions.cancelDeterminentLoader();
                                    Toast.makeText(VideoPostActivity.this, "Error Occurred...", Toast.LENGTH_LONG).show();
                                }
                            } else {
                                Functions.cancelDeterminentLoader();
                                Logger("Post",""+e.getStackTrace());
                                Toast.makeText(VideoPostActivity.this, "Post Could not be Saved..." + e.getMessage(), Toast.LENGTH_LONG).show();

                            }
                        }
                    });

Files is not upload so the object it also not made in the database...I did not update the library version and everything was working fine till yesterday, and today while check the new apk things are not working well on 1 mobile and others are ok. and If I test the previous apk things work well in all 4... Pls help...

Jawnnypoo commented 4 years ago

This is very likely a backend issue. You likely have run out of storage on the backend, or are hitting a file limit. You need to look into configuring your backend to properly handle large files and upload them to S3 or something similar, they are probably getting uploaded to MongoDB now, which is not ideal.

cosmicudemy commented 4 years ago

@Jawnnypoo back4app gives S3 support and I am using that to upload it...There are two ways to upload the file...

First it I save the file first and then save the object or save the object with the file .... with the first one I get the progress of the file...

and I am able to upload file using other device....

Jawnnypoo commented 4 years ago

Can you give all the device info of the device where it fails, such as the manufacturer, model, Android version, etc?

cosmicudemy commented 4 years ago

Manufacture - Oppo Model - F3 android version - 6

it fails now ...but with the same parse library version , it was working properly in the previous apk... previous apk worked on all 4 devices and recent apk does not work on above device...

On Wed, Jul 8, 2020 at 9:28 PM John Carlson notifications@github.com wrote:

Can you give all the device info of the device where it fails, such as the manufacturer, model, Android version, etc?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655607786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3GNABRKDSFESVASWHTR2SJSXANCNFSM4OTJG4RQ .

cosmicudemy commented 4 years ago

any update?

On Wed, Jul 8, 2020 at 9:31 PM cosmic udemy cosmicudemy@gmail.com wrote:

Manufacture - Oppo Model - F3 android version - 6

it fails now ...but with the same parse library version , it was working properly in the previous apk... previous apk worked on all 4 devices and recent apk does not work on above device...

On Wed, Jul 8, 2020 at 9:28 PM John Carlson notifications@github.com wrote:

Can you give all the device info of the device where it fails, such as the manufacturer, model, Android version, etc?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655607786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3GNABRKDSFESVASWHTR2SJSXANCNFSM4OTJG4RQ .

Jawnnypoo commented 4 years ago

Can you update to the latest version of the SDK and confirm if it is still an issue?

cosmicudemy commented 4 years ago

which version?

On Thu, Jul 9, 2020 at 1:52 AM John Carlson notifications@github.com wrote:

Can you update to the latest version of the SDK and confirm if it is still an issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655735982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3BK2G5NW4FQIKCSD6DR2TIM5ANCNFSM4OTJG4RQ .

cosmicudemy commented 4 years ago

i tried updating to the below version but the error is still there on the same mobile

implementation "com.github.parse-community.Parse-SDK-Android:parse:1.23.0"

On Thu, Jul 9, 2020 at 1:55 AM cosmic udemy cosmicudemy@gmail.com wrote:

which version?

On Thu, Jul 9, 2020 at 1:52 AM John Carlson notifications@github.com wrote:

Can you update to the latest version of the SDK and confirm if it is still an issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655735982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3BK2G5NW4FQIKCSD6DR2TIM5ANCNFSM4OTJG4RQ .

Jawnnypoo commented 4 years ago

Please update to 1.24.2 and then follow these steps to add a logging interceptor to see what the error is from the network: https://github.com/parse-community/Parse-SDK-Android/issues/660#issuecomment-299928775

cosmicudemy commented 4 years ago

same error....i/o failure ...

On Thu, Jul 9, 2020 at 2:14 AM John Carlson notifications@github.com wrote:

Please update to 1.24.2 and then follow these steps to add a logging interceptor to see what the error is from the network: #660 (comment) https://github.com/parse-community/Parse-SDK-Android/issues/660#issuecomment-299928775

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655746986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3C4EBVQCIPX7H7SJI3R2TLEDANCNFSM4OTJG4RQ .

cosmicudemy commented 4 years ago

same error ... i/o failure

i added the below code :-

OkHttpClient.Builder builder = new OkHttpClient.Builder() .addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));

Parse.initialize(new Parse.Configuration.Builder(this) .applicationId(getString(R.string.back4app_app_id)) .clientBuilder(builder) // if defined .clientKey(getString(R.string.back4app_client_key)) .server(getString(R.string.back4app_server_url)) .build() );

On Thu, Jul 9, 2020 at 10:26 AM cosmic udemy cosmicudemy@gmail.com wrote:

same error....i/o failure ...

On Thu, Jul 9, 2020 at 2:14 AM John Carlson notifications@github.com wrote:

Please update to 1.24.2 and then follow these steps to add a logging interceptor to see what the error is from the network: #660 (comment) https://github.com/parse-community/Parse-SDK-Android/issues/660#issuecomment-299928775

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655746986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3C4EBVQCIPX7H7SJI3R2TLEDANCNFSM4OTJG4RQ .

Jawnnypoo commented 4 years ago

Yes, this is to identify the error. Can you paste the logs from Logcat when this failure happens? You should see HTTP request/response info.

cosmicudemy commented 4 years ago

I am testing my installing the apk..where and how can I find the logcat .. Pls guide

On Thu, Jul 9, 2020 at 11:43 AM John Carlson notifications@github.com wrote:

Yes, this is to identify the error. Can you paste the logs from Logcat when this failure happens? You should see HTTP request/response info.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655923802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3DDR65VJ6IBY7WS3ELR2VNZ5ANCNFSM4OTJG4RQ .

cosmicudemy commented 4 years ago

pls guide..how to get the log cat when the mobile is not with me and apk is getting installed

On Thu, Jul 9, 2020 at 11:47 AM cosmic udemy cosmicudemy@gmail.com wrote:

I am testing my installing the apk..where and how can I find the logcat .. Pls guide

On Thu, Jul 9, 2020 at 11:43 AM John Carlson notifications@github.com wrote:

Yes, this is to identify the error. Can you paste the logs from Logcat when this failure happens? You should see HTTP request/response info.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655923802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3DDR65VJ6IBY7WS3ELR2VNZ5ANCNFSM4OTJG4RQ .

cosmicudemy commented 4 years ago

its very strange , I tried on another android 6 version mobile and it worked but on that mobile it does not...and I am not able to get the logcat because I do not have the mobile onhand ... I send the apk to test on it

On Thu, Jul 9, 2020 at 1:30 PM cosmic udemy cosmicudemy@gmail.com wrote:

pls guide..how to get the log cat when the mobile is not with me and apk is getting installed

On Thu, Jul 9, 2020 at 11:47 AM cosmic udemy cosmicudemy@gmail.com wrote:

I am testing my installing the apk..where and how can I find the logcat .. Pls guide

On Thu, Jul 9, 2020 at 11:43 AM John Carlson notifications@github.com wrote:

Yes, this is to identify the error. Can you paste the logs from Logcat when this failure happens? You should see HTTP request/response info.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parse-community/Parse-SDK-Android/issues/1046#issuecomment-655923802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJYW3DDR65VJ6IBY7WS3ELR2VNZ5ANCNFSM4OTJG4RQ .