This error seems to be the ‘website’ module bug.
It takes place when a related session (website.visitor) is archived.
It happens within 7 days if you do not log in, and then Odoo blocks duplicated session to be created.
Solution:
As Cristobal offers, manually remove archived website visitors. Using the SQL: 'DELETE FROM website_visitor WHERE active = False;'. It is possible also to do right from the interface:
Go to the entry Website > Visitors
In the debug mode add the field 'active' to the view
Filter visitors by 'Archived'
Use the Action > 'Unarchive'
To turn of the cron ‘Website Visitor: Archive old visitors’ which would block archiving any website
visitors (in order not to repeat the point 1 again).
The solution is for sure temporary until the bug
itself is not fixed. I have just sent the issue: https://github.com/odoo/odoo/issues/40077. Please follow to know when it is fixed.
So, let’s hope it will be done soon, since it is
quite dangerous, especially when customers can’t log in portal and
we have no idea that they can’t.
It seems to be due to the Track visitor module included in the website. I solved the issue by desactivated the tracking