Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: generalException when uploading files to OneDrive #48

Closed
dzuluaga opened this issue Jul 17, 2024 · 12 comments · Fixed by #69
Closed

Error: generalException when uploading files to OneDrive #48

dzuluaga opened this issue Jul 17, 2024 · 12 comments · Fixed by #69
Assignees
Labels
bug Something isn't working

Comments

@dzuluaga
Copy link
Contributor

dzuluaga commented Jul 17, 2024

Natalia and Maciek,

URGENT: FOR TODAY'S WEBINAR DEMO .

When attempting to upload files to OneDrive using the Open Mobile Hub Android storage plugin, the following error occurs: generalException.

Steps to Reproduce:

  1. Open the Open Mobile Hub app.
  2. Navigate to the File Viewer.
  3. Attempt to upload a file to OneDrive.
  4. Observe the error message.

Expected Behavior:
The file should be uploaded successfully without any errors.

Actual Behavior:
A pop-up appears with the message "Something went wrong. Error detail: generalException."

Error Log:

2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  com.microsoft.kiota.ApiException: generalException
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.microsoft.kiota.ApiExceptionBuilder.withMessage(ApiExceptionBuilder.java:45)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.microsoft.graph.core.requests.upload.UploadResponseHandler.handleResponse(UploadResponseHandler.java:76)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.microsoft.graph.core.requests.upload.UploadSliceRequestBuilder.put(UploadSliceRequestBuilder.java:69)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.microsoft.graph.core.tasks.LargeFileUploadTask.uploadSlice(LargeFileUploadTask.java:204)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.microsoft.graph.core.tasks.LargeFileUploadTask.upload(LargeFileUploadTask.java:128)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.openmobilehub.android.storage.plugin.onedrive.data.service.OneDriveApiClient.uploadFile$plugin_onedrive_debug(OneDriveApiClient.kt:65)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.openmobilehub.android.storage.plugin.onedrive.data.service.OneDriveApiService.uploadFile(OneDriveApiService.kt:71)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.openmobilehub.android.storage.plugin.onedrive.data.repository.OneDriveFileRepository.uploadFile(OneDriveFileRepository.kt:49)
2024-07-17 00:30:34.992 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.openmobilehub.android.storage.plugin.onedrive.OneDriveOmhStorageClient.uploadFile(OneDriveOmhStorageClient.kt:92)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at com.openmobilehub.android.storage.sample.presentation.file_viewer.FileViewerViewModel$uploadFile$1.invokeSuspend(FileViewerViewModel.kt:315)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
2024-07-17 00:30:34.993 19935-32001 System.err              com.openmobilehub.android.storage.sample  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Environment:

  • App Version: Latest sample app build
  • Android Version: Android 12
  • Device: Huawei Mate 60

Additional Context:
This error seems to occur consistently and prevents file uploads to OneDrive.

Screenshots:
Screenshot_20240717_002534_com openmobilehub android storage sample

CC - @itsme291 @prestonlau

@dzuluaga dzuluaga added the bug Something isn't working label Jul 17, 2024
@maciekBudzinski
Copy link
Collaborator

Hi Diego, thank you for reporting the issue.
I was try to reproduce the issue that you have but with no luck. Can you please provide some more details on the file that you try to upload? If possible, please upload the file in this thread so we can try to reproduce it.
Could you also please try to see it works with the latest build?

@maciekBudzinski
Copy link
Collaborator

The latest release build

@dzuluaga
Copy link
Contributor Author

Thanks for the quick response Maciek. We're experiencing the same error with your apk. Also @kubaluberadzki was able to repro in a Pixel device.

@dzuluaga
Copy link
Contributor Author

dzuluaga commented Jul 19, 2024

From @DamianNowak5f as I don't see your reply in this thread.

The error that Kuba was experiencing was a bit of a different nature - already addressed in the latest build.

Regarding this upload error, we can only reproduce it using the [email protected] test account.
Could you confirm that this is the account you were using? Could you check any other accounts? This will help us pinpoint the issue.

Thanks @DamianNowak5f . Understood. However, I encountered the same error that Kuba ran into during our last call, even when using my personal account instead of [email protected]. I've noticed this issue intermittently in the past as well. I wonder if it might be related to this recurring error. Given this, I believe it’s worth a deeper investigation since the app appears to be quite brittle. I doubt the issue resides on the Microsoft account side, as these services are used by millions of users without similar problems. Could you please look into it?

Screenshot_20240719_064632_com openmobilehub android storage sample

@damiann5f
Copy link
Collaborator

Thanks for the update. We are working on both issues. I believe they might not have to be connected, so I am addressing them separately:

  • OneDrive - access token issues - we were able to reproduce it on any account
  • OneDrive - upload issue - we couldn't reproduce it on the accounts we were using internally or any new Microsoft account we created, but could on this [email protected] account, and you could reproduce it on your personal one, with is important insight, thank you for that.

I will take it from there and update you once we have fixes.

@dzuluaga
Copy link
Contributor Author

Thank you, Damian. Please keep us posted.

@damiann5f
Copy link
Collaborator

Hi, and updated regarding the issues:

  • OneDrive - access token issues - fixed.
  • OneDrive - upload issue - still in progress, might take a bit longer.

@dzuluaga
Copy link
Contributor Author

Thanks, Damian. Can you elaborate on what the issue was? Also, please include the patch in the comments. Thx!

@damiann5f
Copy link
Collaborator

Sure: the OneDrive implementation was not always using the latest access token and did not refresh once cached values - more details in this PR.

@dzuluaga
Copy link
Contributor Author

Thanks, Damian. The PR is titled with OneDrive, is there a reason why other providers' files (Dropbox, Google) are modified as well?

@damiann5f
Copy link
Collaborator

The issue with possibly not using the latest access token was mainly visible on OneDrive, as the access token there has quite a short life span, but a similar refactor was needed for other providers.

@damiann5f
Copy link
Collaborator

damiann5f commented Jul 29, 2024

Hi, we have an updated on the OneDrive upload issue.

The bug is on msgraph-sdk-java end, as we face same issues as reported here and here, and posted on Microsoft Q&A.

Those reports confirm our findings that only a subset of accounts is affected by it.

We will look for a workaround, but deprioritize it for now and observe whether the provider fixes it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants