pluginsGLPI / fields

Additionals fields for GLPI
http://glpi-plugins.rtfd.io/en/latest/fields/index.html
GNU General Public License v2.0
90 stars 66 forks source link

Impossible d'ajouter un champ - http error 500 #79

Closed sebquid closed 7 years ago

sebquid commented 7 years ago

Bonjour,

Je viens d'installer la version 1.3.1 du plugin. Je peux créer un nouveau bloc mais impossible d'ajouter des champs supplémentaires. J'obtiens une erreur 500 quand je clique sur "ajouter". Quand je regarde le fichier log d'apache, j'ai l'erreur php suivante:

[Tue Nov 08 09:48:17 2016] [error] [client 192.168.254.120] PHP Fatal error: Class 'PluginFieldsPrintercotlapage' not found in /var/www/glpi/plugins/fields/inc/field.class.php on line 116, referer: http://glpi.ayme.fr/plugins/fields/front/container.form.php?id=1

Merci pour votre aide

Sébastien

GLPI 9.1 Fields 1.3.1 FormCreator 0.90-1.3.4 Genericobject 2.4.0 Orders 1.9.5 Datainjection 2.4.2 Mreporting 1.3.0

trasher commented 7 years ago

Hum... Sounds strange. I'll try to reproduce when I can.

sebquid commented 7 years ago

Hi

Is there a way to edit files in order to get it work with some piece of added code or directly in the database. In fact, I really need to add new fields quickly for printers and the more I wait the more It will be difficult for me to finish the job I have been asked to achieve. Thanks for your help anyway.

trasher commented 7 years ago

Could you please check if the file glpi/files/_plugins/fields/inc/printercotlapage.class.php does exist?

This should contain the class PluginFieldsPrintercotlapage instruction.

sebquid commented 7 years ago

Nop. There's no file in glpi/files/_plugins/fields/inc/.

trasher commented 7 years ago

I suspect the error you've pointed out is a result and not a cause.

Did you have any other log entries in your php system log file or in the glpi errro log file?

sebquid commented 7 years ago

I found only this error but nothing more except the message I noticed in my first post . Can you tell me exactly which log you want me to check

2016-11-07 18:38:13 [1894@glpi] ** MySQL query error: SQL: SELECT FROM glpi_plugin_fields_fields WHERE type = \"dropdown\" Error: Table 'glpi.glpi_plugin_fields_fields' doesn't exist Backtrace : inc/commondbtm.class.php:254
plugins/fields/inc/dropdown.class.php:24 CommonDBTM->find() : PluginFieldsDropdown::install() plugins/fields/hook.php:48 call_user_func() inc/plugin.class.php:664 plugin_fields_install() : Plugin->install() front/plugin.form.php:49 call_user_func()

trasher commented 7 years ago

I was talking about files in glpi/files/_log/.

As far as I can see, the plugin is not correctly installed; you probably get errors at install time. Or maybe is it an issue with another enabled plugin?

I do not know, but if the plugin is not installed correctly, you can't add anything into it...

sebquid commented 7 years ago

I had no error during the install. I'll try to install it again. But I tried already before and It was the same.

trasher commented 7 years ago

If you get the error Table 'glpi.glpi_plugin_fields_fields' doesn't exist; something went wrong somewhere during the installation.

Do you have glpi_plugin_fields_ tables available? Which ones?

sebquid commented 7 years ago

Here are the tables:: glpi_plugin_fields_containers glpi_plugin_fields_fields glpi_plugin_fields_profiles

trasher commented 7 years ago

You say that glpi_plugin_fields_fields table do exists, but glpi cannot find it. Are your sure you're looking on the correct database? Are you sure there are no acces issues from glpi user?

sebquid commented 7 years ago

I don't think so. I have no problem with other plugins. How can I check that?

trasher commented 7 years ago

Check in config/config_db.php for the database used (glpi from your logs). And you can check the acsl using the user defined in the config to connect and run for example a SELECT * FROM glpi_plugin_fields_fields; for example.

sebquid commented 7 years ago

When I tried to install the plugin before and I saw It was not working I used a snapshot to restore my previous state (vmware). This time, I tried to uninstall it but it does not work and it is blocked on "Désinstallation des tables MySQL" with this error in apache log

PHP Fatal error: Class 'PluginFieldsPrintercotlapage' not found in /var/www/glpi/plugins/fields/inc/container.class.php on line 356, referer: http://glpi.ayme.fr/front/plugin.php

trasher commented 7 years ago

Hum... Uninstall should be improved, I've open a new ticket for this (#90).

You can still uninstall manually:

I really hope a new install will give additional informations, I'm unable to reproduce any of your issues... I'm stucked for now.

sebquid commented 7 years ago

I did a fresh install and I am still in trouble. Here ere the erros just after installing the plugin and without trying to add fields): ***/files_log/sql-erros.log: 2016-11-29 09:40:24 [1894@glpi] * MySQL query error: SQL: SELECT * FROM glpi_plugin_fields_fields WHERE type = \"dropdown\" Error: Table 'glpi.glpi_plugin_fields_fields' doesn't exist Backtrace : inc/commondbtm.class.php:254
plugins/fields/inc/dropdown.class.php:24 CommonDBTM->find() : PluginFieldsDropdown::install() plugins/fields/hook.php:48 call_user_func() inc/plugin.class.php:664 plugin_fields_install() : Plugin->install() front/plugin.form.php:49 call_user_func()

I have no other error at this time. And there is no files in /glpi/files/_plugins/fields/front/ and /glpi/files/_plugins/fields/inc

trasher commented 7 years ago

If the table have been created but GLPI cannot see it; I have really no idea what's going wrong.

sebquid commented 7 years ago

Yes I have three tables in mysql:

glpi_plugin_fields_containers glpi_plugin_fields_fields glpi_plugin_fields_profiles

Could it be it has something to to with mysql or php version?

sebquid commented 7 years ago

I used field 1.3.1. Should I try a previous release?

trasher commented 7 years ago

I do not think PHP version can be an issue here. MySQL or its configuration can be; but it should certainly also cause issues with other plugins or GLPI core itself...

You can try with an older or the newer release, but honestly, I'm not sure it will change anything.

sebquid commented 7 years ago

I'm lost. It's really strange. When I add a new bloc it is created in glpi_plugin_fields_containers table. But when I try to add a new field, nothing happens. If I add it manually in glpi_plugin_fields_fields table, it works and profiles are added in glpi_plugin_fields_profiles. But I can't see fields in printer items (for example). It says "chargement en cours" if I click on the tab where the added fields should be found. I will try to install a previous release tomorrow to see if it works.

trasher commented 7 years ago

Could you please give us you system configuration? (see Setup > Genral > System)

sebquid commented 7 years ago

Hi,

Here are the details:

Informations sur le système, l'installation et la configuration [code]

GLPI 9.1 ( => /var/www/glpi)

Server

Operating system: Linux glpi 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u1 x86_64 PHP 5.4.4-14+deb7u12 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, apache2handler, bcmath, bz2, calendar, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, json, ldap, libxml, mbstring, mcrypt, mhash, mysql, mysqli, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, shmop, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, zip, zlib) Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="5M" Software: Apache/2.2.22 (Debian) (Apache/2.2.22 (Debian) Server at glpi.ayme.fr Port 80) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36 Server Software: (Debian) Server Version: 5.5.38-0+wheezy1 Server SQL Mode: Parameters: root@localhost/glpi Host info: Localhost via UNIX socket

OK/var/www/glpi/config : OK OK/var/www/glpi/files : OK OK/var/www/glpi/files/_dumps : OK OK/var/www/glpi/files/_sessions : OK OK/var/www/glpi/files/_cron : OK OK/var/www/glpi/files/_graphs : OK OK/var/www/glpi/files/_lock : OK OK/var/www/glpi/files/_plugins : OK OK/var/www/glpi/files/_tmp : OK OK/var/www/glpi/files/_rss : OK OK/var/www/glpi/files/_uploads : OK OK/var/www/glpi/files/_pictures : OK OK/var/www/glpi/files/_log : OK

Libraries

htmLawed version 1.1.21 in (/var/www/glpi/lib/htmlawed) phpCas version 1.3.4 in (/var/www/glpi/vendor/jasig/phpcas/source) PHPMailer version 5.2.16 in (/var/www/glpi/vendor/phpmailer/phpmailer) Zend Framework in (/var/www/glpi/vendor/zendframework/zend-loader/src) zetacomponents/graph in (/var/www/glpi/vendor/zetacomponents/graph/src) SimplePie version 1.4.1 in (/var/www/glpi/vendor/simplepie/simplepie/library) TCPDF version 6.2.12 in (/var/www/glpi/vendor/tecnickcom/tcpdf) ircmaxell/password-compat in (/var/www/glpi/vendor/ircmaxell/password-compat/lib) ramsey/array_column in (/var/www/glpi/vendor/ramsey/array_column/src) michelf/php-markdown in (/var/www/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/var/www/glpi/vendor/true/punycode/src) iacaml/autolink in (/var/www/glpi/vendor/iamcal/lib_autolink) sabre/vobject in (/var/www/glpi/vendor/sabre/vobject/lib) guzzlehttp/guzzle in (/var/www/glpi/vendor/guzzlehttp/guzzle/src)

LDAP directories

Server: '192.168.254.29', Port: '389', BaseDN: 'DC=ayme,DC=fr', Connection filter: '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN: 'glpi@ayme.fr', Use TLS: none

SQL replicas

Not active

Notifications

Way of sending emails: SMTP+TLS (assistance-dsi@ayme.fr@192.168.254.32)

Mails receivers

Name: 'test' Active: No Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'xxxxxxx.x@xxxxx.xx' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/collecteur' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'freund.d@ayme.fr' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/collecteur' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'dsi@ayme.fr' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/collecteur' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'xxxxxxx.x@xxxxx.xx' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/collecteur' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'xxxxxxx.x@xxxxx.xx' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/GLPI/COLLECTEUR' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes Name: 'xxxxxxx.x@xxxxx.xx' Active: Yes Server: '{hermes.ayme.fr/imap/novalidate-cert/tls}INBOX/collecteur' Login: 'xxxxxxx.x@xxxxx.xx' Password: Yes

Plugins list

formcreator          Name: Formulaires                    Version: 0.90-1.3.4 State: Enabled
genericobject        Name: Gestion d'objets               Version: 2.4.0      State: Enabled
order                Name: Gestion des commandes          Version: 1.9.5      State: Enabled
datainjection        Name: Injection de fichiers          Version: 2.4.2      State: Enabled
mreporting           Name: Plus de rapports               Version: 1.3.0      State: Enabled

[/code]

sebquid commented 7 years ago

Hi,

Do you think the issue could be linked to another plugin? I really need to make it work.

Thanks

sebquid commented 7 years ago

Hi,

I tried to install it again but this time I disabled other plugins during the install. After the install I enabled other plugins again and everything is working now. Yes. Thanks anyway for your time.

trasher commented 7 years ago

OK, good catch ; I did not think another plugin would cause such issues... Maybe would it be interesting to find which plugin was in cause for further investigations (on fields side and/or on the other side).