File Corruption in SharePoint Upload via Microsoft Graph API
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Comece com o branch simple-upload no snippet uploadFile fornecido e revise como document.contentToStream é consumido pela chamada do Microsoft Graph SDK 5.80.0. Reproduza o caso intermitente comparando o tamanho da origem, o tamanho no SharePoint após o upload e o momento do webhook; considera-se concluído quando uma causa confiável tiver sido identificada e uma correção verificada tiver sido confirmada.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
I am using the Microsoft Graph API 5.80.0 to upload files to SharePoint from a Java Spring Boot application. The upload works fine in normal conditions, but some files become corrupted while uploading & so unable to download from SharePoint.
Most of the upload files are smaller than 4 MB, so I am using the simple upload method (PUT request).
The upload process completes successfully (returns 200 OK with a valid file ID). When I receive the webhook for the same the file size is 0 & not able to open the file as the file is corrupted. It happens randomly for a few of the requests.
private fun uploadFile(document: DocumentUploadStream) {
val timeMillis = System.currentTimeMillis()
val buildDriveItemRequest : DriveItemRequestBuilder = microsoftGraphClient.drives("driveId").root().itemWithPath(document.path)
if (document.size < 4 * 1024 * 1024) {
// Simple upload for small files
val driveItem = retry {
refreshToken {
buildDriveItemRequest.content().buildRequest()
.put(document.contentToStream.readAllBytes())
}
}
logger.info { "Upload done ${document.path}, id: ${driveItem?.id}, time: ${(System.currentTimeMillis() - timeMillis)/1000}s" }
document.id = driveItem?.id
} else {
// Large files use upload sessions (this part is working fine)
}
}
data class DocumentUploadStream(
val path: DocumentPath,
val contentToStream: InputStream,
val size: Long
)
Expected behavior
The file should not get corrupted on upload.
Any insights or recommendations would be greatly appreciated!
Thanks
How to reproduce
With the attached snippet of code, it should be reproducible randomly.
SDK Version
5.80.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Linguagem predominante
- Java
- Estrelas
- 444
- Forks
- 154
- Merge médio
- 18h 28min
- PRs com merge (30d)
- 4
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
Error in PATCH onlineMeeting Abertastatus:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 comentário ·
Todas as issues de microsoftgraph/msgraph-sdk-java
Issues semelhantes
-
Bug Java Platform: Java
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
getsentry/sentry-java#6138 · 1 comentário ·
-
bug needs triage p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 comentário ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/rocketmq-dashboard#4654 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100