Search code examples
cookiesodoo-8odoointernal-server-errorodoo-server

Why am I getting "Internal Server Error" running two Odoo instances (same domain but different ports)?


I have two instances of Odoo in a server in the cloud. If I make the following steps I get "Internal Server Error":

  1. I make login in the first instance (http://111.222.33.44:3333)
  2. I close the session
  3. I load the address of the second instance in the same browser (http://111.222.33.44:4444)

If I want to work in the second instance (in another port), I need to remove the browser cookies first to acces to the other Odoo instance. If do this everything works fine.

If I load them in differents browsers (Firefox and Chromium) at the same time, they work well as well.

It's not a NginX issue because I tried with and without it.

Is there a way to solve this permanently? Is this the expected behaviour?


Solution

  • Finally I think this is the expected behaviour. The cookies of all websites are stored specifically for each website (for each domain) in the web browser. So if I only change the port the cookies of the first instance are in conflict with the cookies of the other instance because the have the same domain (111.222.33.44 in my example).

    So there are some workarounds:

    Change Domain Locally

    Creating a couple of domain name in my laptop in /etc/hosts:

    111.222.33.44  cloud01
    111.222.33.44  cloud02
    

    Then the cookies don't interfere with each other anymore. To access to each instance

    http://cloud01:3333
    http://cloud02:4444
    

    Broswer Extension. Multilogin or Multiaccount

    There is another workaround. If I use this chromium extension the problem disappears because the sessions are treated separately: