DATA IMPORT ERROR

Traceback (most recent call last):
File “/home/frappe/benches/bench-version-12-2019-08-13/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 407, in upload
doc = frappe.get_doc(doc)
File “/home/frappe/benches/bench-version-12-2019-08-13/apps/frappe/frappe/init.py”, line 734, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/benches/bench-version-12-2019-08-13/apps/frappe/frappe/model/document.py”, line 69, in get_doc
return controller(*args, **kwargs)
TypeError: init() keywords must be strings

Sorry fella, but you’ll have to include more info if you want help - it’s almost impossible to see the source of the error with so little info

I have seen this error several times when trying to import. it’s usually formatting error from your template. It’s possible a field that is supposed to be populated is left blank or the cells/rows have unidentifiable characters such as spaces before the text or numbers. It’s quite hard to trace really.

The data import templates are divided into zones. The boundaries of the zones are defined by the narrow columns that have nothing but the tilde character ( ~ ) at the top.

When populating any random column in a zone (the columns between the tilde boundaries) then you MUST also be sure to populate the columns in the same zone that are marked as “required = yes”

It is also valid to leave all fields in a zone empty and the system will not hang, but if you populate any filed in a zone you must then also populate all of the required fields in that zone as well.

There is no published document that tells the user about this requirement. It was something that I had to learn through many, many hours of debugging similar errors in import.

NOTE: the term ‘zone’ is not a recognized term on this forum or in erpnext/frappe docs anywhere that I could find. It is the term that I used to define for myself how to work through most of my import errors. You can call it anything you like.

This may not be the source of your error, but it is still good info to know and remember in practice while using import.

Hope this helps. As always… Your mileage may vary… :sunglasses:

BKM

1 Like

The mandatory fields can be found by clicking Download template on New import screen and choosing Mandatory from Select Columns dropdown.

HTH.