frappe_docker: Migration fails due to theme

Traceback (most recent call last):
  File "/usr/local/bin/patched_bench_helper.py", line 46, in <module>
    raise SystemExit(main())
  File "/usr/local/bin/patched_bench_helper.py", line 41, in main
    frappe.utils.bench_helper.main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 27, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 309, in migrate
    migrate(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 91, in migrate
    frappe.get_attr(fn)()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 187, in after_migrate
    doc.generate_bootstrap_theme()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 80, in generate_bootstrap_theme
    frappe.throw('<div style="font-family: monospace;">{stderr}</div>'.format(stderr=stderr))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 444, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 423, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 378, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: <div style="font-family: monospace;">internal/modules/cjs/loader.js:905<br>  throw err;<br>  ^<br><br>Error: Cannot find module 'node-sass'<br>Require stack:<br>- /home/frappe/frappe-bench/apps/frappe/generate_bootstrap_theme.js<br>    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)<br>    at Function.Module._load (internal/modules/cjs/loader.js:746:27)<br>    at Module.require (internal/modules/cjs/loader.js:974:19)<br>    at require (internal/modules/cjs/helpers.js:101:18)<br>    at Object.<anonymous> (/home/frappe/frappe-bench/apps/frappe/generate_bootstrap_theme.js:1:14)<br>    at Module._compile (internal/modules/cjs/loader.js:1085:14)<br>    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)<br>    at Module.load (internal/modules/cjs/loader.js:950:32)<br>    at Function.Module._load (internal/modules/cjs/loader.js:790:12)<br>    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {<br>  code: 'MODULE_NOT_FOUND',<br>  requireStack: [<br>    '/home/frappe/frappe-bench/apps/frappe/generate_bootstrap_theme.js'<br>  ]<br>}<br></div>

This only happens for site which has Website Theme applied.

@vrslev I think we need to make node-sass available in erpnext-python somehow.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 24

Most upvoted comments

Should we and how can we do that?

I’ll try out few things. I’ll play around with mounting volume to try to minimize duplication.