TypeError when Downloading to PDF in Azure App Service: undici failure
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- azure, node.js, typescript
Rechercherichtung
Start with conversionDownloadToPdf and the @microsoft/microsoft-graph-client request using ResponseType.RAW, then compare the local and Azure App Service environments on Node v18.19.1. Inspect the full undici error cause and determine whether ProxyAgent or an officially documented workaround addresses the failure; done means the PDF download works in Azure or the limitation is clearly documented.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Download to PDF Not Working in Azure App Service
I'm running an express app using Node v18.19.1. My endpoint does the following:
- Saves a document to a sharepoint folder
- Performs the download/convert to pdf
- Saves the downloaded pdf to a Mongo db.
- Deletes the original file
Steps 1, 2, and 4 use the @microsoft/microsoft-graph-client@3.0.7 package. This all works locally. However, when I deploy it to my Azure App Services (running Windows and Node v18.19.1), it breaks at step 2 with the following error:
TypeError: fetch failed at node:internal/deps/undici/undici:12625:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The conversion download method:
const conversionDownloadToPdf = async (fileItemId) => {
try {
console.log(chalk.blue(`Attempting to downloaded file (${fileItemId})...`));
const response = await client.api(`drives/${process.env.DRIVE_ID}/items/${fileItemId}/content?format=pdf`)
.responseType(ResponseType.RAW) // ensure raw stream
.get();
const stream = await apiRequest.responseType(ResponseType.RAW).get(); // BREAKS HERE
console.log(chalk.blue(`Stream downloaded. Streaming to buffer...`));
return await toBuffer(stream);
} catch (error) {
console.error(chalk.red(`Full error details:`));
console.error(chalk.red(`Message: ${error.message}`));
console.error(chalk.red(`Status Code: ${error.statusCode}`));
console.error(chalk.red(`Code: ${error.code}`));
console.error(chalk.red(`Stack: ${error.stack}`));
// Log the cause if available (undici errors have this)
if (error.cause)
console.error(chalk.red(`Cause: ${JSON.stringify(error.cause, null, 2)}`));
throw error;
}
}
Do I need to use that ProxyAgent? Do you have official docs on a workaround?
- Vorherrschende Sprache
- TypeScript
- Sterne
- 833
- Forks
- 240
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
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-javascript
-
status:waiting-for-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
-
Is anyone here? Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 Reaktion ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Offenstatus:waiting-for-triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 Kommentare · 1 Reaktion ·
-
status:waiting-for-triage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Alle Issues in microsoftgraph/msgraph-sdk-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
copse-dev/agent-pane#2953 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
calcite-components needs triage refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Esri/calcite-design-system#15203 ·