ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

ERPNext Data import failed

I tried to import about 30K entries by csv file and firstly the background job works like a charm for some times and I successfully add some entries about 7K and after that the background job is terminated with this error message, How can I fix that? and what is the best practice or system configuration for importing large csv data?

Blockquote
rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (6000 seconds)

Blockquote
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 126, in import_data
doc = self.process_doc(doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 194, in process_doc
return self.insert_record(doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 213, in insert_record
new_doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 233, in insert
self.set_new_name(set_name=set_name, set_child_names=set_child_names)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 423, in set_new_name
set_new_name(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 61, in set_new_name
set_name_from_naming_options(autoname, doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 92, in set_name_from_naming_options
set_name_by_naming_series(doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 122, in set_name_by_naming_series
doc.name = make_autoname(doc.naming_series+".#####", “”, doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 155, in make_autoname
n = parse_naming_series(parts, doctype, doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 170, in parse_naming_series
part = getseries(n, digits)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py”, line 200, in getseries
current = frappe.db.sql(“SELECT current FROM tabSeries WHERE name=%s FOR UPDATE”, (key,))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 147, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 692, in _read_packet
packet_header = self._read_bytes(4)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_bytes
data = self._rfile.read(num_bytes)
File “/usr/lib/python3.6/socket.py”, line 586, in readinto
return self._sock.recv_into(b)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/timeouts.py”, line 64, in handle_death_penalty
‘({0} seconds)’.format(self._timeout))
rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (6000 seconds)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py”, line 104, in start_import
i.import_data()
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 167, in import_data
frappe.db.rollback()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 771, in rollback
self.sql(“rollback”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 153, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 547, in query
self._execute_command(COMMAND.COM_QUERY, sql)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 793, in _execute_command
raise err.InterfaceError(0, “”)
pymysql.err.InterfaceError: (0, ‘’)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 104, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py”, line 106, in start_import
frappe.db.rollback()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 771, in rollback
self.sql(“rollback”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 153, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 547, in query
self._execute_command(COMMAND.COM_QUERY, sql)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 793, in _execute_command
raise err.InterfaceError(0, “”)
pymysql.err.InterfaceError: (0, ‘’)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/worker.py”, line 1013, in perform_job
rv = job.perform()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 709, in perform
self._result = self._execute()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 732, in _execute
result = self.func(*self.args, **self.kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 127, in execute_job
frappe.db.rollback()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 771, in rollback
self.sql(“rollback”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 153, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 547, in query
self._execute_command(COMMAND.COM_QUERY, sql)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 793, in _execute_command
raise err.InterfaceError(0, “”)
pymysql.err.InterfaceError: (0, ‘’)