TypeError when Downloading to PDF in Azure App Service: undici failure
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- azure, node.js, typescript
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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?
- Langage dominant
- TypeScript
- Étoiles
- 833
- Forks
- 240
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
-
Is anyone here? Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 réaction ·
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests? Ouvertestatus:waiting-for-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 42/100
-
status:waiting-for-triage type:bug
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 commentaires · 1 réaction ·
-
status:waiting-for-triage type:bug
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Toutes les issues de microsoftgraph/msgraph-sdk-javascript
Issues similaires
-
Browser Waiting for: Product Owner
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
getsentry/sentry-javascript#24577 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
agilepathway/label-checker#640 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Ouverteagentic-workflows
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
anomalyco/models.dev#7701 ·