On Thu, 2021-02-25 at 13:24 -0800, Mark Sapiro wrote:
On 2/25/21 6:32 AM, David Partain via Mailman-users wrote:
In /etc/mailman3/mailman.cfg I see:
class: mailman.database.mysql.MySQLDatabase
url: mysql+pymysql://mailman3:NopeNotPastingThat@localhost/mailman3?charset=utf8&use_unicode=1
Should I change the latter to be something like:
url: mysql+pymysql://mailman3:NopeNotPastingThat@localhost/mailman3?charset=utf8mb4&use_unicode=1
Yes, either make it charset=utf8mb4 or I think dropping the charset=
option altogether will use the database default, however I'm not clear
why this would be the issue as this only controls how Mailman core
accesses the database, and your issue is with HyperKitty/Django and its
access is controlled by the DATABASES setting in Django's settings which
you say do specify 'charset': 'utf8mb4' in OPTIONS.
Also, it seems Mailman core is not even using the same database - i.e.
mailman3
whereas Django's is mailman3web
.
Hi Mark,
Thanks for being patient with me. I'm still baffled but might have found the problem.
I've done the above, to no avail.
If I look at the queries being sent to mysql, I see stuff like this:
174 Connect mailman3web@localhost<mailto:mailman3web@localhost> on mailman3web using TCP/IP
174 Query SET sql_mode='STRICT_TRANS_TABLES'
174 Query COMMIT
174 Query SET AUTOCOMMIT = 0
174 Query SET AUTOCOMMIT = 1
174 Query SET AUTOCOMMIT = 0
I note that there is nothing about the charset, so something's clearly wonky.
As previously stated, /etc/mailman3/mailman-web.py has the right thing:
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4',
},
but that latter is having no effect.
I then found /var/lib/ucf/cache/:etc:mailman3:mailman-web.py which doesn't have charset
(but does have init_command), but I _think_ that's only about the package management system.
So... I found that /usr/share/mailman3-web/settings_local.py is just a link to /etc/mailman3/mailman-web.py
(which obviously has the right thing), but what about the .pyc file?
# grep -i STRICT_TRANS_TABLES /usr/share/mailman3-web/settings_local.pyc
Binary file /usr/share/mailman3-web/settings_local.pyc matches
# grep -i charset /usr/share/mailman3-web/settings_local.pyc
#
It ain't in the .pyc file. Am I overly optimistic that that might the be problem?
If so, I'd be grateful if someone'd tell the newbie how to recreate that file without
trashing something.
Cheers,
David