Getting: "No Response Received for upload." exception using LargeFileUploadTask
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Beginne mit der Dokumentation zum Hochladen großer Dateien von Microsoft Graph und dem gemeldeten Stack Trace, insbesondere mit UploadResponseHandler.java:71, UploadSliceRequestBuilder.java:69 und LargeFileUploadTask.java:210. Reproduziere den Fehler mit dem bereitgestellten Java-21-Code und untersuche das Upload-Response- oder Request-Verhalten. Erledigt ist die Aufgabe, wenn festgestellt wurde, ob das SDK oder der Request verantwortlich ist, und eine bestätigte Lösung dokumentiert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hello, we are experiencing this exception and we don't find much information about It so we are creating this issue because we are not sure if It is a bug or It is something else.
We are trying to upload Large Files (more than 3 MB) to a draft Outlook Message from our Java 21 Maven Project with Microsoft Graph Java SDK v6.54.0. The POM.xml dependency looks like this:
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph</artifactId>
<version>6.54.0</version>
</dependency>
We are following the Microsoft Docs to do this: https://learn.microsoft.com/en-us/graph/sdks/large-file-upload?tabs=java#upload-large-attachment-to-outlook-message
So when we do the task.upload() we are getting the following Stack Trace:
SEVERE: Exception during large attachment upload for 'document (1).pdf'. Error: No Response Received for upload.
[INFO] GCLOUD: com.microsoft.kiota.ApiException: No Response Received for upload.
[INFO] GCLOUD: at com.microsoft.graph.core.requests.upload.UploadResponseHandler.handleResponse(UploadResponseHandler.java:71)
[INFO] GCLOUD: at com.microsoft.graph.core.requests.upload.UploadSliceRequestBuilder.put(UploadSliceRequestBuilder.java:69)
[INFO] GCLOUD: at com.microsoft.graph.core.tasks.LargeFileUploadTask.uploadSlice(LargeFileUploadTask.java:210)
[INFO] GCLOUD: at com.microsoft.graph.core.tasks.LargeFileUploadTask.upload(LargeFileUploadTask.java:134)
[INFO] GCLOUD: at plenion.officeware.services.OutlookMailService.addAttachmentsToDraft(OutlookMailService.java:1472)
Our code looks like this:
CreateUploadSessionPostRequestBody req = new CreateUploadSessionPostRequestBody();
AttachmentItem item = new AttachmentItem();
item.setAttachmentType(AttachmentType.File);
item.setName(name);
item.setSize(size);
item.setIsInline(isInline);
if (contentType != null) item.setContentType(contentType);
req.setAttachmentItem(item);
UploadSession session = graphClient
.users()
.byUserId(userMail)
.messages()
.byMessageId(draftMessageId)
.attachments()
.createUploadSession()
.post(req);
InputStream in = graphClient
.drives()
.byDriveId(driveId)
.items()
.byDriveItemId(a.getId())
.content()
.get();
try (in) {
log.info("Starting upload for attachment: " + name);
log.info("Upload session URL: " + session.getUploadUrl());
log.info("Upload session expiration: " + session.getExpirationDateTime());
int maxChunkSize = 4 * 1024 * 1024; // 4 MiB
LargeFileUploadTask<FileAttachment> task = new LargeFileUploadTask<>(
graphClient.getRequestAdapter(),
session,
in,
size,
maxChunkSize,
FileAttachment::createFromDiscriminatorValue
);
IProgressCallback callback = (current, max) -> log.info(
String.format("Uploaded %d bytes of %d total bytes", current, max)
);
UploadResult<FileAttachment> uploadResult = task.upload(5, callback);
if (uploadResult.isUploadSuccessful()) {
log.info("Upload complete. Item ID: " + uploadResult.itemResponse.getId());
} else {
log.severe("Upload failed. No response received.");
}
} catch (Exception e) {
log.severe("Exception during large attachment upload for '" + name + "'. Error: " + e.getMessage());
e.printStackTrace();
throw new RuntimeException(e);
}
If this information is useful also we are using Google App Egine Standard to host our APIs but this error also occurs while localhost development too, so at first instance this is not related with Google.
What is wrong here? Is It normal to get that message? Are we missing something?
We can provide more information if needed, please just let us know and we will update the issue. Thank you in advance.
- Vorherrschende Sprache
- Java
- Sterne
- 444
- Forks
- 154
- Ø Merge
- 18 Std. 28 Min.
- Gemergte PRs (30 T.)
- 4
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 Kommentar ·
Alle Issues in microsoftgraph/msgraph-sdk-java
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
elastic/gradle-plugins#157 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
cryptomator/hub#497 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
johanhaleby/occurrent#1120 ·