Help with Web to Lead Person Form

I’ve done web to lead forms a bunch of times and its easy. Create the form and paste it into wordpress. Works! However, this time no matter what I do the form doesn’t submit, it just crashes my SuiteCRM database.???

I’ve tried re-creating it a few times with the same result. I’m on Ver. 7.9.17

Anyone have any ideas? I pasted the error below:

Sat Nov 3 19:20:52 2018 [3706123][-none-][FATAL] Retrieving record by id users:d0c89976-9db3-bd9c-708a-5ba3e4a3cca7 found Query Failed: SELECT users.* FROM users WHERE users.id = ‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Sat Nov 3 19:20:52 2018 [3708438][-none-][FATAL] Retrieving record by id users:d0c89976-9db3-bd9c-708a-5ba3e4a3cca7 found Query Failed: SELECT users.* FROM users WHERE users.id = ‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not authenticate.
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not authenticate.
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] Notifications: error sending e-mail (method: smtp), (error: SMTP Error: Could not authenticate.)
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] Error inserting into table: leads: Query Failed: INSERT INTO leads (id,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,first_name,last_name,do_not_call,converted,status,account_name,campaign_id)
VALUES (‘f1f3c65b-8a85-0002-9244-5bddf806195e’,‘2018-11-03 19:34:42’,‘2018-11-03 19:34:42’,‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’,‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’,‘testing ‘,0,‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’,‘Paul’,‘Stevens’,0,0,‘New’,‘igo’,‘142d8c24-fa5a-ec41-1be5-5bddf7c30481’): MySQL error 2006: MySQL server has gone away
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] Exception handling in /home/td48gwukc4px/theexpertsontime.com/crm/include/MVC/Controller/SugarController.php:402
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Sat Nov 3 19:37:28 2018 [3814476][d0c89976-9db3-bd9c-708a-5ba3e4a3cca7][FATAL] backtrace:
#0 /home/td48gwukc4px/theexpertsontime.com/crm/include/database/DBManager.php(353): sugar_die(‘Database failur…’)
#1 /home/td48gwukc4px/theexpertsontime.com/crm/include/database/DBManager.php(328): DBManager->registerError(‘Error inserting…’, ‘Error inserting…’, true)
#2 /home/td48gwukc4px/theexpertsontime.com/crm/include/database/MysqliManager.php(160): DBManager->checkError(‘Error inserting…’, true)
#3 /home/td48gwukc4px/theexpertsontime.com/crm/include/database/DBManager.php(519): MysqliManager->query(‘INSERT INTO lea…’, true, ‘Error inserting…’)
#4 /home/td48gwukc4px/theexpertsontime.com/crm/data/SugarBean.php(2062): DBManager->insert(Object(Lead))
#5 /home/td48gwukc4px/theexpertsontime.com/crm/include/SugarObjects/templates/person/Person.php(191): SugarBean->save(true)
#6 /home/td48gwukc4px/theexpertsontime.com/crm/modules/Leads/Lead.php(561): Person->save(true)
#7 /home/td48gwukc4px/theexpertsontime.com/crm/modules/Campaigns/WebToPersonCapture.php(186): Lead->save(true)
#8 /home/td48gwukc4px/theexpertsontime.com/crm/include/MVC/Controller/SugarController.php(1014): require_once(’/home/td48gwukc…’)
#9 /home/td48gwukc4px/theexpertsontime.com/crm/include/MVC/Controller/SugarController.php(465): SugarController->handleEntryPoint()
#10 /home/td48gwukc4px/theexpertsontime.com/crm/include/MVC/Controller/SugarController.php(373): SugarController->process()
#11 /home/td48gwukc4px/theexpertsontime.com/crm/include/MVC/SugarApplication.php(105): SugarController->execute()
#12 /home/td48gwukc4px/theexpertsontime.com/crm/index.php(52): SugarApplication->execute()
#13 {main}
Sat Nov 3 19:37:28 2018 [3814631][-none-][FATAL] Retrieving record by id users:d0c89976-9db3-bd9c-708a-5ba3e4a3cca7 found Query Failed: SELECT users.* FROM users WHERE users.id = ‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Sat Nov 3 19:37:28 2018 [3818426][-none-][FATAL] Retrieving record by id users:d0c89976-9db3-bd9c-708a-5ba3e4a3cca7 found Query Failed: SELECT users.* FROM users WHERE users.id = ‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away
Sat Nov 3 19:37:28 2018 [3825134][-none-][FATAL] Retrieving record by id users:d0c89976-9db3-bd9c-708a-5ba3e4a3cca7 found Query Failed: SELECT users.* FROM users WHERE users.id = ‘d0c89976-9db3-bd9c-708a-5ba3e4a3cca7’ AND users.deleted=0 LIMIT 0,1: MySQL error 2006: MySQL server has gone away

I’ve been able to narrow it down to the assigned_user_id. If I remove that from the form, it posts to SuiteCRM no problem. For some reason (and I’ve tried a few other integrations other than the SuiteCRM form) if you post the assigned_user_id it locks up the database and doesn’t post.

This is a pretty much new installation, the table shouldn’t be corrupted. Anyone else having this kind of issue with assigned_user_id from web to lead form?

I didn’t try your specific scenario, but that “MySQL has gone away” error is not simply a wrong query with malformed SQL. It is your database crashing.

You can see here a bunch (quite a bunch) of possible causes:

https://dev.mysql.com/doc/refman/8.0/en/gone-away.html

Maybe you can try some database maintenance, check for oversized tables: see first query in this post:

https://pgorod.github.io/Database-tables-size/

and try any repairs or rebuilding indeces that look promising. Make sure you backup first.

1 Like

If anyone else runs into this, after a whole lot of troubleshooting, there was nothing wrong with my DB. The client didn’t set up their outbound email account properly. I guess sending the email notifying the assigned user is part of the import process. When this timed out, the leads never got imported. Every time I included the assigned user it would crash and time out.

Fixed the outbound email account and voila… works smoothly.

I’m glad you got it working, but I fear this error is too cryptic for anybody running into it in the future…

I wonder if we could give it a better error-handling, did you look into code, do you know where exactly this could be caught?