On my local instance of the app engine application I am developing I am experiencing an infinite recursion of the logging system. Unfortunately, since the problem lies in the logging system, I cannot see the error message. The python 'print' command is also not working on a google app engine application, therefore I cannot display any useful information.
The problem is visible even just accessing the website root.
It seems to be an import problem, but beside that, the logging system should work, and it doesn't.
The deployed version of the site is working, which leads me to think about a possible local configuration/system problem.
I am using python 2.7.2 and CURRENT_VERSION_ID=1.1
Here is the very long stacktrace of the bug:
--> --> -->
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2781, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2669, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 692, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1731, in Dispatch
self._module_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1631, in ExecuteCGI
reset_modules = exec_script(config, handler_path, cgi_path, hook)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1319, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "C:\Program Files\Google\google_appengine\google\appengine\ext\admin\__init__.py", line 79, in <module>
from google.appengine.ext.webapp import _template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_template.py", line 37, in <module>
from google.appengine.ext.webapp import template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\template.py", line 61, in <module>
webapp._config_handle.django_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 153, in _django_setup
__django_version_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 99, in __django_version_setup
'http://code.google.com/appengine/docs/python/tools/'
File "C:\Python27\lib\logging\__init__.py", line 1582, in warning
root.warning(msg, *args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1144, in warning
self._log(WARNING, msg, args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1249, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
File "C:\Python27\lib\logging\__init__.py", line 1223, in makeRecord
rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
File "C:\Python27\lib\logging\__init__.py", line 266, in __init__
self.levelname = getLevelName(level)
File "C:\Python27\lib\logging\__init__.py", line 167, in getLevelName
return _levelNames.get(level, ("Level %s" % level))
RuntimeError: maximum recursion depth exceeded while getting the str of an object
Here is the list of imports of main.py:
from google.appengine.ext import webapp
import fix_path
import sys
import os
import urllib
import urllib2
import pprint
import logging
import cgi
import random
import Cookie
import datetime
import time
import urlparse
import urllib2
import urllib, cStringIO
import hashlib
import copy
from urllib import urlretrieve
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.dist import use_library
from google.appengine.api import memcache
from django.utils import simplejson
from gaesessions import get_current_session
from myapp.models import *
from myapp.models import sequence_selection as models_sequence_selection
from myapp.sequence_selection import utils as sequence_selection_utils
from myapp.models import video
from myapp.models.video import *
from myapp.models.song import *
from myapp.models.flashified import *
from myapp.music_recommendation import get_song_recommendations,get_song_recommendations_learning_data,learn_song,learn_song_from_video
from myapp.core import is_number
from myapp import mailing
from myapp import search
from myapp import motif
from myapp import retrieve_instagram
from myapp import coords_distance
from myapp import performancetest
from google.appengine.api import mail
from google.appengine.api import images
Actually, renaming the directory of the application and re-importing trough google app engine launcher with a different port solved my problem, but probably not the bug.
You need to upload the relevant source to get a real answer as #skreft stated.
Although as far as logging, use import logging and then logging.info() to help locate the problem.
I suggest commenting the logging code for now and see what your stack trace reveals. Then if you are not getting an error start adding the logging code back in piece by piece until you find your error.
Related
I'm trying to get a client_order_ref from a sale order, from the account.invoice module. I don't know why it says that the field doesn't exits, and the field it's defined. Please help me
Python code
from odoo import models, fields, api, _
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
client_order_ref = fields.Char(string="Client Order Ref", compute="get_client_from_sale_order")
#api.depends('name')
def get_client_from_sale_order(self):
self.ensure_one()
for rec in self:
sale_order = self.env['sale.order'].search(
[('name', '=', rec.origin)]
)
rec.client_order_ref = sale_order.client_order_ref
XML code
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="invoice_tree" model="ir.ui.view">
<field name="name">account_invoice_tree_inherit</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='partner_id']" position="after">
<field name="client_order_ref"/>
</xpath>
</field>
</record>
</odoo>
TRACEBACK
Error: Odoo Server Error
Traceback (most recent call last): File
"/opt/odoo/custom/src/odoo/odoo/models.py", line 1128, in
_validate_fields
check(self) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 351, in _check_xml
self.postprocess_and_fields(view.model, view_doc, view.id) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 1138, in postprocess_and_fields
self.raise_view_error(message, view_id) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 568, in raise_view_error
raise ValueError(message) ValueError: Field client_order_ref does not exist
Error context: View account_invoice_tree_inherit [view_id: 1311,
xml_id: cloudpiles_custom.invoice_tree, model: account.invoice,
parent_id: 681]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 758, in parse
self._tags[rec.tag](rec, de, mode=mode) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 663, in
_tag_record
record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File
"/opt/odoo/custom/src/odoo/odoo/models.py", line 3883, in
_load_records
data['record']._load_records_write(data['values']) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 1542, in _load_records_write
super(View, self)._load_records_write(values) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3821, in
_load_records_write
self.write(values) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 445, in write
res = super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3392, in write
fields[0].determine_inverse(records) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1200, in
determine_inverse
getattr(records, self.inverse)() File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 275, in _inverse_arch
view.write(data) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 445, in write
res = super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3366, in write
self._write(store_vals) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3502, in _write
self._validate_fields(vals) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 1132, in
validate_fields
raise ValidationError("%s\n\n%s" % (("Error while validating constraint"), tools.ustr(e))) odoo.exceptions.ValidationError: ('Error
while validating constraint\n\nField client_order_ref does not
exist\n\nError context:\nView
account_invoice_tree_inherit\n[view_id: 1311, xml_id:
cloudpiles_custom.invoice_tree, model: account.invoice, parent_id:
681]', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/opt/odoo/custom/src/odoo/odoo/http.py", line 656, in
_handle_exception
return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 314, in
_handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File
"/opt/odoo/custom/src/odoo/odoo/tools/pycompat.py", line 87, in
reraise
raise value File "/opt/odoo/custom/src/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 941, in call
return self.method(*args, **kw) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw) File "/opt/odoo/auto/addons/web/controllers/main.py", line 967, in
call_button
action = self._call_kw(model, method, args, {}) File "/opt/odoo/auto/addons/web/controllers/main.py", line 955, in _call_kw
return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo/custom/src/odoo/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs) File "/opt/odoo/custom/src/odoo/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs) File "", line 2, in button_immediate_upgrade File
"/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py", line
75, in check_and_log
return method(self, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py", line
628, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py",
line 562, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 86, in
new
odoo.modules.load_modules(registry._db, force_demo, status, update_module) File
"/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 417, in
load_modules
force, status, report, loaded_modules, update_module, models_to_check) File
"/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 313, in
load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 222, in
load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report) File
"/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 68, in
load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File
"/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 802, in
convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 865, in
convert_xml_import
obj.parse(doc.getroot(), mode=mode) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 764, in parse
exc_info[2] File "/opt/odoo/custom/src/odoo/odoo/tools/pycompat.py", line 86, in
reraise
raise value.with_traceback(tb) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 758, in parse
self._tags[rec.tag](rec, de, mode=mode) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 663, in
_tag_record
record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File
"/opt/odoo/custom/src/odoo/odoo/models.py", line 3883, in
_load_records
data['record']._load_records_write(data['values']) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 1542, in _load_records_write
super(View, self)._load_records_write(values) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3821, in
_load_records_write
self.write(values) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 445, in write
res = super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3392, in write
fields[0].determine_inverse(records) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1200, in
determine_inverse
getattr(records, self.inverse)() File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 275, in _inverse_arch
view.write(data) File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_ui_view.py",
line 445, in write
res = super(View, self).write(self._compute_defaults(vals)) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3366, in write
self._write(store_vals) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3502, in _write
self._validate_fields(vals) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 1132, in
validate_fields
raise ValidationError("%s\n\n%s" % (("Error while validating constraint"), tools.ustr(e))) odoo.tools.convert.ParseError: "Error
while validating constraint
Field client_order_ref does not exist
Error context: View account_invoice_tree_inherit [view_id: 1311,
xml_id: cloudpiles_custom.invoice_tree, model: account.invoice,
parent_id: 681] None" while parsing
/opt/odoo/auto/addons/cloudpiles_custom/views/account_invoice_view.xml:3,
near
account_invoice_tree_inherit
account.invoice
I guess, you forgot an important point about inheritance from odoo's models...
when you added a new field on existing model in odoo's modules ,first of all you have to upgrading your module with command, not with odoo interface...
just run this command: ./odoo-bin -c /etc/odoo-server.conf -d data_base_name -u module_name
I hope this will help you.
Im running Nginx + Gunicorn + FastAPI application. I have rather simple ML application in my file main.py.
I used this manual to set (Russian translate):
[Развертывайте приложение Fastapi на Ubuntu с Nginx, Gunicorn и UVicorn][1]
When I'm trying to check
gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app
I see this error
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 211, in run
self.manage_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 551, in manage_workers
self.spawn_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 623, in spawn_workers
time.sleep(0.1 * random.random())
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
self.reap_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
self.log.warning(
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/glogging.py", line 261, in warning
self.error_log.warning(msg, *args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
self.emit(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1093, in emit
self.handleError(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1007, in handleError
traceback.print_exception(t, v, tb, None, sys.stderr)
File "/usr/lib/python3.8/traceback.py", line 105, in print_exception
print(line, file=file, end="")
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
self.reap_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
self.log.warning(
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/glogging.py", line 261, in warning
self.error_log.warning(msg, *args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
self.emit(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1093, in emit
self.handleError(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1006, in handleError
sys.stderr.write('--- Logging error ---\n')
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
[2022-02-21 21:02:44 +0300] [650] [WARNING] Worker with pid 656 was terminated due to signal 4 ```
I have file main.py and app in it. Any ideas how to handle this error?
[1]: https://pythobyte.com/deploy-fastapi-application-on-ubuntu-with-nginx-gunicorn-and-uvicorn-3mbl-f789b2df/
I'm trying to learn how to use mongo and got this error. The password is meant to start with an exclamation mark, but I change the actual password. Here's the code and error:
import pymongo
from pymongo import MongoClient
import dns.resolver
dns.resolver.default_resolver=dns.resolver.Resolver(configure=False)
dns.resolver.default_resolver.nameservers=['8.8.8.8']
cluster = pymongo.MongoClient("mongodb+srv://gabriel:%33%password#cluster1.ez4er.mongodb.net/myFirstDatabase?retryWrites=true&w=majority")
db = cluster["gabdatabase"]
collection = db["learningmongo"]
print(cluster.list_database_names())
Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 15, in <module>
collection.insert_one(post)
File "/usr/local/lib/python3.9/site-packages/pymongo/collection.py", line 705, in insert_one
self._insert(document,
File "/usr/local/lib/python3.9/site-packages/pymongo/collection.py", line 620, in _insert
return self._insert_one(
File "/usr/local/lib/python3.9/site-packages/pymongo/collection.py", line 609, in _insert_one
self.__database.client._retryable_write(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1552, in _retryable_write
return self._retry_with_session(retryable, func, s, None)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1438, in _retry_with_session
return self._retry_internal(retryable, func, session, bulk)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1462, in _retry_internal
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 333, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
File "/usr/local/lib/python3.9/site-packages/pymongo/network.py", line 158, in command
helpers._check_command_response(
File "/usr/local/lib/python3.9/site-packages/pymongo/helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop % /usr/local/bin/python /Users/Gu/Desktop/python/py2.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1394, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Gu/Desktop/python/py2.py", line 13, in <module>
print(cluster.list_database_names())
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2037, in list_database_names
for doc in self.list_databases(session, nameOnly=True)]
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 2018, in list_databases
res = admin._retryable_read_command(cmd, session=session)
File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 770, in _retryable_read_command
return self.__client._retryable_read(
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1518, in _retryable_read
with self._secondaryok_for_server(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1371, in _secondaryok_for_server
with self._get_socket(server, session) as sock_info:
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1308, in _get_socket
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1331, in get_socket
sock_info = self._get_socket(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1397, in _get_socket
sock_info = self.connect(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 1297, in connect
sock_info.check_auth(all_credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 820, in check_auth
self.authenticate(credentials)
File "/usr/local/lib/python3.9/site-packages/pymongo/pool.py", line 837, in authenticate
auth.authenticate(credentials, self)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 672, in authenticate
auth_func(credentials, sock_info)
File "/usr/local/lib/python3.9/site-packages/pymongo/auth.py", line 590, in _authenticate_default
return
with server.get_socket(
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
Gu#21emashmore21-971 Desktop %
I was trying to upgrade a module from Odoo 13 to Odoo 14 (stock_split_picking to be exact), I found an error that I don't really understand and I can't figure how to fix it.
It's an error that happen when I want to install the module, and after hours of search on the internet, hours of just reading Odoo's code in a hope of understanding what's happening... I just can't understand where is the problem, nothing seems to be anormal from what I've read on Odoo's Documentation on their website.
Here is my error :
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/opt/odoo/odoo/odoo/tools/convert.py", line 580, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo/odoo/odoo/models.py", line 4185, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo/odoo/odoo/models.py", line 4114, in _load_records_create
return self.create(values)
File "<decorator-gen-43>", line 2, in create
File "/opt/odoo/odoo/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 482, in create
return super(View, self).create(vals_list)
File "<decorator-gen-65>", line 2, in create
File "/opt/odoo/odoo/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_fields.py", line 508, in create
recs = super().create(vals_list)
File "<decorator-gen-13>", line 2, in create
File "/opt/odoo/odoo/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo/odoo/models.py", line 3875, in create
fields[0].determine_inverse(batch_recs)
File "/opt/odoo/odoo/odoo/fields.py", line 1128, in determine_inverse
getattr(records, self.inverse)()
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 300, in _inverse_arch
view.write(data)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 500, in write
res = super(View, self).write(self._compute_defaults(vals))
File "/opt/odoo/odoo/odoo/models.py", line 3664, in write
real_recs._validate_fields(set(vals) - set(inverse_fields))
File "/opt/odoo/odoo/odoo/models.py", line 1249, in _validate_fields
check(self)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 385, in _check_xml
view_def = view.read_combined(['arch'])
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 813, in read_combined
arch = root.apply_view_inheritance(arch_tree, self.model)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 755, in apply_view_inheritance
return self._apply_view_inheritance(source, inherit_tree)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 764, in _apply_view_inheritance
source = view._apply_view_inheritance(source, inherit_tree)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 760, in _apply_view_inheritance
arch_tree = etree.fromstring(view.arch.encode('utf-8'))
File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:79003)
File "src/lxml/parser.pxi", line 1848, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118334)
File "src/lxml/parser.pxi", line 1736, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:117014)
File "src/lxml/parser.pxi", line 1102, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:111258)
File "src/lxml/parser.pxi", line 595, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:105102)
File "src/lxml/parser.pxi", line 706, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:106810)
File "src/lxml/parser.pxi", line 646, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:105956)
File "<string>", line 0
lxml.etree.XMLSyntaxError: <no detail available>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 912, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1367, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1355, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/addons/gfi_base/models/ir_module_module.py", line 35, in button_immediate_install
return super(IrModuleModule, self).button_immediate_install()
File "<decorator-gen-72>", line 2, in button_immediate_install
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 474, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 592, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo/odoo/odoo/modules/loading.py", line 221, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/opt/odoo/odoo/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/opt/odoo/odoo/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/odoo/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/opt/odoo/odoo/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/opt/odoo/odoo/odoo/tools/convert.py", line 685, in _tag_root
)) from e
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /opt/odoo/odoo/addons/stock/views/res_partner_views.xml:8, near
<record id="view_partner_stock_form" model="ir.ui.view">
<field name="name">res.partner.stock.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="mail.res_partner_view_form_inherit_mail"/>
<field name="arch" type="xml">
<xpath expr="//page[#name='sales_purchases']/group" position="inside">
<group name="container_row_stock" groups="base.group_no_one" priority="6">
<group string="Inventory" name="inventory" colspan="2">
<field name="property_stock_customer"/>
<field name="property_stock_supplier"/>
</group>
</group>
</xpath>
</field>
</record>
My first thought was that the xpath was bad, but the error is not the same as an xpath error.
I already tried to delete this record for the installation, and then rewrite the record after having installing the module, and magic : the module can be upgraded without any error. Problem is that when we want to use the module, the error come again and make it impossible to use the module.
I randomly get the following errors (i.e most of the times the scripts work fine)
File ".../backend/case_status_consumer.py", line 28, in <module>
channel.start_consuming()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 955, in start_consuming
self.connection.process_data_events()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 240, in process_data_events
if self._handle_read():
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 348, in _handle_read
super(BlockingConnection, self)._handle_read()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 351, in _handle_read
self._on_data_available(data)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1285, in _on_data_available
self._process_frame(frame_value)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1365, in _process_frame
self._deliver_frame_to_channel(frame_value)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 976, in _deliver_frame_to_channel
return self._channels[value.channel_number]._handle_content_frame(value)
File "/usr/local/lib/python2.7/dist-packages/pika/channel.py", line 792, in _handle_content_frame
self._on_deliver(*response)
File "/usr/local/lib/python2.7/dist-packages/pika/channel.py", line 886, in _on_deliver
body)
File ".../backend/case_status_consumer.py", line 14, in consume_case_status
case_num['case_year'])
File ".../backend/src/fetcher/case_update.py", line 132, in case_update
properties=pika.BasicProperties(delivery_mode=2))
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 572, in basic_publish
(properties, body), False)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1159, in _send_method
self.connection.send_method(self.channel_number, method_frame, content)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 274, in send_method
self._send_method(channel_number, method_frame, content)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1503, in _send_method
self._send_frame(frame.Method(channel_number, method_frame))
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 417, in _send_frame
super(BlockingConnection, self)._send_frame(frame_value)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1490, in _send_frame
self._flush_outbound()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 377, in _flush_outbound
if self._handle_write():
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 365, in _handle_write
return self._handle_error(error)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 302, in _handle_error
self._handle_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 248, in _handle_disconnect
self._adapter_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 318, in _adapter_disconnect
self._check_state_on_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 371, in _check_state_on_disconnect
raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed
And I get a similar error while producing too.
File ".../backend/check_for_orders.py", line 115, in <module>
dated=order_dated, ors_fetch=False)
File ".../backend/src/fetcher/case_update.py", line 132, in case_update
properties=pika.BasicProperties(delivery_mode=2))
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 572, in basic_publish
(properties, body), False)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1159, in _send_method
self.connection.send_method(self.channel_number, method_frame, content)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 274, in send_method
self._send_method(channel_number, method_frame, content)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1503, in _send_method
self._send_frame(frame.Method(channel_number, method_frame))
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 417, in _send_frame
super(BlockingConnection, self)._send_frame(frame_value)
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1490, in _send_frame
self._flush_outbound()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 377, in _flush_outbound
if self._handle_write():
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 365, in _handle_write
return self._handle_error(error)
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 302, in _handle_error
self._handle_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 248, in _handle_disconnect
self._adapter_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 318, in _adapter_disconnect
self._check_state_on_disconnect()
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 371, in _check_state_on_disconnect
raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed
My connection is set to:
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', heartbeat_interval=0))
I have even tried setting the heartbeat interval to a longer time (like 60 and 90), but I still get these errors.
I cannot post the full code but what my scripts are doing is, using 'requests' to fetch a page (with timeout as 50 seconds and maximum 4 retries)
This issue is fixed in pika 0.10.0