You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2019-10-31 19:37:18

frakka
Member
Registered: 2019-10-31
Posts: 4

Datainjection - PHP Warning while trying to import from csv.

Hi all.

I'm facing an issue importing lines from a csv with GLPI 9.4.0 and Datainjection in 2.7.0
After clicking on "Launch the import" everithing seems had worked well in a very few seconds fine but nothing was imported.

Putting interface in debug mode we get this errors:

PHP Notice: Undefined property: PluginDatainjectionBackendcsv::$file in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 200
PHP Warning: fopen(): Filename cannot be empty in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 200
PHP Warning: fread() expects parameter 1 to be resource, bool given in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 205 
PHP Warning: fseek() expects parameter 1 to be resource, bool given in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 207 
PHP Warning: fgetcsv() expects parameter 1 to be resource, bool given in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 226 
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 231 
PHP Notice: Trying to access array offset on value of type null in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 232 
PHP Warning: fgetcsv() expects parameter 1 to be resource, bool given in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 226 
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 231 
PHP Notice: Trying to access array offset on value of type null in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 232
PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 217 
PHP Notice: Undefined property: PluginDatainjectionBackendcsv::$file in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 245 
PHP Warning: unlink(): No such file or directory in /var/www/html/glpi/plugins/datainjection/inc/backendcsv.class.php at line 245

System info:

cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo) (<- Oracle Linux!)

php74 -v
PHP 7.4.0RC4 (cli) (built: Oct 15 2019 11:28:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0RC4, Copyright (c), by Zend Technologies

allow_url_fopen -> On



Any ideas?

Offline

#2 2019-11-14 10:50:22

frakka
Member
Registered: 2019-10-31
Posts: 4

Re: Datainjection - PHP Warning while trying to import from csv.

Up.

Offline

#3 2019-11-14 14:31:33

Kaya84
Member
Registered: 2019-06-13
Posts: 56

Re: Datainjection - PHP Warning while trying to import from csv.

Check folder permissions. Can Apache/NGINX write inside?

Offline

#4 2019-11-14 15:39:31

frakka
Member
Registered: 2019-10-31
Posts: 4

Re: Datainjection - PHP Warning while trying to import from csv.

Yes, folder's owner is apache and it can write into.

When I try to import the file I get this in my php-errors.log:

[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Notice(8): Undefined property: PluginDatainjectionBackendcsv::$file
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:200
  ...datainjection/inc/clientinjection.class.php:249 PluginDatainjectionBackendcsv->openFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fopen(): Filename cannot be empty
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:200 fopen()
  ...datainjection/inc/clientinjection.class.php:249 PluginDatainjectionBackendcsv->openFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fread() expects parameter 1 to be resource, bool given
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:205 fread()
  ...datainjection/inc/clientinjection.class.php:249 PluginDatainjectionBackendcsv->openFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fseek() expects parameter 1 to be resource, bool given
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:207 fseek()
  ...datainjection/inc/clientinjection.class.php:249 PluginDatainjectionBackendcsv->openFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fgetcsv() expects parameter 1 to be resource, bool given
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:226 fgetcsv()
  ...datainjection/inc/clientinjection.class.php:254 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): count(): Parameter must be an array or an object that implements Countable
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:231
  ...datainjection/inc/clientinjection.class.php:254 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Notice(8): Trying to access array offset on value of type null
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:232
  ...datainjection/inc/clientinjection.class.php:254 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fgetcsv() expects parameter 1 to be resource, bool given
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:226 fgetcsv()
  ...datainjection/inc/clientinjection.class.php:258 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): count(): Parameter must be an array or an object that implements Countable
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:231
  ...datainjection/inc/clientinjection.class.php:258 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Notice(8): Trying to access array offset on value of type null
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:232
  ...datainjection/inc/clientinjection.class.php:258 PluginDatainjectionBackendcsv->getNextLine()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): fclose() expects parameter 1 to be resource, bool given
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:217 fclose()
  ...datainjection/inc/clientinjection.class.php:306 PluginDatainjectionBackendcsv->closeFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Notice(8): Undefined property: PluginDatainjectionBackendcsv::$file
  Backtrace :
  plugins/datainjection/inc/backendcsv.class.php:245
  ...datainjection/inc/clientinjection.class.php:309 PluginDatainjectionBackendcsv->deleteFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}
[2019-11-14 13:09:45] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/html/glpi/inc/toolbox.class.php line 658
  *** PHP Warning(2): unlink(): No such file or directory
  Backtrace :
  :
  plugins/datainjection/inc/backendcsv.class.php:245 unlink()
  ...datainjection/inc/clientinjection.class.php:309 PluginDatainjectionBackendcsv->deleteFile()
  ...datainjection/inc/clientinjection.class.php:219 PluginDatainjectionClientInjection::processInjection()
  ...datainjection/front/clientinjection.form.php:40 PluginDatainjectionClientInjection::showInjectionForm()
  {"user":"6@htprodsrvit01vm.mydomain.it","mem_usage":"0.000\", 2.51Mio)"}

Offline

#5 2019-11-14 16:19:06

Kaya84
Member
Registered: 2019-06-13
Posts: 56

Re: Datainjection - PHP Warning while trying to import from csv.

Try to create a new simple model with, example, only field "name".
After that try to import and check log.

On error, describe all the process from model creating and CSV files type.

Offline

#6 Yesterday 12:06:00

frakka
Member
Registered: 2019-10-31
Posts: 4

Re: Datainjection - PHP Warning while trying to import from csv.

Seems has been the right input.
I'll try with our technicians as soon as possibile.

  Thank for your support.

Offline

Board footer

Powered by FluxBB