-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strange recurrent SQL error #1264
Comments
Hello, |
To answer your question: if you want to cancel the integration of this email, you have to delete it from the mailbox. GLPi is still trying to insert it as it is kept in the mailbox |
regarding the is_private field value: as the field is an integer, there is no need for the quotes, but I believe the real root cause is the ' in |
It seems that the collector mailbox is empty. Trying to investigate further more. |
you mean on your mail server? |
Yes I confirm : the mailbox is empty. GLPI is configured with POP |
Sorry, the mailbox is not empty, I was looking in the wrong one. The message was in the user's mailbox corresponding to the "'Reply-to" field, as configured in GLPI. That's pure logic. Regards, |
Is it possible, in the future, to have quotes really escaped ? |
they are really :), as I said, I cannot reproduce the issue, mine quotes are escaped. |
Oh sh... I have deleted the message, forgot your request. |
Full error message needed, with the SQL error message and the backtrace. is_private being not escaped IS NOT the issue. |
The full error message is at the top of this thread. |
Forgot the backtrace. 2016-11-09 10:26:01 [@glpi] |
unfortunately, the attached text file is not a real email: it's an email representation! |
It was not. The important part if "near 'identifiant sur la boite laposte.net" |
???
When sending an email with body: |
I didn't say the code does not escape the body ;) |
ok :) |
In mailcollector, we have $tkt = Toolbox::addslashes_deep($tkt); But in TicketFollowup::prepareInputForAdd So, I think that if a mail contains an encoded quote ("'"), this can raise such issue. |
Hello, |
I've just tested adding a followup to a ticket with single quote from a "standard" mailer and from gmail on current 9.1/bugfixes branch (mostly 9.1.3); I cannot reproduce the issue. |
Does the last version correct this problem ? Bonne fin de journée :) |
Last comment : when going to "configuration -> receivers" and clicking on the "list of not imported emails" button, GLPI does import the emails with no errors. |
I have the same issue for emails coming from Gmail. Single quotes are HTML encoded (') and are not backslashed by Toolbox::addslashes_deep, and MySQL receive the INSERT with single quotes (converted to text), which creates an error. I think it's a non sense to confuse and mix « rich text » and handling HTML encoded quotes. Incomig emails should be correctly handled, whatever users want in their UI. Requesters send emails with their favorite app, and do not care how GLPI is configured. Here is a quick patch that will patch HTML quotes (inc/mailcollector.class.php:966): |
So, to resume; this issue happens when an ticket is opened without rich text and when there is something like |
Hi, Not for me, this behavior occurs when a user reply to a ticket previusly opened and when the body of email contain an ' (apostrof) for example "L'Altet" in this case, we have on sql-errors.log the next message " Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Altet - C/ dels Molins, 4 Apdo. de correos 914\n\n46870 Ontinyent / " Only occurs on reply to tickets previusly opened, on new tickets this behavior not occur. https://www.fileformat.info/info/unicode/char/27/index.htm Regards |
To all participants, (maybe recent one btw, ping @lgigant & @jcheger). Could you test the following change and let us know the resolution of this issue: |
Hey, I manually applied the changes from commit 0fbb2f0 2018-06-07 10:33:22 [33@GLPI] |
Try with latest 9.2/bugfixes |
I don't understand what you mean. That version is earlier then what I run, 9.2.1 and where this commit will be applied 9.2.4. Sorry if I am missing something obvious... |
@chaoservices, here is some nightly tarballs: https://forge.glpi-project.org/tarballs/ |
It doesn't seem that this is completely fixed yet. I upgraded to 9.2.4 and changed back to plain text mode. I have a stuck message with the same error. The body has the word "can't" in it. |
Ok I just confirmed. I changed To |
Thanks for your notice, above pr include the changes (#418) |
Thanks @orthagh |
Hello team,
I have a strange bug with GLPI 9.1. Extract from sql-errors.log :
2016-11-09 08:51:02 [@glpi]
*** MySQL query error:
SQL: INSERT
INTO
glpi_ticketfollowups
(content
,tickets_id
,users_id
,requesttypes_id
,is_private
,date
,date_creation
,date_mod
) VALUES ('Bonsoir,\nJe vous réponds pour vous donner la réponse à ma question secrète : xxxx,\nSi je me suis trompé, pourriez vous quand même envoyer l'identifiant sur la boite laposte.net ? \nVous remerciant d'avance,\nCordialement,\nA. François\n\nLe 4 novembre 2016 à 22:22, <helpdesk@univ-poitiers.fr> a écrit :\n\n \n\n','2602','0','0',0,'2016-11-09 08:51:01','2016-11-09 08:51:01','2016-11-09 08:51:01')As you can see, the value of the field "is_private" is not delimited by simple quotes. There is a new line in sql-erros.log every 5 minutes (this is the time-step I choosed for cron) since #4 of november.
So I have 2 or 3 questions :
Sincerely,
Valéry
config_GLPI.txt
The text was updated successfully, but these errors were encountered: