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

Odoo server error #50

Open
mauryasoftware opened this issue Aug 3, 2020 · 5 comments
Open

Odoo server error #50

mauryasoftware opened this issue Aug 3, 2020 · 5 comments

Comments

@mauryasoftware
Copy link

I am getting this issue

{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": 200,
"message": "Odoo Server Error",
"data": {
"name": "odoo.exceptions.AccessDenied",
"debug": "Traceback (most recent call last):\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 656, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 314, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/tools/pycompat.py", line 87, in reraise\n raise value\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 698, in dispatch\n result = self._call_function(**self.params)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 346, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/service/model.py", line 97, in wrapper\n return f(dbname, *args, **kwargs)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 339, in checked_call\n result = self.endpoint(*a, **kw)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 941, in call\n return self.method(*args, **kw)\n File "/home/om/odoo-dev/odoo-12/odoo/odoo/http.py", line 519, in response_wrap\n response = f(*args, **kw)\n File "/home/om/odoo-dev/odoo-12/community/odoo-rest-api-master/controllers/controllers.py", line 44, in authenticate\n try:\nodoo.exceptions.AccessDenied: login is required.\n",
"message": "login is required.",
"arguments": [
"login is required."
],
"exception_type": "access_denied"
}
}
}

@yezyilomo
Copy link
Owner

It looks like you are not passing login parameter when authenticating your user, you should pass login, password and db.

@yezyilomo
Copy link
Owner

Your request body should look like

{
    "params": {
         "login": "[email protected]",
         "password": "yor_password",
         "db": "your_db_name"
    }
}

@mauryasoftware
Copy link
Author

mauryasoftware commented Sep 23, 2020

I am getting wrong status, its always given me 200 Ok. whenever i need to get different status for wrong value passing see attachment file status and error message.
Screenshot-from-2020-09-23-14-44-50

@daolvcntt
Copy link

I am getting this issue. Please help me. I using odoo 14
{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": 200,
"message": "Odoo Server Error",
"data": {
"name": "werkzeug.exceptions.BadRequest",
"debug": "Traceback (most recent call last):\n File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch\n result = request.dispatch()\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch\n result = self._call_function(**self.params)\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 326, in _call_function\n raise werkzeug.exceptions.BadRequest(msg % params)\nException\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception\n raise exception.with_traceback(None) from new_cause\nwerkzeug.exceptions.BadRequest: 400 Bad Request: <function Home.index at 0x7fbe7a992a60>, /: Function declared as capable of handling request of type 'http' but called with a request of type 'json'\n",
"message": "400 Bad Request: <function Home.index at 0x7fbe7a992a60>, /: Function declared as capable of handling request of type 'http' but called with a request of type 'json'",
"arguments": [],
"context": {}
}
}
}

@cicciob95
Copy link

I had the same problem but I realized that I had inserted an / more ... so check the URI

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

No branches or pull requests

4 participants