On 28.10.2018 02:12, Dan wrote:
After the file copy completes, the database is still locked with the statement above, and it starts the mysqldump; building the mysqldump command line from the database URL. The initial value is set here:

|
trac/db/mysql_backend.py:243:       args = [self.mysqldump_path, '--no-defaults']
|

Note the '--no-defaults' in args[1].
However, when set, it is added to the same constructed mysqldump command line started in the code above with the following:

|
trac/db/mysql_backend.py-255-           elif name == 'read_default_file':  # Must be first trac/db/mysql_backend.py:256:               args.insert(1, '--defaults-file=' + value)
|

This correctly makes '--defaults-file' first, but it pushes the original first argument ('--no-defaults') to the second argument. These arguments are mutually exclusive with any version of mysqldump I could find, resulting in the confusing error:

|
$ mysqldump --defaults-file=trac/conf/my.cnf --no-defaults
mysqldump: unknown option '--no-defaults'
|

I had to apply the following patch to resolve this:

|
--- db/mysql_backend.py.orig    2018-10-27 15:19:15.285092905 -0700
+++ db/mysql_backend.py 2018-10-27 15:11:36.138342337 -0700
@@ -255,3 +255,3 @@
             elif name == 'read_default_file':  # Must be first
- args.insert(1, '--defaults-file=' + value)
+                args[1] = '--defaults-file=' + value
             elif name == 'unix_socket':
|

The first argument should be replaced, not shifted. This patch and including 'read_default_file' the database URL resolves the issue.
It seems --no-defaults is relatively new in Trac: https://trac.edgewall.org/ticket/12880#comment:4 The interaction with read_default_file / --defaults-file was maybe not considered / encountered yet.

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to