Getting this error While running one query

Hi
I have used one query with Inner Join for script report. Query is working fine and returning around 4k rows in mysql server. But when i am running from frappe code and using frappe --ipython console. its giving this error. It looks like its bug in system.

/home/ubuntu/frappe-bench/apps/frappe/frappe/database.pyc in sql(self, query, values, as_dict, as_list, formatted, debug, ignore_ddl, as_utf8, auto_commit, update)
123 frappe.log(“>>>>”)
124
→ 125 self._cursor.execute(query)
126 except Exception, e:
127 # ignore data definition errors

/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.pyc in execute(self, query, args)
203 del tb
204 self.messages.append((exc, value))
→ 205 self.errorhandler(self, exc, value)
206 self._executed = query
207 if not self._defer_warnings: self._warning_check()

/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.pyc in defaulterrorhandler(failed resolving arguments)
34 del cursor
35 del connection
—> 36 raise errorclass, errorvalue
37
38 re_numeric_part = re.compile(r"^(\d+)")

OperationalError: (2006, ‘MySQL server has gone away’)

Its not a bug in the system the error clearly states that your mysql server has gone away meaning your mysql process needs to be restarted.

Hi Aditya
Thanks for brief details, but i am running this query on “mysql” directly then its executing and returning complete records. I am facing this issue only i am executing it through frappe db API.

Regards
Chetan

Could be a timeout error.