Import Failed (Item) - expected string or buffer

I try to import Item using import tools, but returned an error

  File "/home/osboxes/modenas-bench/apps/frappe/frappe/core/doctype/data_import/", line 385, in upload
  File "/home/osboxes/modenas-bench/apps/frappe/frappe/model/", line 219, in insert
  File "/home/osboxes/modenas-bench/apps/frappe/frappe/model/", line 443, in _validate
  File "/home/osboxes/modenas-bench/apps/frappe/frappe/model/", line 787, in _extract_images_from_text_editor
    extract_images_from_doc(self, df.fieldname)
  File "/home/osboxes/modenas-bench/apps/frappe/frappe/utils/", line 371, in extract_images_from_doc
    content = extract_images_from_html(doc, content)
  File "/home/osboxes/modenas-bench/apps/frappe/frappe/utils/", line 405, in extract_images_from_html
    content = re.sub('<img[^>]*src\s*=\s*["\'](?=data:)(.*?)["\']', _save_file, content)
  File "/home/osboxes/modenas-bench/env/lib64/python2.7/", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer

here is my template:

all name in linked table are valid, am I miss a collumn?

hey @sbruddni,
Can you share more details as to which stage the error is occurring?
during a file upload or after you upload and begin the import?

Hi bro, thanks for responding. I figured out the cause already, some required linked data collum accidentally deleted.

1 Like

Awesome then…

BTW please do take the time to report back your solution in the future. so that it is useful to others with the same error. it will also help in closing the thread. thanks.

Item…Data (text) must be string (e.g. 9556570312131 —> “9556570312131”) and Description also be string too.

Let you try it.