This question has been flagged

First of all, it looks like the problem arises with every new Windows installation on different machines. So this seems like a general buck. I hope a developer can test this to see what the problem is. 

Update 1: First look at my update at the end of the text to easily test it. 

Update 2: Look at the first answer of the post for better error description. 

Odoo version: Odoo 14.0-20211126 (Community Edition)

Testet also with Odoo 15


I'm creating an HTML e-mail with "e-mail marketing". Here I add various links and also internal links of my odoo-subpages. When I send a test email everything works fine, the links are not automatically converted to relative links (utm-links). When I send the mail to customers, the links are converted into relative links and and odoo converted them to utm-links for tracking.

If you open on one of the non working links in the e-mail, you will be directed correctly

to my page, but then the error 500 appears with the following text. :


500 - Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.


So it looks like the Odoo UTM-links does not work for incomprehensible reasons. The original link (relative link: http://site.mydomain.de/r/ZuJ/m/67) in the e-mail is corectly converted by Odoo when it is called and then appears in the address bar of the browser the UTM-Link:

https://mydomain.domain.de/kontakt?utm_source=testtest+2021-11-27+22%3A58%3A22&utm_medium=Email

Mydomain is of course my correct web address. So the redirection works correctly.


It looks like, every UTM-link, which are created below my homepage main page, are blocked. How can this happen? Does it maybe have something to do with the cookie settings on my site? (note my update at the end of the text)


Since I suspected a bug in the web server (IIS), I tested the whole thing directly on the server with localhost to bypass the web server. The error remains the same, so it is clear that it must be due to Odoo itself. 


The following UTM-link was displayed:

https://localhost/kontakt?utm_source=testtest+2021-11-27+22%3A58%3A22&utm_medium=Email


It should also be mentioned that Odoo is addressed via a subdomain over the Internet. That shouldn't have anything to do with the bug, however. 


Some utm-links work sometimes, but it also depends on whether I put them in the e-mail with http:// or https://. The link to my Odoo home page (only homesite) works, for example, and sometimes links external sites as well. However, Oddo internal sub-pages do not work at all.

I have now created a test database on Odoo.com and there I created a e-mail in E-Mail Marketing and added an internal link to a subpage of my own Odoo page. If I now open this link, the same error 500 on the UTM-link is also displayed on my page, although the whole thing was initially via the test database at Odoo.com. So my odoo site does not accept UTM links on all of my subpages.

I've tested this on different Windows machines. Even with completely new databases. The result is always the same, it doesn't work and the error is always the same. The Odoo versions are all up-to-date.


This message can be found in the log file (there is a different link like the one above, the error is the same):


ValueError: Setting 'domain' for a cookie on a server running locally (ex: localhost) is not supported by complying browsers. You should have something like: '127.0.0.1 localhost dev.localhost' on your hosts file and then point your server to run on 'dev.localhost' and also set 'domain' for 'dev.localhost' 

- - -

2021-11-27 23:08:05,614 6956 INFO My-Company werkzeug: 127.0.0.1 - - [27/Nov/2021 23:08:05] "GET /r/CM4/m/68 HTTP/1.1" 301 - 16 0.000 0.047

2021-11-27 23:08:05,692 6956 INFO My-Company werkzeug: 127.0.0.1 - - [27/Nov/2021 23:08:05] "GET /einfuehrende-buecher/?utm_source=test+2021-11-09+19%3A14%3A50+%28Kopie%29&utm_medium=Email HTTP/1.1" 500 - 4 0.016 0.031

2021-11-27 23:08:05,692 6956 ERROR My-Company werkzeug: Error on request:


Traceback (most recent call last):

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\serving.py", line 306, in run_wsgi

    execute(self.server.app)

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\serving.py", line 294, in execute

    application_iter = app(environ, start_response)

  File "C:\Program Files\Odoo\server\odoo\service\server.py", line 441, in app

    return self.app(e, s)

  File "C:\Program Files\Odoo\server\odoo\service\wsgi_server.py", line 113, in application

    return application_unproxied(environ, start_response)

  File "C:\Program Files\Odoo\server\odoo\service\wsgi_server.py", line 88, in application_unproxied

    result = odoo.http.root(environ, start_response)

  File "C:\Program Files\Odoo\server\odoo\http.py", line 1306, in __call__

    return self.dispatch(environ, start_response)

  File "C:\Program Files\Odoo\server\odoo\http.py", line 1272, in __call__

    return self.app(environ, start_wrapped)

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\middleware\shared_data.py", line 220, in __call__

    return self.app(environ, start_response)

  File "C:\Program Files\Odoo\server\odoo\http.py", line 1479, in dispatch

    result = ir_http._dispatch()

  File "C:\Program Files\Odoo 14.0.20210311\server\odoo\addons\website_sale\models\ir_http.py", line 15, in _dispatch

    return super(IrHttp, cls)._dispatch()

  File "C:\Program Files\Odoo\server\odoo\addons\website\models\ir_http.py", line 183, in _dispatch

    response = super(Http, cls)._dispatch()

  File "C:\Program Files\Odoo\server\odoo\addons\auth_signup\models\ir_http.py", line 19, in _dispatch

    return super(Http, cls)._dispatch()

  File "C:\Program Files\Odoo\server\odoo\addons\web_editor\models\ir_http.py", line 21, in _dispatch

    return super(IrHttp, cls)._dispatch()

  File "C:\Program Files\Odoo\server\odoo\addons\utm\models\ir_http.py", line 29, in _dispatch

    response = super(IrHttp, cls)._dispatch()

  File "C:\Program Files\Odoo\server\odoo\addons\http_routing\models\ir_http.py", line 505, in _dispatch

    return cls._handle_exception(routing_error)

  File "C:\Program Files\Odoo\server\odoo\addons\utm\models\ir_http.py", line 35, in _handle_exception

    return cls._set_utm(response)

  File "C:\Program Files\Odoo\server\odoo\addons\utm\models\ir_http.py", line 24, in _set_utm

    response.set_cookie(cook, request.params[var], domain=domain)

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\wrappers\base_response.py", line 481, in set_cookie

    samesite=samesite,

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\http.py", line 1150, in dump_cookie

    domain = _make_cookie_domain(domain)

  File "C:\Program Files\Odoo\python\lib\site-packages\werkzeug\_internal.py", line 394, in _make_cookie_domain

    "Setting 'domain' for a cookie on a server running locally (ex: "


Update:

If I generate a link with the "Link Tracker" module without assigning a "medium" or "source" to it, then this generated link works good. As soon as a "medium" or a "source" is assigned, the error 500 occurs when the generated link is opened. The problem already exists when only working locally with the localhost without a web server (Nginx, Apache or IIS). It is probably an internal problem of the Odoo web server "Werkzeug".



Avatar
Discard
Author

Additional error description and possible workarounds

 

Additional error description

 

The UTM link is wrong or generated incorrectly and therefore the returned URL is not functional.

The value ? within ?utm_source is not accepted.

 If change "?" to "#" the link will work.

 

Examples of non-working URL and working URL

 

Not working URL:

https://sub.domain.com/book?utm_source=Test&utm_medium=Direct

 

Working URL:

 https://sub.domain.com/book#utm_source=Test&utm_medium=Direct

 

The tracking link generated by Odoo is of course always used as the original link. Such as: 

http://sub.domain.com/r/CQf


It is also possible to use the "=" sign ";" to be replaced so that the link works.


Working URL:

https://sub.domain.com/book?utm_source;Test&utm_medium;Direct


There are a couple of ways you can replace the characters to make the URL work.

 

Test on Linux-server

For comparison, on a Linux server the URL (link) work with the original characters:

https://12345.odoo.com/?utm_source=Newsletter&utm_medium=Email#scrollTop=0

Accordingly, the value is the same and there are no problems opening the link. The Odoo or Odoo-webserver (Werkzeug) programming on Windows also seems to have an error.

Basically, however, the URL should work with the default value ​​and it should not be necessary to replace the character. So I am assuming that something has to be adjusted in the Odoo-programming under Windows so that the values „?" , "=" , "&" work or are accepted. However, I am not a programmer and don't know my way around so I can find a solution here. As long as this is not changed, however, no Windows installation will work correctly, regardless of which primary web server (IIS, Apache or Nginx) is used on the server.

 

The bug also existing in Odoo 15.

 


Author Best Answer

Here is the solution to the problem. It took me a while to find the very simple solution. The reverse proxy was configured incorrectly. Here I had the value http://localhost:8069 instead of http://127.0.0.1:8069.  Basically, the "localhost" is not used as a value for the revers proxy.  

I use the IIS web server as my webserver on Windows. That is definitely very special. Anyway it works fine now. On Linux, Nginx is normally used and here is the finished configuration code to copy anywhere on the internet, so the problem has probably not arisen here for anyone.

In order to test the linktracker local on your server, you can not work with the localhost address (http://localhost:8069/). Instead, simply call up odoo with http://127.0.0.1:8069 and test it there.




Avatar
Discard

i have installed odoo in ubuntu and its perfectly working when accessing via ubuntu but when trying to access via windows , its either slow or not loading

Author

I also ended up using Ubuntu as the Oddo Server. Setting it up under Linux, especially if you are not familiar with the system, is not that easy. But in the end it worked without any problems. I recommend using Nginix on Windows instead of IIS web server, it should be much easier to setup and should work on Windows as well. I haven't tested it though.

Best Answer

If You're Trying to Load a Page with a 500 Internal Server Error:
1. Refresh the page.
2. Come back later.
3. Delete your browser's cookies.
4. Paste your URL into the website "Down for Everyone or Just Me."

Hope THis Helps,
Peter

Avatar
Discard
Author

Thanks for your comment but that was not the reason why this error occurred. Please read the comment above, it has already been resolved.