Skip to Content
Menu
This question has been flagged
1 Reply
2577 Views

QWeb

Error message:

Error while render the template
Exception: Unallowed to fetch files from addon website_payment for file website_payment/static/src/snippets/s_donation/000.js
Template: website.layout
Path: /t/html/head/t[10]
Node: 

The error occurred while rendering the template website.layout and evaluating the following expression: 

Traceback

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 99, in lookup
    r = d[key]
  File "", line 2, in __getitem__
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
KeyError: ('ir.qweb', , 'web.assets_frontend', True, False, (('website_id', 1),), False)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 99, in lookup
    r = d[key]
  File "", line 2, in __getitem__
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 34, in __getitem__
    a = self.d[obj]
KeyError: ('ir.asset', , 'web.assets_frontend', (('website_id', 1),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1587, in template_2186
  File "", line 1199, in template_2186_content
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2506, in _load_values
    return get_value()
  File "", line 1189, in template_2186_t_cache_0_cache
  File "", line 572, in template_2186_t_cache_0
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2463, in _get_asset_nodes
    links = self._get_asset_links(bundle, css=css, js=js, debug=debug)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2478, in _get_asset_links
    return self._generate_asset_links_cache(bundle, css=css, js=js, assets_params=assets_params, rtl=rtl)
  File "", line 2, in _generate_asset_links_cache
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 104, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2532, in _generate_asset_links_cache
    return self._generate_asset_links(bundle, css, js, False, assets_params, rtl)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2608, in _generate_asset_links
    asset_bundle = self._get_asset_bundle(bundle, css=css, js=js, debug_assets=debug_assets, rtl=rtl, assets_params=assets_params)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2555, in _get_asset_bundle
    files, external_assets = self._get_asset_content(bundle_name, assets_params)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2537, in _get_asset_content
    asset_paths = self.env['ir.asset']._get_asset_paths(bundle=bundle, assets_params=assets_params)
  File "", line 2, in _get_asset_paths
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 104, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_asset.py", line 155, in _get_asset_paths
    self._fill_asset_paths(bundle, asset_paths, [], addons, installed, **assets_params)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_asset.py", line 192, in _fill_asset_paths
    self._process_path(bundle, asset.directive, asset.target, asset.path, asset_paths, seen, addons, installed, bundle_start_index, **assets_params)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_asset.py", line 212, in _process_path
    paths = self._get_paths(path_def, installed)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_asset.py", line 346, in _get_paths
    raise Exception(f"Unallowed to fetch files from addon {addon} for file {path_def}")
Exception: Unallowed to fetch files from addon website_payment for file website_payment/static/src/snippets/s_donation/000.js

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1765, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1792, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1909, in dispatch
    return self.request.registry['ir.http']._dispatch(endpoint)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 224, in _dispatch
    result.flatten()
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1291, in flatten
    self.response.append(self.render())
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1283, in render
    return request.env["ir.ui.view"]._render_template(self.template, self.qcontext)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 442, in _render_template
    return super()._render_template(template, values=values)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 2050, in _render_template
    return self.env['ir.qweb']._render(template, values)
  File "/usr/lib/python3/dist-packages/odoo/tools/profiler.py", line 292, in _tracked_method_render
    return method_render(self, template, values, **options)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 593, in _render
    result = ''.join(rendering)
  File "", line 243, in template_185
  File "", line 232, in template_185_content
  File "", line 51, in template_184
  File "", line 40, in template_184_content
  File "", line 1593, in template_2186
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
Exception: Unallowed to fetch files from addon website_payment for file website_payment/static/src/snippets/s_donation/000.js
Template: website.layout
Path: /t/html/head/t[10]
Node: 

Avatar
Discard
Best Answer

few steps to reproduce and symptoms
This is usually reproduced if the user cancel/skip the website wizard after enabling the website module. 
This causes a critical deadlock as web is not rendered and user is unable to login to even backend and then nothing can be done.


work around is paste some backend address like this https://nsdnjs:8069/web#action=124&cids=1&menu_id=81

then upgrade or uninstall the website module. this will trigger the website wizard and there is chance to get back online.

UPDATE:: Found solution
add this line to config file and the error goes out magically

server_wide_modules = base,web,website_payment 




Below is AI explaining the change.

I'm glad to hear you found a solution! Adding website_payment to the server_wide_modules parameter in the Odoo configuration is indeed an effective way to resolve this type of issue. Let's break down why this worked and what it means:

  1. Server-Wide Modules: The server_wide_modules parameter in Odoo's configuration specifies which modules should be loaded for all databases, even before a specific database is selected or created.
  2. Impact: By adding website_payment to this list, you're ensuring that the module and its assets are always available, regardless of whether it's explicitly installed in a particular database.
  3. Asset Availability: This solves the "Unallowed to fetch files" error because the assets from website_payment are now globally accessible to the Odoo server.
  4. Performance Consideration: While this solves the immediate issue, be aware that loading modules server-wide can have a small impact on server startup time and memory usage, especially if you add many modules to this list.
  5. Security Implication: Ensure that adding website_payment as a server-wide module doesn't unintentionally expose payment-related functionalities in databases where it shouldn't be available.
  6. Root Cause: The need for this solution suggests that somewhere in your custom code or configurations, there's a dependency on website_payment that wasn't being properly resolved. In the future, you might want to investigate why this dependency exists and if it can be managed more explicitly within your custom module.
  7. Documentation: Make sure to document this change in your project documentation, as it's a crucial configuration detail that affects how your Odoo instance operates.
  8. Testing: After making this change, thoroughly test all functionalities related to your custom module and any payment or website features to ensure everything works as expected.

Moving forward:

  1. Monitor your Odoo instance for any new issues that might arise from this change.
  2. Consider reviewing your custom module to see if you can identify and possibly remove the implicit dependency on website_payment, if it's not strictly necessary.
  3. If you develop new modules in the future, be mindful of dependencies and how they're declared to avoid similar issues.


 

Avatar
Discard
Related Posts Replies Views Activity
2
Feb 25
931
0
Aug 22
1809
2
May 18
5542
1
Feb 25
385
0
Dec 24
496