1

Topic: Oooohhh I screwed things up big time. Halp! (Python SQL)

==== Required information ====
- iRedMail version (check /etc/iredmail-release):.0.9.5-1
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MariaDB)
- Web server (Apache or Nginx): Apache (I think!)
- Manage mail accounts with iRedAdmin-Pro? Nope!
- Related log if you're reporting an issue:
[Wed Aug 17 21:18:44.134934 2016] [:error] [pid 3864] [remote 10.1.10.186:164] mod_wsgi (pid=3864): Target WSGI script '/var/www/iredadmin/iredadmin.py' cannot be loaded as Python module.
[Wed Aug 17 21:18:44.134951 2016] [:error] [pid 3864] [remote 10.1.10.186:164] mod_wsgi (pid=3864): Exception occurred processing WSGI script '/var/www/iredadmin/iredadmin.py'.
[Wed Aug 17 21:18:44.134962 2016] [:error] [pid 3864] [remote 10.1.10.186:164] Traceback (most recent call last):
[Wed Aug 17 21:18:44.134974 2016] [:error] [pid 3864] [remote 10.1.10.186:164]   File "/var/www/iredadmin/iredadmin.py", line 9, in <module>
[Wed Aug 17 21:18:44.134993 2016] [:error] [pid 3864] [remote 10.1.10.186:164]     from libs import iredbase
[Wed Aug 17 21:18:44.134997 2016] [:error] [pid 3864] [remote 10.1.10.186:164]   File "/var/www/iredadmin/libs/iredbase.py", line 42, in <module>
[Wed Aug 17 21:18:44.135004 2016] [:error] [pid 3864] [remote 10.1.10.186:164]     pw=settings.iredadmin_db_password,
[Wed Aug 17 21:18:44.135008 2016] [:error] [pid 3864] [remote 10.1.10.186:164]   File "/usr/lib/python2.7/site-packages/web/db.py", line 1143, in database
[Wed Aug 17 21:18:44.135014 2016] [:error] [pid 3864] [remote 10.1.10.186:164]     return _databases[dbn](**params)
[Wed Aug 17 21:18:44.135017 2016] [:error] [pid 3864] [remote 10.1.10.186:164]   File "/usr/lib/python2.7/site-packages/web/db.py", line 975, in __init__
[Wed Aug 17 21:18:44.135022 2016] [:error] [pid 3864] [remote 10.1.10.186:164]     import MySQLdb as db
[Wed Aug 17 21:18:44.135032 2016] [:error] [pid 3864] [remote 10.1.10.186:164] ImportError: No module named MySQLdb
====

Allow me to explain my tale of woe.

Tuesday night I was messing around with the Global Address Book for the SQL backend and got it into my head to try and update MariaDB to 10.w/e to resolve an issue I was encountering with said GAB. I got a warning prompt from Yum that made me think twice about installing it and told it NO. Little did I know it had already caused some damage... because everything seemed to be working fine.

Wednesday morning I tried getting a Calendar up and running in RoundCube. The plugin process was complaining about a certificate vulnerability in my version of PHP and refused to cooperate. So I upgraded PHP!! To version 7. And then I restarted the server.

And that's when everything stopped working!

At first, the logs were giving me plenty of errors. I've been tracking them down and dealing with them one by one. Most were PHP related. Apparently PHP7-common didn't come with a lot of little things that the various packages for iRed needs. One thing that kept coming up was SQL errors. Some of these were on the PHP side... the rest....

You see, apparently some of the MariaDB upgrade went through. Yum was giving me conflicting reports about MariaDB versions installed (5. and 10.) and what was being used. Folder structures, links, variables were all borked. Restarting the server triggered these issues.

Also, my tables were FUBARd.

I resolved the installation issues for Maria, tracked down what I think are most of MySQL PHP dependencies, reloaded my tables, and I'm MOSTLY back.

I now have the python error above resulting in 500 error from iredadmin, but I'm about to work on tracking it down. Also, no mail will send or receive... but I'm not getting an error in any of the logs I can see about WHY. Guesses would be helpful.

Why the long story if I'm on my way to recovery? One as a cautionary tale to those who just want to do that one last thing before making a full backup. Two... Mr. Zhang, anyone, thoughts off the top of your head as to what else I might want to be looking at? I'm fairly sure I have damn near every log file tailed on my screen right now. lol

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

Yay! iredadmin is back. yum install MySQL-python FTW.

Now let's see about mail....

3

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

Show us the original error messages so that others can help.

4

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

For anyone tuning in... it seems Postfix isn't running. This should be the cause of not being able to send or receive mail.

I'm not sure how anything I did messed this up... what concerns me is that I don't have a main.cf or master.cf file as described here: http://www.iredmail.org/docs/file.locat … ostfix-log

I do have an rpmsave of each. Further though, "-bash: postfix: command not found". I know the master.cf file controls the Postfix daemons, but shouldn't Postfix still be available? Duplicating and renaming my rpmsave files to the noted standard and rebooting....

5

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

Postfix was removed?

6

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

ZhangHuangbin wrote:

Show us the original error messages so that others can help.

Well right NOW all I'm getting is:

Aug 18 10:18:08 mail roundcube: PHP Warning:  stream_socket_client(): unable to connect to 127.0.0.1:587 (Connection refused) in /var/www/roundcubemail-1.2.0/vendor/pear-pear.php.net/Net_Socket/Net/Socket.php on line 158
Aug 18 10:18:08 mail roundcube: ERROR: Connection refused (111)
Aug 18 10:18:08 mail roundcube: ERROR: Failed to connect socket: Connection refused ()
Aug 18 10:18:08 mail roundcube: <059ojfkq> SMTP Error: Connection failed: Failed to connect socket: Connection refused in /var/www/roundcubemail-1.2.0/program/lib/Roundcube/rcube.php on line 1595 (POST /mail/?_task=mail&_unlock=loading1471537090119&_lang=en_US&_framed=1&_action=send)

Which I'm fairly sure is because Postfix isn't running....

7

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

ZhangHuangbin wrote:

Postfix was removed?

Postfix shouldn't have been touched by anything I did. I'm REALLY confused as to why it's not running... at least not running enough to give me errors or work in bash.

8

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

What would happen if I backed up my folders, yum installed Postfix, and put all the conf files back in place?

9

Re: Oooohhh I screwed things up big time. Halp! (Python SQL)

Simple installing Postfix from yum and starting it seemed to fix the remaining problems. W00t!