GithubHelp home page GithubHelp logo

Comments (11)

flotho avatar flotho commented on July 17, 2024 1

I used an external lib in Java that we are supporting https://github.com/DeBortoliWines/openerp-java-api and try to connect to a db with wishlist module

from e-commerce.

RoelAdriaans avatar RoelAdriaans commented on July 17, 2024 1

Same issue with the default python xml-rpc api:

import xmlrpclib

# Database and openerp settings:
username = "admin"
pwd = "admin"
dbname = "test"
oeserver = "http://odoo-server"

print "connecting to odoo"
sock_common = xmlrpclib.ServerProxy(oeserver +"/xmlrpc/common")
print "Do a login"
uid = sock_common.login(dbname, username, pwd)
print "uid found", uid
sock = xmlrpclib.ServerProxy(oeserver + "/xmlrpc/object")

And the traceback from this script:

connecting to odoo
Do a login
Traceback (most recent call last):
  File "connect.py", line 13, in <module>
    uid = sock_common.login(dbname, username, pwd)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault object unbound: 'Traceback (most recent call last):
  File "/opt/odoo/test/odoo/odoo/service/wsgi_server.py", line 56, in xmlrpc_return
    result = odoo.http.dispatch_rpc(service, method, params)
  File "/opt/odoo/test/odoo/odoo/http.py", line 118, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/odoo/test/odoo/odoo/service/common.py", line 57, in dispatch
    return g[exp_method_name](*params)
  File "/opt/odoo/test/odoo/odoo/service/common.py", line 23, in exp_login
    res = security.login(db, login, password)
  File "/opt/odoo/test/odoo/odoo/service/security.py", line 9, in login
    return res_users._login(db, login, password)
  File "/opt/odoo/test/odoo/odoo/addons/base/res/res_users.py", line 455, in _login
    user.sudo(user_id).check_credentials(password)
  File "/opt/odoo/test/website_sale_wishlist/models/res_users.py", line 27, in check_credentials
    self.env["product.wishlist"]._join_current_user_and_session()
  File "/opt/odoo/test/website_sale_wishlist/models/product_wishlist.py", line 71, in _join_current_user_and_session
    ("session", "=", request.session.sid),
  File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 297, in _get_current_object
    return self.__local()
  File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 132, in _lookup
    raise RuntimeError(\'object unbound\')
RuntimeError: object unbound
'>

from e-commerce.

lasley avatar lasley commented on July 17, 2024

Hi @flotho - What are you attempting to do in the API that triggers this error? Are you able to reproduce on Runbot?

from e-commerce.

py-prak avatar py-prak commented on July 17, 2024

@lasley @flotho Is there any update on this issue ? I am facing the same one.

from e-commerce.

lasley avatar lasley commented on July 17, 2024

@py-prak - no, because we do not have proper information to diagnose.

If you could please provide some replication steps, that would be great. Otherwise, I propose that a PSC close this issue due to lack of information and response.

from e-commerce.

flotho avatar flotho commented on July 17, 2024

Hi @lasley
I reproduced the same error on runbot :

Traceback (most recent call last):
  File "/.repo_requirements/odoo/openerp/service/wsgi_server.py", line 56, in xmlrpc_return
    result = openerp.http.dispatch_rpc(service, method, params)
  File "/.repo_requirements/odoo/openerp/http.py", line 115, in dispatch_rpc
    result = dispatch(method, params)
  File "/.repo_requirements/odoo/openerp/service/common.py", line 57, in dispatch
    return g[exp_method_name](*params)
  File "/.repo_requirements/odoo/openerp/service/common.py", line 23, in exp_login
    res = security.login(db, login, password)
  File "/.repo_requirements/odoo/openerp/service/security.py", line 9, in login
    return res_users._login(db, login, password)
  File "/.repo_requirements/odoo/openerp/addons/base/res/res_users.py", line 462, in _login
    self.check_credentials(cr, user_id, password)
  File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/.repo_requirements/odoo/openerp/api.py", line 354, in old_api
    result = method(recs, *args, **kwargs)
  File "/home/odoo/build/OCA/e-commerce/website_sale_wishlist/models/res_users.py", line 27, in check_credentials
    self.env["product.wishlist"]._join_current_user_and_session()
  File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/odoo/build/OCA/e-commerce/website_sale_wishlist/models/product_wishlist.py", line 72, in _join_current_user_and_session
    ("session", "=", request.session.sid),
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 297, in _get_current_object
    return self.__local()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 132, in _lookup
    raise RuntimeError('object unbound')
RuntimeError: object unbound

Database used :
9.0 : http://3294646-9-0-05c08c.runbot1.odoo-community.org/
10.0 : http://3296172-10-0-6f996a.runbot2.odoo-community.org

Same issue

from e-commerce.

lasley avatar lasley commented on July 17, 2024

@flotho - Thanks for the test case. It seems interesting to me that the request session is not set during an API interaction. cc @yajo

from e-commerce.

flotho avatar flotho commented on July 17, 2024

@lasley , you're welcome,

from e-commerce.

yajo avatar yajo commented on July 17, 2024

What steps did you follow to get to the error?

from e-commerce.

yajo avatar yajo commented on July 17, 2024

Yeah, the problem's clear: we should check the existence of the session before attempting to use it.

from e-commerce.

pedrobaeza avatar pedrobaeza commented on July 17, 2024

Triaging.

from e-commerce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.