TypeError on Bench Update

Hi all

When I try to do bench update I get the error message below. The error occurs during the bench migrate step. When I do bench migrate before the update, it works fine.

I’m on ERPNext v13.7.1 and have two custom apps installed.

Anyone an idea how to resolve this?


Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 27, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py", line 309, in migrate
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 75, in migrate
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 24, in sync_fixtures
    import_doc(frappe.get_app_path(app, "fixtures", fname))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 191, in import_doc
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 112, in import_file_by_path
    get_datetime(doc.get("modified")) <= get_datetime(db_modified_timestamp)
TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.datetime'

No one an idea how to solve the problem?

@unknownTH just follow the error to the doc that has a field called “modified” , find out why this field has no value and the solution will be clear

@bahaou thanks for your help. I could resolve the issue. The problem occurred because I had empty “modified” fields in my custom field fixtures.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.