I'm using the Category module, and wrote some code to bulk-add some container nodes for a ridiculously multi-tiered hierarchical site I'm working on. The code reads-in a CSV file & creates Category nodes with appropriate parent-child relationships. When I get up to node 422, I get a very long series of errors that look much like the following:

Warning: MySQL server has gone away query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'MySQL server has gone away\nquery: UPDATE cache SET data = 'a:4:{s:6:\\"tables\\";a:361:{s:4:\\"node\\";a:5:{s:4:\\"name\\";s:4:\\"node\\";s:8:\\"provider\\";s:8:\\"internal\\";s:6:\\"fields\\";a:7:{s:5:\\"title\\";a:6:{s:4:\\"name\\";s:11:\\"Node: Title\\";s:7:\\"handler\\";a:2:{s:28:\\"views_handler_field_nodelink\\";s:6:\\"Normal\\";s:38:\\"views_handler_field_nodelink_with_mark\\";s:17:\\"With updated mark\\";}s:6:\\"option\\";a:2:{s:5:\\"#type\\";s:6:\\"select\\";s:8:\\"#options\\";a:2:{s:4:\\& in E:\www\drupal\includes\database.mysql.inc on line 120

All of the errors reference the watchdog table, though the content differs slightly for each one. There are probably about 20 errors like this every time I try to view any page.

Manually deleting node 422 from the node table generally eliminates the error. There's nothing special about the content of the node, either -- I've tried filling it with a variety data. It seems that this error is usually associated with uploading huge files. That's not the case here -- I'm just creating an empty structure which will filled-in later. If using the Category module isn't the best idea, I'm willing to look at other possibilities. But I also don't want to start down a new path and encounter the same problem.

I'm really at my wit's end here. If you have any idea of what might be going on, please help. I've tried to do my homework on this and I can't seem to find anyone who's encountered a similar problem. Any help or response would be greatly apprecaited.

Comments

treepour’s picture

In case anyone else encounters a similar difficulty (though it seems I must be the only one, as I found little on the web and no one has responded), the issue was that I hadn't optimized MySQL for high-volume transactions. I used the settings suggested at http://drupal.org/node/85735 and the problem went away.