Join the community today
Register Now

[Solved] wp-cli auto update issues

Discussion in 'Bug Reports' started by iCE, Apr 8, 2020.

  1. iCE

    iCE New Member

    3
    1
    3
    Apr 4, 2020
    Ratings:
    +2
    Local Time:
    12:01 PM
    • CentOS Version: CentOS 7 64bit ?
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.9
    • PHP Version Installed: 7.2.5
    • MariaDB MySQL Version Installed: 10.1.44
    • When was last time updated Centmin Mod code base ? : today
    I do not receive an email from wp-cli automatic update for installing Wordpress, which I did two days ago. Old installations work as expected.

    After running wp_updater script from /root/tools I got an error:

    sendmail: fatal: Recipient addresses must be specified on the command line or via the -t option

    Ok, I added -t switch to sendmail and got another message:

    cat: /home/nginx/domains//log/wp_updater-080420-114334.log: No such file or directory

    It looks like a variable substitution error in a script template - ${vhostname}.
     
    Last edited: Apr 8, 2020
  2. eva2000

    eva2000 Administrator Staff Member

    45,199
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,928
    Local Time:
    12:01 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    What's contents for your wordpress install's wp updater script at /root/tools/wp_updater_yourdomain.com.sh ? You can mask the real domain name and emails for public posting.
    Code (Text):
    /root/tools/wp_updater_yourdomain.com.sh

    What is output for SSH command below ?
    Code (Text):
    php -i | grep sendmail

    and
    Code (Text):
    cat /etc/centminmod-versionlog | tail -20

    example
    Code (Text):
    php -i | grep sendmail
    sendmail_from => no value => no value
    sendmail_path => /sbin/sendmail -t -i  => /sbin/sendmail -t -i 
    Path to sendmail => /sbin/sendmail -t -i 
    

    Code (Text):
    cat /etc/centminmod-versionlog | tail -20
    123.09beta01.b454 #Mon Mar 16 17:50:49 UTC 2020
    123.09beta01.b454 #Mon Mar 16 17:53:36 UTC 2020
    123.09beta01.b456 #Tue Mar 17 21:11:18 UTC 2020
    123.09beta01.b456 #Tue Mar 17 21:16:29 UTC 2020
    123.09beta01.b459 #Thu Mar 19 14:22:29 UTC 2020
    123.09beta01.b459 #Thu Mar 19 14:24:10 UTC 2020
    123.09beta01.b462 #Sat Mar 21 03:39:53 UTC 2020
    123.09beta01.b463 #Sat Mar 21 09:01:15 UTC 2020
    123.09beta01.b464 #Sat Mar 21 10:32:36 UTC 2020
    123.09beta01.b464 #Sat Mar 21 10:33:31 UTC 2020
    123.09beta01.b469 #Tue Mar 24 14:30:10 UTC 2020
    123.09beta01.b472 #Mon Mar 30 21:45:16 UTC 2020
    123.09beta01.b477 #Wed Apr  1 22:50:06 UTC 2020
    123.09beta01.b477 #Wed Apr  1 22:50:36 UTC 2020
    123.09beta01.b477 #Wed Apr  1 22:57:42 UTC 2020
    123.09beta01.b478 #Wed Apr  1 23:05:27 UTC 2020
    123.09beta01.b478 #Wed Apr  1 23:17:39 UTC 2020
    123.09beta01.b478 #Wed Apr  1 23:20:53 UTC 2020
    123.09beta01.b478 #Wed Apr  1 23:21:54 UTC 2020
    123.09beta01.b480 #Sun Apr  5 04:38:19 UTC 2020
    

    For posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)

    Troubleshooting Centmin Mod Menu Option 22 Wordpress Install Run



    To troubleshoot centmin.sh menu option 22 wordpress installation, you need to check the centmin.sh menu option 22 log located in /root/centminlogs at /root/centminlogs/centminmod_*_wordpress_addvhost.log based log where * is the centminmod version and date timestamp. Edit and mask any actual ftp username/password or wordpress usernames and logins before posting the log contents to Pastebin.com or Gists to share a sanitised version of the contents of the log.

    Example list /root/centminlogs files in date ascending order and grep for wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    

    example output returns log at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    -rw-r--r--  1 root root 2.2M Oct 11 01:40 /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    in SSH use cat to ouput contents of /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log. Clear your SSH client window/buffer so only output is the contents of the file
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    Then copy and paste into Pastebin.com or Gists entry. If your SSH window scroll buffer isn't that large to get the whole contents of the install log, you can download file manually and copy and paste contents. But makes sure it's sanitised version of the contents without revealing sensitive info. For example you can replace domain name of the wordpress site with generic dummy entry = domain.com if you want and mask site/server IP revealed in the log with generic dummy entry = 111.222.333.444.
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,199
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,928
    Local Time:
    12:01 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    looks like a combination of 2 errors - 1 for not escaping sendmail command's $EMAIL variable and 1 error for incorrectly escaping the log file's $vhostname variable.

    For existing users in your /root/tools/wp_updater_yourdomain.sh cron update scripts, find the sendmail line and replace it with the following
    Code (Text):
    sendmail -i $EMAIL <<END
    From: $EMAILFROM
    To: $EMAIL
    Subject: Wordpress WP-CLI Auto Update $(date)
    $(cat /home/nginx/domains/yourdomain.com/log/wp_updater-${DT}.log)
    END
    

    where yourdomain.com is your domain name
    The incorrect one looked like
    Code (Text):
    sendmail -i <<END
    From: $EMAILFROM
    To: $EMAIL
    Subject: Wordpress WP-CLI Auto Update $(date)
    $(cat /home/nginx/domains/${vhostname}/log/wp_updater-${DT}.log)
    END
    

    where sendmail -i line was missing the $EMAIL variable and ${vhostname} variable was incorrectly escaped and should of been replaced with yourdomain.com for wordpress site
     
  4. iCE

    iCE New Member

    3
    1
    3
    Apr 4, 2020
    Ratings:
    +2
    Local Time:
    12:01 PM
    Of course, I have already fixed these lines myself. What needs to be fixed in the templates so that this does not happen when creating new sites with WordPress?
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,199
    10,277
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,928
    Local Time:
    12:01 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x