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

[12.0] .../xmlrpc/db: 404 NOT FOUND #122

Closed
gaikaz opened this issue Dec 31, 2018 · 28 comments
Closed

[12.0] .../xmlrpc/db: 404 NOT FOUND #122

gaikaz opened this issue Dec 31, 2018 · 28 comments
Assignees

Comments

@gaikaz
Copy link

gaikaz commented Dec 31, 2018

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. :)

@Yenthe666
Copy link
Owner

Hi @gaikaz,

Thank you so much for the very detailed report, that's to awesome! I'll need some extra time to look into this as it it quite specific and big to test. I'll try to get back to you soon to see if I can figure this out. ;)

Remind me in two weeks if you didn't get a response please. I sometimes tend to miss or forget some, sorry if that happens. ;)

@gaikaz
Copy link
Author

gaikaz commented Jan 16, 2019

@Yenthe666 , kind of feel bad for doing this, but those 2 weeks passed :) Could you look into this when you have time?

@Yenthe666 Yenthe666 self-assigned this Jan 16, 2019
@Yenthe666
Copy link
Owner

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 🙏

@gr22
Copy link

gr22 commented Jan 27, 2019

I can confirm the problem in V12.0 CE

@gaikaz
Copy link
Author

gaikaz commented Mar 22, 2019

@Yenthe666 , what's your schedule these days? :) Could you estimate when this could be looked into?
I would help as much as I can.

@Yenthe666
Copy link
Owner

@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.

@gaikaz
Copy link
Author

gaikaz commented Mar 28, 2019

@Yenthe666, auto_backup issue reminder 🙊
I really hate doing this 😄

@Yenthe666
Copy link
Owner

@gaikaz no problem, I finally got around to testing it.
I created two databases, both scheduled them to backup and logged out everywhere from all Odoo databases.
Result in the logs from db 1:

2019-04-03 07:40:15,160 6424 INFO demo12subscriptions odoo.addons.base.models.ir_cron: Starting job Backup scheduler. 
2019-04-03 07:40:15,190 6424 INFO None werkzeug: 127.0.0.1 - - [03/Apr/2019 07:40:15] "POST /xmlrpc/db HTTP/1.1" 200 - 2 0.005 0.012
2019-04-03 07:40:15,193 6424 INFO demo12subscriptions odoo.service.db: DUMP DB: demo12subscriptions format zip 

Result in the logs from db2:

2019-04-03 07:41:17,674 6424 INFO demoworkshop odoo.addons.base.models.ir_cron: Starting job Backup scheduler. 
2019-04-03 07:41:17,700 6424 INFO None werkzeug: 127.0.0.1 - - [03/Apr/2019 07:41:17] "POST /xmlrpc/db HTTP/1.1" 200 - 2 0.005 0.010
2019-04-03 07:41:17,703 6424 INFO demoworkshop odoo.service.db: DUMP DB: demoworkshop format zip 

I also get two backups on my disk.
Do you have further configurations or anything? I'm not able to reproduce it.

@gaikaz
Copy link
Author

gaikaz commented Apr 3, 2019

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

@susankc
Copy link

susankc commented Apr 3, 2019

When i try to save a file with appropriate information i came with error below but this error does not exist in localhost. Can you tell me why this is happening?

Error ! No such database exists!

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

@Yenthe666
Copy link
Owner

Your database/Odoo probably runs on another port @susankc 😉

@gaikaz
Copy link
Author

gaikaz commented Apr 3, 2019

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.

@Yenthe666
Copy link
Owner

Aha! 🎉 Hey that was quite an interesting and insightful comment to read. It are these kind of things that make sense but only after you've solved them 😆
I'm happy you've figured it out!

@susankc
Copy link

susankc commented Apr 4, 2019

No my database is in same port i cannot even save my file. I came upto same error again and again. @Yenthe666

@Yenthe666
Copy link
Owner

Please add more info such as a screenshot of the configuration.
Are you sure you don't have a db-filter set or ngnix configurations?

@susankc
Copy link

susankc commented Apr 4, 2019

My configuration
[options]
addons_path =
db_host = False
db_name = False
db_port = False
db_user = odoo12
db_password = False
dbfilter = ^%h$
geoip_database = /usr/share/GeoIP/GeoLiteCity.dat
limit_memory_hard = 1677721600
limit_memory_soft = 629145600
limit_request = 8192
limit_time_cpu = 800
limit_time_real = 1600
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
xmlrpc = True
xmlrpc_interface = 127.0.0.1
xmlrpc_port = 8016
and my nginx setup
#odoo server
upstream odoo {
server 127.0.0.1:8016;
}
upstream odoo {
server 127.0.0.1:8078;
}

@susankc
Copy link

susankc commented Apr 4, 2019

I set dbfilter to ^%h$ @Yenthe666

@Yenthe666
Copy link
Owner

Why two upstreams on different ports?
upstream odoo {
server 127.0.0.1:8016;
}
upstream odoo {
server 127.0.0.1:8078;
}

The rest looks fine honestly. Perhaps the configuration in Odoo itself for the backup is wrong too?

@susankc
Copy link

susankc commented Apr 4, 2019

One port for long polling and one for xmlrpc actually it was
#odoo server
upstream odoo {
server 127.0.0.1:8016;
}
upstream odoochat {
server 127.0.0.1:8078;
}

@gaikaz
Copy link
Author

gaikaz commented Apr 4, 2019

@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.

@susankc
Copy link

susankc commented Apr 4, 2019

i came up with these error

<title>404 Not Found</title>

Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Did i do something wrong ?

@gaikaz
Copy link
Author

gaikaz commented Apr 4, 2019

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
Copy link

susankc commented Apr 4, 2019

Yes you can see below
[Service]
Type=simple
PermissionsStartOnly=true
User=odoo
Group=odoo
SyslogIndentifier=odoo
ExecStart=/opt/odoo/odoo/venv/bin/python3 /opt/odoo12/odoo/odoo-bin --config=/etc/odoo.conf --logfile /var/log/odoo/odoo.log
WorkingDirectory=/opt/odoo/odoo/

[Install]
WantedBy=multi-user.target

@susankc
Copy link

susankc commented Apr 4, 2019

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.

@Yenthe666
Copy link
Owner

Awesome, good luck guys!

@gr22
Copy link

gr22 commented Apr 5, 2019

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

@Yenthe666
Copy link
Owner

As it seems to have hit three people I've also added it in the important information section of the readme. Added in 4f45b45 - I hope that helps others to identify the problem faster.

@OpencloudPro
Copy link

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!!

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

No branches or pull requests

5 participants