Error on exporting the error log
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
Línea de trabajo
Comienza con plugins/datainjection/front/clientinjection.form.php en la línea 75 y plugins/datainjection/inc/clientinjection.class.php en la línea 349; después, sigue readUploadedFile() y la solicitud de exportación en plugins/datainjection/front/export.csv.php. Verifica que el nombre del archivo subido siga disponible después del procesamiento y que al hacer clic en «Export the log» se descarguen las filas rechazadas como un CSV sin un HTTP 500.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
GLPI Version
11.0.9
Plugin version
2.15.11
Bug description
Importing a CSV through the client injection wizard loses the "Export the log" feature as soon as the import produces even one failed line.
What happens:
- I upload a valid CSV file to a model and run the injection. Here, PHP output a warning "Undefined array key "filename" at clientinjection.form.php line 75"
- Some rows fail (bad values, duplicates, whatever). The result screen correctly shows them and offers "Export the log" so I can fix the CSV and re-import.
- Clicking "Export the log" downloads nothing — the request just dies with a server error (HTTP 500 on front/export.csv.php). There is no way to recover the list of rejected lines; the only option is to re-run the whole import and read errors on screen, line by line.
Relevant log output
Logs during the upload:
[2026-09-22 12:52:54] glpi.WARNING: *** Warning: Undefined array key "filename" at clientinjection.form.php line 75
Backtrace :
...datainjection/front/clientinjection.form.php:75
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:208 Symfony\Component\HttpKernel\HttpKernel->handle()
./src/Glpi/Kernel/Kernel.php:201 Symfony\Component\HttpKernel\Kernel->handle()
./public/index.php:78 Glpi\Kernel\Kernel->handle()
[2026-09-22 12:52:54] glpi.WARNING: *** Warning: Trying to access array offset on null at clientinjection.form.php line 75
Backtrace :
...datainjection/front/clientinjection.form.php:75
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:208 Symfony\Component\HttpKernel\HttpKernel->handle()
./src/Glpi/Kernel/Kernel.php:201 Symfony\Component\HttpKernel\Kernel->handle()
./public/index.php:78 Glpi\Kernel\Kernel->handle()
Logs of the error obtained by clicking "Export the log"
[2026-09-22 12:55:46] glpi.WARNING: *** Warning: fopen(/var/glpi/files/_plugins/datainjection/): Failed to open stream: Is a directory at filesystem.php line 399
Backtrace :
...ngmachine/safe/generated/8.2/filesystem.php:399
...datainjection/inc/clientinjection.class.php:349 Safe\fopen()
./plugins/datainjection/front/export.csv.php:33 PluginDatainjectionClientInjection::exportErrorsInCSV()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:208 Symfony\Component\HttpKernel\HttpKernel->handle()
./src/Glpi/Kernel/Kernel.php:201 Symfony\Component\HttpKernel\Kernel->handle()
./public/index.php:78 Glpi\Kernel\Kernel->handle()
[2026-09-22 12:55:46] glpi.CRITICAL: *** Uncaught PHP Exception Safe\Exceptions\FilesystemException: "An error occurred" at FilesystemException.php line 9
Backtrace :
.../generated/Exceptions/FilesystemException.php:9
...ngmachine/safe/generated/8.2/filesystem.php:402 Safe\Exceptions\FilesystemException::createFromPhpError()
...datainjection/inc/clientinjection.class.php:349 Safe\fopen()
./plugins/datainjection/front/export.csv.php:33 PluginDatainjectionClientInjection::exportErrorsInCSV()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:208 Symfony\Component\HttpKernel\HttpKernel->handle()
./src/Glpi/Kernel/Kernel.php:201 Symfony\Component\HttpKernel\Kernel->handle()
./public/index.php:78 Glpi\Kernel\Kernel->handle()
Page URL
error occurs on /plugins/datainjection/front/export.csv.php (/plugins/datainjection/front/clientinjection.form.php on upload step outputs the warning)
Steps To reproduce
- Go to Administration > Data injection (client injection), pick a ready-to-use CSV model.
- Upload a valid CSV matching the model (with at least one row that will fail injection, so error lines exist).
- Check the GLPI PHP error log → "Undefined array key "filename"" at clientinjection.form.php line 75 (file_name stored as null in session).
- Run the injection, then click "Export the log".
- See error: fopen(.../files/plugins/datainjection/): Failed to open stream: Is a directory → uncaught TypeError in fputcsv() → HTTP 500, no CSV download.
Your GLPI setup information
No response
Anything else?
Root cause is the unset($_FILES['filename']); in readUploadedFile() combined with the re-read at clientinjection.form.php:75.
Suggested fix: capture the name before the unset and pass it back, e.g. in clientinjection.form.php do $uploaded_filename = $_FILES['filename']['name']; before processUploadedFile(), then $_SESSION['datainjection']['file_name'] = $uploaded_filename; — or have readUploadedFile() return the original name (it already captures it in $original_filename internally) instead of reaching into $_FILES again.
- Lenguaje dominante
- PHP
- Estrellas
- 76
- Forks
- 62
- Merge medio
- 13 h 53 min
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin 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 pluginsGLPI/datainjection
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
pluginsGLPI/datainjection#657 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de pluginsGLPI/datainjection
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Broken pathsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Automattic/custom-metadata#167 ·
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día