• Support
  • fail2ban causes wo site update domain.com --php73 to fail.

Today I migrated my EasyEngine driven server to WordOps. first of all: thank you guys for forking and working on this project!

After successful migration (I believe), I tried to follow the post-migration steps laid out in docs.
So I used the wo site update domain.com --php73 command to update my most important vhost to php 7.3 as the site was no longer reachable after ee2wo migration.
However this did not work as expected. Instead I am seeing this notice in wo log:

Creating config file /etc/php/7.3/mods-available/xsl.ini with new version
php7.3-zip (7.3.5-1+ubuntu16.04.1+deb.sury.org+1) wird eingerichtet ...

Creating config file /etc/php/7.3/mods-available/zip.ini with new version
Trigger für libc-bin (2.23-0ubuntu11) werden verarbeitet ...
Trigger für systemd (229-4ubuntu21.21) werden verarbeitet ...
Trigger für ureadahead (0.100.0-19.1) werden verarbeitet ...
Trigger für php7.3-fpm (7.3.5-1+ubuntu16.04.1+deb.sury.org+1) werden verarbeitet ...
Fehler traten auf beim Bearbeiten von:
fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)
2019-05-10 17:02:42,964 (INFO) wo : [94m[91mOops Something went wrong!![0m
2019-05-10 17:02:42,964 (ERROR) wo : [91mCheck the WordOps log for more details tail /var/log/wo/wordops.log and please try again...[0m

Any help? Why can't wo handle my fail2ban installation?

EDIT:
Ok, so for the time being I removed fail2ban and ran above command once more.
Now I am seeing this in terminal:

Running pre-update checks, please wait...
NGINX configuration check failed.
root@server:# nginx -t
nginx: [emerg] unknown directive "serverunix:/var/run/php/php73-fpm.sock" in /etc/nginx/conf.d/upstream.conf:37

Duh. Any help?

Have you installed stack after migration?
wo stack install --all

Hey Marcio,
in this very moment I also came to the conclusion, that some files must be missing. So I came back to the forum to check for the stack install command 🙂
thanks so much.
I will let you know, if that was the culprit!

Hm.. but no.. it didn't help.
I am still seeing the connect error in error log, when trying to access my sites:
upstream: "fastcgi://127.0.0.1:9173"

I fixed all the error notices that came up when I ran nginx -t but still.. noluck. Website gives me a 502 error. something is wrong with php here

I commented out the mentioned unknown directive when running nginx -t:
unknown directive "serverunix:/var/run/php/php73-fpm.sock" in /etc/nginx/conf.d/upstream.conf:37

But that didn't help. Sites are still 502ing me.
help 😃

Ok; well, to get my sites back up again, I did the following steps in following order:

  1. I migrated EE to WordOps according to this guide

  2. I then noticed that my site weren't running anymore and that there were several notices output when running nginx -t
    Among those notices were these:

    1. nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in .... /var/www/anydomainwithssl/conf/nginx/ssl.conf
    2. nginx: [emerg] unknown "webp_suffix" variable
    3. [emerg] unknown directive "serverunix:/var/run/php/php73-fpm.sock" in /etc/nginx/conf.d/upstream.conf:37
    4. [warn] could not build optimal server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64; ignoring server_names_hash_bucket_size
  3. Mentioned emergency notice #3 caused any further tests to break. So this was, what I fixed first. To do so, I then did the following:
    Tried removing previously installed php versions from ee
    sudo apt-get autoremove --purge php7.0-* php5.6-* memcached
    then I did
    wo stack install --all
    but the issues didn't go away.. I browsed the forums, but didn't find help.
    Then I thought.. hm maybe something is missing for wo to work properly. So I did:
    wo maintenance
    followed by
    wo update
    followed by
    source /etc/bash_completion.d/wo_auto.rc
    then I checked again using
    nginx -t
    and started fixing all those ssl notices under #1. To do so, I simply did the following for every vhost that had ssl enabled and uncommented the line that read ssl on; like so: # ssl on;
    sudo nano /var/www/anyvhostwithsslenabled.com/conf/nginx/ssl.conf
    then another nginx -t. Now I was left with #2. To fix it I ran:
    echo -e '\nmap $http_accept $webp_suffix {\n default "";\n "~*webp" ".webp";\n}' > /etc/nginx/conf.d/webp.conf
    once more nginx -t and I was left with #4. To fix it I modified nginx.conf and uncommented the line containing server_names_hash_bucket_size 64 and canged value 64 to 128. Saved the file and another nginx -t
    Now no more errors were left so I ran
    wo stack restart


    When I browsed my sites I found that some were still not available; So I ran following command for each site that I wanted to run with new php 7.3:
    wo site update domaintomigratetonewphp --php73
    and for those I wanted to run with php 7.2, I additionally added
    wo site update domaintomigratetonewphp --php72


    I saw that for one site (a non WP site) the combination of the two commands (followed by one another), it caused the script to merely backup the site, but left main htdocs direectory empty; thus the site wasn't available. I manually moved the backuped files back in main htdocs directory. After that, also this site ran fine with php 7.2 - as expected.

I also checked letsencrypt, by running follownig command to update a site, I had set up with ee and failed le cert issuance a few hours earlier.
wo site update sitesetupwitheeandfailedLE-cert.com --php73 --letsencrypt
Worked like a charm. LE cert was issued perfectly fine and site is set to php 7.3 as well.

So far I am happy, although it was quite a shock when nothing worked and I saw database connections could not be established errors...

Thanks to the WO team! Great job!


5 days later

I have around 100 servers to migrate from EEv3 to WO. There is no chance that I try an upgrade, for sure I'll launch new servers and migrate the domains. 🙂

Thanks, @slitweb, for sharing your solutions.

Hosted by VirtuBox