TypeError when Downloading to PDF in Azure App Service: undici failure
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- azure, node.js, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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/[email protected] 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?
- Lenguaje dominante
- TypeScript
- Estrellas
- 836
- Forks
- 241
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoftgraph/msgraph-sdk-javascript
-
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the queryPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
microsoftgraph/msgraph-sdk-javascript#2039 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoftgraph/msgraph-sdk-javascript#2011 ·
Los mantenedores suelen responder en 1 día
-
status:waiting-for-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
microsoftgraph/msgraph-sdk-javascript#1956 ·
Los mantenedores suelen responder en 1 día
-
Is anyone here?Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests?Abiertostatus:waiting-for-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
microsoftgraph/msgraph-sdk-javascript#2004 ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoftgraph/msgraph-sdk-javascript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vega/vega-webgpu#40 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openwatersio/slackwater#550 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bug size:small
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fb55/htmlparser2#2579 ·
Los mantenedores suelen responder en 1 día