A hard path to a successful migration...

General eFa discussion
Post Reply
User avatar
_M_P
Posts: 4
Joined: 06 Aug 2024 07:03
Location: Italy

A hard path to a successful migration...

Post by _M_P »

Hi to all (and thanks to @shawnivertson, @pdwalker, @henk...)
I'm trying to migrate my working VM CentOS 7 + eFa v4 to AlmaLinux 9.4 + eFa v5
1)
https://wiki.efa-project.org/doku.php?id=setup_guide
It should be nice to update the information there, my feeling is that they are related to v4
2)
https://wiki.efa-project.org/doku.php?i ... tion_guide
"v4 Appliance Preparation
[...]
sudo sa-learn –backup > /root/backup.txt"
I'm getting this:
[admin@efa4 ~]$ sudo sa-learn --backup > /root/backup.txt
-bash: /root/backup.txt: Permesso negato (-->Permission denied)
So, I've issued a
sudo su -
to work as root; now, I'm getting this:
[root@efa4 ~]# sa-learn --backup > /root/backup.txt
ERROR: Bayes backup returned an error, please re-run with -D for more information

re-issued with -D switch:

[root@efa4 ~]# sa-learn --backup -D > /root/backup.txt
Aug  6 09:36:44.441 [2055] dbg: logger: adding facilities: all
Aug  6 09:36:44.441 [2055] dbg: logger: logging level is DBG
Aug  6 09:36:44.441 [2055] dbg: generic: SpamAssassin version 3.4.6
Aug  6 09:36:44.441 [2055] dbg: generic: Perl 5.016003, PREFIX=/usr, DEF_RULES_DIR=/usr/share/spamassassin, LOCAL_RULES_DIR=/etc/mail/spamassassin, LOCAL_STATE_DIR=/var/lib/spamassassin
Aug  6 09:36:44.441 [2055] dbg: config: timing enabled
Aug  6 09:36:44.442 [2055] dbg: config: score set 0 chosen.
Aug  6 09:36:44.443 [2055] dbg: util: running in taint mode? yes
Aug  6 09:36:44.443 [2055] dbg: util: taint mode: deleting unsafe environment variables, resetting PATH
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/usr/local/sbin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/usr/local/bin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/sbin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/bin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/usr/sbin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/usr/bin', keeping
Aug  6 09:36:44.443 [2055] dbg: util: PATH included '/root/bin', which is unusable, dropping: File o directory non esistente
Aug  6 09:36:44.443 [2055] dbg: util: final PATH set to: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Aug  6 09:36:44.446 [2055] dbg: config: using "/etc/mail/spamassassin" for site rules pre files

[...]

Aug  6 09:36:45.855 [2055] dbg: dns: EDNS, UDP payload size 4096
Aug  6 09:36:45.855 [2055] dbg: dns: servers set by config to: [127.0.0.1]:53
Aug  6 09:36:45.856 [2055] dbg: dns: nameservers set to 127.0.0.1
Aug  6 09:36:45.856 [2055] dbg: dns: using socket module: IO::Socket::IP version 0.21
Aug  6 09:36:45.856 [2055] dbg: dns: is Net::DNS::Resolver available? yes
Aug  6 09:36:45.856 [2055] dbg: dns: Net::DNS version: 0.72
Aug  6 09:36:45.856 [2055] dbg: sa-learn: spamtest initialized
Aug  6 09:36:45.858 [2055] dbg: bayes: unable to connect to database: Access denied for user 'sa_user'@'localhost' (using password: YES)
Aug  6 09:36:45.858 [2055] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x3e4a550) implements 'learner_close', priority 0
Aug  6 09:36:45.858 [2055] dbg: plugin: Mail::SpamAssassin::Plugin::TxRep=HASH(0x427ba58) implements 'learner_close', priority 0
Aug  6 09:36:45.858 [2055] dbg: TxRep: learner_close
ERROR: Bayes backup returned an error, please re-run with -D for more information
Searching through the forum, I've found a thread about that error, but the fix was related to eFa v3, so it's not applicable...

Any hint? Thank you...
wstemb
Posts: 17
Joined: 16 Mar 2022 07:35

Re: A hard path to a successful migration...

Post by wstemb »

Had a similar error during migration.

Simply changed the /root/ in the command to another directory I have write permission (my home). Later, in restore, I changed the last command in the guide replacing /root/... with this directory.

If I remember well, I worked in the admin user, so my home was /home/admin
User avatar
_M_P
Posts: 4
Joined: 06 Aug 2024 07:03
Location: Italy

Re: A hard path to a successful migration...

Post by _M_P »

For sure, this can fix the first error I encountered: Permission denied (BTW, in the wiki, /root/ should be /userhomedir/ , IMHO)
but not the second... :eusa-snooty:

Best regards
User avatar
shawniverson
Posts: 3757
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: A hard path to a successful migration...

Post by shawniverson »

Chances are your sa_user password is wrong in /etc/mail/spamassassin/mailscanner.cf for some reason, so it can't connect to the bayes table and export it.

Not a showstopper, since that also means your bayes is probably not working on your box anyway, so you may want to skip and start a fresh bayes on the new box.
User avatar
_M_P
Posts: 4
Joined: 06 Aug 2024 07:03
Location: Italy

Re: A hard path to a successful migration...

Post by _M_P »

shawniverson wrote: 06 Aug 2024 23:44 Chances are your sa_user password is wrong in /etc/mail/spamassassin/mailscanner.cf for some reason, so it can't connect to the bayes table and export it.
I agree; remembering an old message from you (about Bayes DB and eFa v3), I've found the culprit:
content of the /etc/eFa/SA-Config file, at keyword

Code: Select all

SAUSERSQLPWD
should be copied into /etc/mail/spamassassin/mailscanner.cf, keywords

Code: Select all

bayes_sql_password
and

Code: Select all

user_awl_sql_password;
doing so, the error went away
Not a showstopper, since that also means your bayes is probably not working on your box anyway, so you may want to skip and start a fresh bayes on the new box.
Yes, but I really prefer to have a fully working eFa v4 VM, prior to embarking on the migration to v5... :D

Thanks for your nice creation
Post Reply