Rt-dump-initialdata fails with "illegal backslash escape sequence in string"

Hi,
I’m trying to use the procedure describe in Tracking-rt-configuration - RT 5.0.4 Documentation - Best Practical to handle moving changes in a dev instance to a production instance.
However when I run ‘sbin/rt-dump-initialdata --sync --directory config-sync/new --base config-sync/base/initialdata.json’ theprocess runs for a while, then spits out what looks like parts (large parts) of the database, ande ends with:

J      }^J   ]^J}^J') called at sbin/rt-dump-initialdata line 343
main::__ANON__('config-sync/base/initialdata.json') called at sbin/rt-dump-initialdata line 346
illegal backslash escape sequence in string, at character offset 70558 (before "\\x89PNG\\r\\n\\u001...") at sbin/rt-dump-initialdata line 343.
[root@h1-rt-dev1 rt5]# sbin/rt-dump-initialdata --sync --directory config-sync/new --base config-sync/base/initialdata.json

(i’ve just copied the last few lines as the rest is sensitive data, it seems to be a dump of the user part of the database)

The changes.json file is not created.

Any suggestions on how to fix this?

Answering myself here, since I found some more information, in case someone else has the same issue.

The actual error that causes the fault is this one:

[3767852] [Wed Jan 17 14:08:58 2024] [critical]: illegal backslash escape sequence in string, at character offset 70558 (before "\\x89PNG\\r\\n\\u001...") at sbin/rt-dump-initialdata line 343. (/opt/rt5/sbin/../lib/RT.pm:409)
Trace begun at /opt/rt5/sbin/../lib/RT.pm line 314
Log::Dispatch::__ANON__('Log::Dispatch=HASH(0xd715b80)', 'illegal backslash escape sequence in string, at character offset 70558 (before "\\x89PNG\\r\\n\\u001...") at sbin/rt-dump-initialdata line 343.^J') called at /opt/rt5/sbin/../lib/RT.pm line 409
RT::__ANON__('illegal backslash escape sequence in string, at character offset 70558 (before "\\x89PNG\\r\\n\\u001...") at sbin/rt-dump-initialdata line 343.^J') called at /opt/perl5/perls/perl-5.38.2/lib/5.38.2/Carp.pm line 291
Carp::croak('illegal backslash escape sequence in string, at character offset 70558 (before "\\x89PNG\\r\\n\\u001...")') called at /opt/perl5/perls/perl-5.38.2/lib/5.38.2/JSON/PP.pm line 1363
JSON::PP::decode_error('illegal backslash escape sequence in string') called at /opt/perl5/perls/perl-5.38.2/lib/5.38.2/JSON/PP.pm line 911

And since the string mentioned looks like a png image, I had a look at the json file created by the initial sync command. The character number mentioned (offset 70558) is the start of the custom logo.

If I remove the custom logo and re-run the initial rt-dump-initialdata to create the base, make a change (added a custom field) and ran the rt-dump-initialdata with --base again, and it did not fail.

So seems like this is a bug in rt-dump-initialdata when handling custom logos uploaded in Admin->Tools->Theme. Either when creating the base, or doing the comparison.