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?