Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] newrelic: wrap target server initialization #16

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

Shamsidinkhon
Copy link

@Shamsidinkhon Shamsidinkhon commented Jun 12, 2023

It breaks while exporting odoo translations. odoo-community/odoo-bin -c odoo.conf -d {database_name} --workers=0 --no-http --stop-after-init --i18n-export={export_path} --modules={module_name} -l nl_NL. This PR skips target server initialization if stop-after-init argument is provided

Traceback:

Traceback (most recent call last):
  File "/newrelic/__init__.py", line 19, in <module>
    instrumented = target._nr_instrumented
AttributeError: 'NoneType' object has no attribute '_nr_instrumented'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
    odoo.modules.registry.Registry.new(database, update_module=True)
  File "/odoo-community/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/odoo-community/odoo/modules/loading.py", line 455, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/odoo-community/odoo/modules/loading.py", line 347, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/odoo-community/odoo/modules/loading.py", line 179, in load_module_graph
    load_openerp_module(package.name)
  File "/odoo-community/odoo/modules/module.py", line 385, in load_openerp_module
    __import__('odoo.addons.' + module_name)
  File "/newrelic/__init__.py", line 21, in <module>
    instrumented = target._nr_instrumented = False
AttributeError: 'NoneType' object has no attribute '_nr_instrumented'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant