tomolimo / ticketcleaner

Home for Ticket Cleaner GLPI plugin
8 stars 2 forks source link

The plugin doesn't seem to work #4

Closed risbac closed 8 years ago

risbac commented 8 years ago

I installed it, it appears in the list of plugins, it's active, but nothing happens. I see only one line in the log file, saying "2016-08-03 12:25:51 Loading of sha1 files from 'C:\xampp2\htdocs\glpi/plugins/ticketcleaner/pictures' into DB done."

How can I find what is not working ? I don't see any other interesting error in the other log files.

tomolimo commented 8 years ago

Hello, Did you check the wiki? Thank you for using this plugin, Regards, Tomolimo

risbac commented 8 years ago

Yes, i read it, but didn't see anything to help. I have installed and set the plugin quite simply : it's only to remove attached images in the tickets. So I have put the images in the right folder on the server. But nothing at all in the log.

tomolimo commented 8 years ago

It will do its job only at creation or update of tickets/followups when creations/updates are done by emails, explained here: https://github.com/tomolimo/ticketcleaner/wiki#ticket-filters But about logs it has its own log files: in the glpi/files/_log folder, you should find a TicketCleaner.log file. The content of the log can be for example:

2016-08-25 13:45 Loading of sha1 files from '../plugins/ticketcleaner/pictures' into DB done. 2016-08-25 13:45 Ticket: 'Test of attributes' File: '../files/_tmp/image001.jpg' type: 'IMAGE/JPEG' sha1: '7429ea391a353eaf2a80b3f504ae377b5eee4e91' deleted: '1' File: '../files/_tmp/image002.jpg' type: 'IMAGE/JPEG' sha1: 'e016c0c36fc3004d9badf9c1f78186d4510d35dd' deleted: ''

in which you can see that image001.jpg has been deleted (deleted: '1') and the image002.jpg has not been deleted (deleted: '').

regards, Tomolimo

risbac commented 8 years ago

Thanks for your answer We are receiving new tickets by email (using a collector), with the attached files, and it's not doing anything, the log stays empty (except this first line that I included in my first message). So we have a lot of useless files attached to the new tickets, and it's not scanning them (otherwise we would see at least that it's not deleted, as shown in your example. But it's empty.

tomolimo commented 8 years ago

Yes, you are right, something, somewhere is not doing its job :( moreover, even if the attached files are not pictures, there is a trace in the logs, see below another example:

2016-09-07 03:10 Ticket: 'RE: [GLPI #0235461] New ticket - SAP-Data-Vendor' File: '../files/_tmp/C029-Vendor_20160907_V1.0.xlsx' type: 'APPLICATION/VND.OPENXMLFORMATS-OFFICEDOCUMENT.SPREADSHEETML.SHEET' 2016-09-07 03:34 Ticket: 'RE: [GLPI #0235064] Updating follow-up - SAP-DATA-PIR' File: '../files/_tmp/GW_TMPL_DAT_C030-Purchase Info Records V1.H.xls' type: 'APPLICATION/VND.MS-EXCEL' 2016-09-07 04:13 Ticket: 'Cannot open Powerpoint attachements' File: '../files/_tmp/image001.png' type: 'IMAGE/PNG' sha1: '9dcb4bc88963a56a654a25ab7732d2aa36b2dd5a' deleted: '' File: '../files/_tmp/image002.png' type: 'IMAGE/PNG' sha1: '6cc7d8cbb55088404ce6a1c7c1828ec674aac723' deleted: '' File: '../files/_tmp/GW_CN_GOV_China%20V2%20%20INTERNALFlash%20Report_2016W35.pptx' type: 'APPLICATION/VND.OPENXMLFORMATS-OFFICEDOCUMENT.PRESENTATIONML.PRESENTATION' 2016-09-07 04:17 Ticket: 'RE: SAP-DATA-CUSTOMER WK' File: '../files/_tmp/C004-Customers_20160906.xlsx' type: 'APPLICATION/VND.OPENXMLFORMATS-OFFICEDOCUMENT.SPREADSHEETML.SHEET' 2016-09-07 04:31 Ticket: 'Cannot edit CAD data ' File: '../files/_tmp/cutline for error information.png' type: 'IMAGE/PNG' sha1: 'd07710bcd024df5b673924208b644a61fe12018e' deleted: '' 2016-09-07 04:34 Ticket: 'WPAD problem' File: '../files/_tmp/image001.jpg' type: 'IMAGE/JPEG' sha1: '7429ea391a353eaf2a80b3f504ae377b5eee4e91' deleted: '1' File: '../files/_tmp/image002.jpg' type: 'IMAGE/JPEG' sha1: '1c1deb6553fd9d59b9b30091e4b546c74d66c0d8' deleted: '1' 2016-09-07 05:51 Ticket: 'PS : Settlement issue' File: '../files/_tmp/image001.jpg' type: 'IMAGE/JPEG' sha1: '7429ea391a353eaf2a80b3f504ae377b5eee4e91' deleted: '1' File: '../files/_tmp/image002.jpg' type: 'IMAGE/JPEG' sha1: '1c1deb6553fd9d59b9b30091e4b546c74d66c0d8' deleted: '1' File: '../files/_tmp/export.XLSX' type: 'APPLICATION/VND.OPENXMLFORMATS-OFFICEDOCUMENT.SPREADSHEETML.SHEET' 2016-09-07 05:56 Ticket: '徐玲玲BPM异动!' File: '../files/_tmp/Internal Mobility NotificationXLL.PDF' type: 'APPLICATION/PDF' 2016-09-07 06:26 Ticket: 'Error in P.O process.' File: '../files/_tmp/image001.jpg' type: 'IMAGE/JPEG' sha1: '7e6e805f627774530b7bbf80a4d943bbc2cb6947' deleted: '' File: '../files/_tmp/image002.jpg' type: 'IMAGE/JPEG' sha1: '7429ea391a353eaf2a80b3f504ae377b5eee4e91' deleted: '1' File: '../files/_tmp/image003.jpg' type: 'IMAGE/JPEG' sha1: '1c1deb6553fd9d59b9b30091e4b546c74d66c0d8' deleted: '1'

Are you ready to dig into the source files?

risbac commented 8 years ago

Sure, no problem! By the way, it's a GLPI 0.90.3 install. Windows server.

tomolimo commented 8 years ago

then let's go!

First, I need some info about GLPi:

Could you get the ones from the 'Setup > General' form and 'System information' tab, below 'Information about system installation and configuration': copy the info below in the [code]...[/code] section and paste them here?

risbac commented 8 years ago

here it is

[code]

GLPI 0.90.3 (/glpi => C:\xampp2\htdocs\glpi)

Server

Operating system: Windows NT TEBUVEEAM01 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) i586 PHP 7.0.6 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, apache2handler, bcmath, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, session, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, zlib) Setup: max_execution_time="90" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="2M" Software: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.6 (Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.6 Server at ithelps.tebu-bio.com Port 80) Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36 Server Software: mariadb.org binary distribution Server Version: 10.1.13-MariaDB Server SQL Mode: NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: GLPI@localhost/glpi Host info: localhost via TCP/IP

OKC:\xampp2\htdocs\glpi/config : OK OKC:\xampp2\htdocs\glpi/files : OK OKC:\xampp2\htdocs\glpi/files/_dumps : OK OKC:\xampp2\htdocs\glpi/files/_sessions : OK OKC:\xampp2\htdocs\glpi/files/_cron : OK OKC:\xampp2\htdocs\glpi/files/_graphs : OK OKC:\xampp2\htdocs\glpi/files/_lock : OK OKC:\xampp2\htdocs\glpi/files/_plugins : OK OKC:\xampp2\htdocs\glpi/files/_tmp : OK OKC:\xampp2\htdocs\glpi/files/_rss : OK OKC:\xampp2\htdocs\glpi/files/_uploads : OK OKC:\xampp2\htdocs\glpi/files/_pictures : OK OKC:\xampp2\htdocs\glpi/files/_log : OK Web access to files directory is protectedWeb access to files directory is protected : OK

Libraries

htmLawed version 1.1.21 in (C:\xampp2\htdocs\glpi\lib\htmlawed) phpCas version 1.3.4 in (C:\xampp2\htdocs\glpi\lib\phpcas) PHPMailer version 5.2.8 in (C:\xampp2\htdocs\glpi\lib\phpmailer) ZetaComponent ezcGraph installed in (C:\xampp2\htdocs\glpi/lib/zeta/Base): OK Zend Framework version 2.4.9 in (C:\xampp2\htdocs\glpi\lib\Zend) SimplePie version 1.3.1 in (C:\xampp2\htdocs\glpi\lib\simplepie) TCPDF version 6.2.12 in (C:\xampp2\htdocs\glpi\lib\tcpdf) ircmaxell/password-compat in (C:\xampp2\htdocs\glpi\lib\password_compat). Compatitility: Ok

LDAP directories

Server: '192.168.5.2', Port: '389', BaseDN: 'OU=Utilisateurs Globaux,DC=tebu-bio,DC=com', Connection filter: '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN: 'annuaire@tebu-bio.com', Use TLS: none

Mysql replicas

Not active

Notifications

Way of sending emails: SMTP+TLS (ithelps@tebu-bio.com@smtp.office365.com)

Mails receivers

Name: 'ithelps@tebu-bio.com' Active: Yes Server: '{outlook.office365.com:993/imap/ssl/notls}INBOX' Login: 'ithelps@tebu-bio.com' Password: Yes

Plugins list

fusioninventory      Name: FusionInventory                Version: 0.90+1.3   State: Enabled
ocsinventoryng       Name: OCS Inventory NG               Version: 1.2.1      State: Not installed
ticketcleaner        Name: Ticket Cleaner                 Version: 2.0.3      State: Enabled

[/code]

tomolimo commented 8 years ago

Everything seems OK, apart Apache for which you should use fastcgi with PHP instead of apachehandler. Fastcgi is faster than apachehandler, but anyway this is not the current issue :).

I'm going to reproduce your setting on my own development machine, and test TicketCleaner (I will use my own IIS, but it has nothing to do with current issue).

risbac commented 8 years ago

It's a XAMPP installation that I didn't set, so i guess it's the default settings. It would be better with fastcgi indeed, I might look at that later. but as you said, it has nothing to do with the current issue. :)

Thanks for your effort on this !

tomolimo commented 8 years ago

In the TicketCleaner settings: did you de-active all the default filters?

risbac commented 8 years ago

There is absolutely nothing in the filters. I don't think I deactivated anything, I never saw anything there I think.

tomolimo commented 8 years ago

ok, I was wondering if there was an interaction between text filters and picture filters. I'll see the picture problem after lunch :)

risbac commented 8 years ago

Good appetite :)

tomolimo commented 8 years ago

Hello, There is a bug that I'm going to fix ASAP. Tomolimo

risbac commented 8 years ago

Great if it helps to find a bug ! Thanks for your help!

tomolimo commented 8 years ago

Hello, You may test this new release. Thank you, Regards, Tomolimo

risbac commented 8 years ago

great, going to test it !

risbac commented 8 years ago

Now I do have a log, it seems to be working much better ! Thank you for the very fast fix, Tomolimo ! It's really useful and appreciated.

tomolimo commented 8 years ago

you're welcome