microsoftgraph / microsoftgraph/msgraph-sdk-java

Authorization header in large file upload slices causing failures

Đang mở
#2,026 14 bình luận 6 reaction 1 người được giao Xem trên GitHub

@Ndiritu đang làm issue này rồi.

Từ ngày 3/6/2024.

type:enhancement
Ngôn ngữ chính
Java
Star
444
Fork
154
Merge trung bình
18 giờ 28 phút
Pull request đã merge (30 ngày)
4

Mô tả

Expected behavior

We've been using this feature for a long time and in recent days we've noticed that some accounts can't upload files, but some do. We expect file uploads to work for all accounts.

microsoft-graph: 2.10.0

Actual behavior
com.microsoft.graph.core.ClientException: Upload session failed.
	at com.microsoft.graph.requests.extensions.ChunkedUploadRequest.upload(ChunkedUploadRequest.java:116)
	at com.microsoft.graph.concurrency.ChunkedUploadProvider.upload(ChunkedUploadProvider.java:186)
	at com.microsoft.graph.concurrency.ChunkedUploadProvider.upload(ChunkedUploadProvider.java:214)
	at com.cloudcoupler.OneDriveProvider$openDocument$1.invoke(OneDriveProvider.kt:457)
	at com.cloudcoupler.OneDriveProvider$openDocument$1.invoke(OneDriveProvider.kt:400)
	at com.cloudcoupler.UtilsKt$async$1$1.invokeSuspend(Utils.kt:26)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: com.microsoft.graph.core.ClientException: Error code: unauthenticated
Error message: Unauthenticated

PUT https://my.microsoftpersonalcontent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0Tm1Gak4yRXpPV1JrWWpKaiIsInRpZCI6IjkxODgwNDBkLTZjNjctNGM1Yi1iMTEyLTM2YTMwNGI2NmRhZCIsInR0IjoiMiIsInVwbiI6IndpdHR5dGVzdDAxQGhvdG1haWwuY29tIiwidmVyIjoiaGFzaGVkcHJvb2Z0b2tlbiJ9.g2cQ9l8ILGXETIe3DtSwvPvh41NtIiGktf2gUN69Uco
SdkVersion : graph-java/v2.10.0
Content-Range : bytes 0-18264/18265
Authorization : [PII_REDACTED]


401 : FORBIDDEN
Cache-Control : private, max-age=0
Content-Length : 64
Content-Security-Policy : frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.office365.com goals.cloud.microsoft *.powerapps.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;
Content-Type : application/json
Date : Fri, 31 May 2024 07:04:20 GMT
Expires : Thu, 16 May 2024 07:04:20 GMT
Last-Modified : Fri, 31 May 2024 07:04:20 GMT
MicrosoftSharePointTeamServices : 16.0.0.24908
MS-CV : qhkFo+d/Y0G1W+ZnjFzBmw.0
P3P : CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
request-id : a30519aa-7fe7-4163-b55b-e6678c5cc19b
SPRequestGuid : a30519aa-7fe7-4163-b55b-e6678c5cc19b
Strict-Transport-Security : max-age=31536000
Vary : Origin
Steps to reproduce the behavior

Only some accounts can reproduce, but we noticed that the URL uploaded by the abnormal accounts is https://my.microsoftpersonalcontent.com/personal, and the upload URL used by the available accounts is https://api.onedrive.com/rup/, and the uploaded URL is from UploadSession.
I'm a little curious as to why there is such a difference.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.