auto_backup: [12.0] .../xmlrpc/db: 404 NOT FOUND

Full error in the popup:

Error ! No such database exists!

Error details:
<ProtocolError for localhost:8069/xmlrpc/db: 404 NOT FOUND>

How to reproduce:

  • Odoo version 12.0
  • Multiple DBs on one Odoo instance (/web/database/selector must give multiple options)
  • Back-ups configuration: Host: localhost (default) Database: [Current DB] (default) Port: 8069 (default)

The problem is caused by the multiple databases. At first I was very confused as to why my browser seems to be able to open the /xmlrpc/db uri and server gives a xml response (even if it is a faulty one), but trying to use curl ends up in an actual 404. Then I figured out that it remembers the session_id from normal use of Odoo and so sends that to the server as well. Removing the cookie results in server giving 404 to the browser as well.

To check my diagnosis further, I tried running Odoo with dbfilter set to only find one of the databases and indeed this helps with opening /xmlrpc/db from anywhere, as it can automatically figure out the database and assign a new session.

It seems that a lot has changed how Odoo handles RPC requests in V12. From what I’ve gathered looking at V9-12 code, it looks like in V12 (maybe V11 too) Odoo starts handling RPC (HTTP) requests more like any other module would - with proper controllers and @route directives in them. So my guess is that this includes session checking somewhere deeper in the code. Maybe this is an actual issue to be reported to Odoo repositories, as the /xmlrpc/db -> list method kind of becomes redundant.

Hopefully I provided enough information about the issue to save as much of your time as possible. 😃

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 28 (10 by maintainers)

Most upvoted comments

Good news everybody! We have a delivery to… I mean, I figured it out! 😃

The problem was incorrect use of --load=... launch argument. Because I use letsencrypt module, it has to be loaded server-wide, which is done with this argument.

My setup used: --load=web,letsencrypt

Module web here is specified, because it is a default of this argument and we still want to load it. On Odoo 10.0 the default was web,web_kanban. On Odoo 11.0 it was changed to web. On Odoo 12.0 it is now base,web

As we can see, Odoo 12.0 now has base loaded this way. It means, that module base used to be loaded server-wide (on all databases as a sort of a “singleton”) automatically. Therefore database independent HTTP requests like /xmlrpc/db used to work no matter if database was selected. On my setup base was loaded on each database separately and that’s why I wouldn’t get a response from the server on /xmlrpc/db without first selecting a database. @gr22, tagging you here, as you probably have something similar done with your server 😉

TL;DR: If you are using --load=... launch argument with Odoo 12.0, you have to make sure you have base module loaded with it.

Awesome, good luck guys!

Sorry, I didn’t get around to it, I’ve been sick a few days too. I’ve pinned it into my list of “Saved for later” on Github - I’ve got 20 outstanding items there - that should remind me to check into this one. Just searching for some extra time 🙏

Good news everybody! We have a delivery to… I mean, I figured it out! 😃

The problem was incorrect use of --load=... launch argument. Because I use letsencrypt module, it has to be loaded server-wide, which is done with this argument.

My setup used: --load=web,letsencrypt

Module web here is specified, because it is a default of this argument and we still want to load it. On Odoo 10.0 the default was web,web_kanban. On Odoo 11.0 it was changed to web. On Odoo 12.0 it is now base,web

As we can see, Odoo 12.0 now has base loaded this way. It means, that module base used to be loaded server-wide (on all databases as a sort of a “singleton”) automatically. Therefore database independent HTTP requests like /xmlrpc/db used to work no matter if database was selected. On my setup base was loaded on each database separately and that’s why I wouldn’t get a response from the server on /xmlrpc/db without first selecting a database. @gr22, tagging you here, as you probably have something similar done with your server 😉

TL;DR: If you are using --load=... launch argument with Odoo 12.0, you have to make sure you have base module loaded with it.

Thanks for the save!!

Thank you guys i figured out my problem. I have save problem like @gaikaz i put --load in my service file and now it is working fine in my server. This setup was not need in 11 version i guess.

As it seems to have hit three people I’ve also added it in the important information section of the readme. Added in https://github.com/Yenthe666/auto_backup/commit/4f45b45bd72a7e66a312cfe0033df1ee65597947 - I hope that helps others to identify the problem faster.

Hey @gaikaz this was exactly the issue in my case. base module was not being pre-loaded. Appreciate your efforts.

No. It just means your setup is somehow wrong. I’m starting to believe you have the same problem like I did. You are not loading base module server-wide. How do you start your odoo server? With systemd? if so, could you send your systemd service file contents here? It should be somewhere in /etc/systemd/system if it’s an Debian based system.

@susankc, could you do a simple test logged in to your server terminal: curl localhost:8016/xmlrpc/db

It either gives you a html page for 404 error or some XML (the correct outcome) If you get 404, then it really is some bad server setup and not the module.

@Yenthe666 I’ll try my case again later today on a fully fresh Odoo install. Maybe this really was core issue that was fixed.

@gaikaz can you perhaps remind me half next week? I’m still as busy but I’ll try to squeeze in a check next week. Very sorry.