Migrate from V7 to V8

Any update on this?

@makarand_b, have you had time to look at the new error yet? Is it on my end or need a code fix?

@rohit_w
Hi guys, I’m still stuck on the upgrade path with the above error. Any update if it can be fixed on my end or needs a code fix.

@iadr3805

Are you made personal changes in a Doctype
and put a ‘qty’ column in to it, did not you?

“Unknown column ‘qty’ in ‘field list’”

Hope this helps.

You need to reload doc forcefully
https://github.com/frappe/erpnext/blob/develop/erpnext/patches/v8_0/update_stock_qty_value_in_bom_item.py#L8-L10

Also check

1 Like

I can’t figure out how to reload doc.
I followed the second link you provided and modified the file but then I get an error which is explained here, and these solution stashed the changes and same error appears.

The changes to the file need to take place after you run bench update and the files get downloaded from github, but before the patch runs. I’ve done this a few times where I have the modified file all ready to go, then after the first part of bench update runs (where the files all download from git), I override the patch with the one that is modified.

It takes a bit of timing, but is normally not too hard to do.

If I understand you correctly. run bench update, then upload the file with the changes during the update process? I’ve done this a few times and but no luck. Still getting the same error as above

mysqlexceptions.OperationalError: (1054, “Unknown column ‘qty’ in ‘field list’”)

this is the file I’m modifying

File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_bom_item.py”, line 13, in execute
frappe.db.sql(“update tabBOM Scrap Item set stock_qty = qty”)

Go to the console using bench --site <your-site-name> console and run following in console:

frappe.reload_doc('manufacturing', 'doctype', 'bom_item', force=True)
frappe.reload_doc('manufacturing', 'doctype', 'bom_explosion_item', force=True)
frappe.reload_doc('manufacturing', 'doctype', 'bom_scrap_item', force=True)
frappe.db.commit()

Exit from the console and run bench update again.

The commands run successfully

In [1]: frappe.reload_doc(‘manufacturing’, ‘doctype’, ‘bom_item’, force=True)
Out[1]: True

In [2]: frappe.reload_doc(‘manufacturing’, ‘doctype’, ‘bom_explosion_item’, force=True)
…:
Out[2]: True

In [3]: frappe.reload_doc(‘manufacturing’, ‘doctype’, ‘bom_scrap_item’, force=True)
Out[3]: True

In [4]: frappe.db.commit()

But same error still there

Backing up sites…
Patching sites…
Migrating site1.local
Executing finally:erpnext.patches.v7_0.update_timesheet_communications in site1.local (1bd3e0294da19198)
Success
Executing erpnext.patches.v8_0.update_stock_qty_value_in_bom_item in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 91, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 17, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 216, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_stock_qty_value_in_bom_item.py”, line 13, in execute
frappe.db.sql(“update tabBOM Scrap Item set stock_qty = qty”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 165, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 250, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
raise errorvalue
_mysql_exceptions.OperationalError: (1054, “Unknown column ‘qty’ in ‘field list’”)

Ok, I understood the issue, will push a fix soon. The problem is, in your case, “BOM Scrap Item” table is introducing for the first time and thats why there is no existing qty field.

Sent a PR to fix this, will be released soon.

https://github.com/frappe/erpnext/pull/10202

Hi Mak,

Has this been pushed to master yet?

I am migrating from ver 7 to 8 for a client, and I am getting this same problem: frappe.exceptions.DoesNotExistError: DocType Domain not found.

Running bench update is not helping and this instance is on master both on frappe and erpnext.

Thanks

Jay

Hi Jay,

I just a had look and it hasn’t been yet

This is a different problem. Can you please share the full error trace?

Here it is Nabin:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    Updating node libraries…
    INFO:bench.utils:npm install
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
    npm WARN frappe@ No description
    Backing up sites…
    Patching sites…
    Migrating site1.local
    Executing erpnext.patches.v7_1.update_portal_roles in site1.local (1bd3e0294da19198)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
    main”, fname, loader, pkg_name)
    File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
    exec code in run_globals
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 91, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 17, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 216, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v7_1/update_portal_roles.py”, line 10, in execute
    frappe.get_doc(dict(doctype=‘Role’, role_name=role_name, desk_access=0)).insert()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 182, in insert
    self.set_defaults()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 493, in set_defaults
    new_doc = frappe.new_doc(self.doctype, as_dict=True)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 597, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 19, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 40, in make_new_doc
    set_user_and_static_default_values(doc)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 55, in set_user_and_static_default_values
    user_default_value = get_user_default_value(df, defaults, user_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 70, in get_user_default_value
    if (frappe.get_meta(df.options).document_type==“Setup”
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 638, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in get_meta
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
    value = generator()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 69, in init
    super(Meta, self).init(“DocType”, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 84, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 74, in load_from_db
    super(Meta, self).load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 115, in load_from_db
    frappe.throw(
    (“{0} {1} not found”).format(
    (self.doctype), self.name), frappe.DoesNotExistError)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
    raise raise_exception(encode(msg))
    frappe.exceptions.DoesNotExistError: DocType Domain not found

@nabinhait: Did you manage to review the trace? Any suggestions?

Thanks

Jay

Pushed a fix in hotfix branch which will be merge to master by the end of today.

https://github.com/frappe/erpnext/commit/738d8c2e0f5328c8bfd49ee3076122978f816969

Went through like a charm. Thanks much!

Jay

1 Like

Hi @nabinhait,
I am updating from 7.x to 9.x and after bench update I had slightly different error. Here is the full trace:

root@localhost:/home/frappe/frappe-bench# bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see Advanced Usage - urllib3 2.0.0a2 documentation.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Updating node libraries…
    INFO:bench.utils:npm install
    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.2
    npm WARN frappe@ No description
    Backing up sites…
    Patching sites…
    Migrating anstrea.com
    Executing execute:frappe.get_single(‘Domain Settings’).save() in anstrea.com (d029f9ff8b80815f)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
    main”, fname, loader, pkg_name)
    File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
    exec code in run_globals
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
    exec(patchmodule.split(“execute:”)[1],globals())
    File “”, line 1, in
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 646, in get_single
    return get_doc(doctype, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 634, in get_doc
    return frappe.model.document.get_doc(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 68, in get_doc
    return controller(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 126, in load_from_db
    if not getattr(self, "metaclass", False) and self.meta.issingle:
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 62, in meta
    self.meta = frappe.get_meta(self.doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 651, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in get_meta
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
    value = generator()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 72, in init
    super(Meta, self).init(“DocType”, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 77, in load_from_db
    super(Meta, self).load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 140, in load_from_db
    frappe.throw(
    (“{0} {1} not found”).format(
    (self.doctype), self.name), frappe.DoesNotExistError)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
    raise raise_exception(encode(msg))
    frappe.exceptions.DoesNotExistError: DocType Domain Settings not found
    root@localhost:/home/frappe/frappe-bench# bench update
    INFO:bench.utils:updating bench
    INFO:bench.utils:git pull
    Already up-to-date.
    INFO:bench.utils:./env/bin/pip install Pillow
    Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
    INFO:bench.app:pulling frappe
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see Advanced Usage - urllib3 2.0.0a2 documentation.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Updating node libraries…
    INFO:bench.utils:npm install
    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.2
    npm WARN frappe@ No description
    Backing up sites…
    Patching sites…
    Migrating anstrea.com
    Executing execute:frappe.get_single(‘Domain Settings’).save() in anstrea.com (d029f9ff8b80815f)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
    main”, fname, loader, pkg_name)
    File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
    exec code in run_globals
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
    exec(patchmodule.split(“execute:”)[1],globals())
    File “”, line 1, in
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 646, in get_single
    return get_doc(doctype, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 634, in get_doc
    return frappe.model.document.get_doc(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 68, in get_doc
    return controller(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 126, in load_from_db
    if not getattr(self, "metaclass", False) and self.meta.issingle:
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 62, in meta
    self.meta = frappe.get_meta(self.doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 651, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in get_meta
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
    value = generator()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 33, in
    lambda: Meta(doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 72, in init
    super(Meta, self).init(“DocType”, doctype)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 103, in init
    self.load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/meta.py”, line 77, in load_from_db
    super(Meta, self).load_from_db()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 140, in load_from_db
    frappe.throw(
    (“{0} {1} not found”).format(
    (self.doctype), self.name), frappe.DoesNotExistError)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
    raise raise_exception(encode(msg))
    frappe.exceptions.DoesNotExistError: DocType Domain Settings not found

Any idea?

Thanks