Welcome to Centmin Mod Community
Become a Member

[Solved] centmin.sh getting stuck

Discussion in 'Bug Reports' started by th0nkang, Jun 29, 2022.

  1. th0nkang

    th0nkang New Member

    4
    1
    3
    Jun 29, 2022
    Ratings:
    +3
    Local Time:
    2:13 PM
    1.21.1
    10.3.35
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 130.00beta01 from 123.09beta01
    • Nginx Version Installed: 1.21.1
    • PHP Version Installed: 7.4.21
    • MariaDB MySQL Version Installed: 10.3.35
    • When was last time updated Centmin Mod code base ? : recently through cmupdate command
    • Persistent Config:
      Code (Text):
      #cat /etc/centminmod/custom_config.inc
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      NGINX_STAPLE_CACHE_OVERRIDE='y'
      NGINX_STAPLE_CACHE_TTL='86400'
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      AUTOHARDTUNE_NGINXBACKLOG='y'
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      LETSENCRYPT_DETECT='y'
      DUALCERTS='y'
      SELFSIGNEDSSL_ECDSA='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      PHP_PGO_ALWAYS='y'
      PHP_PGO='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      PHPFINFO='y'
      
    centmin.sh getting stuck for so long because waiting response from https://ipinfo.io/org
    Code (Text):
    #bash -x ./centmin.sh
    ...
    + [[ n = [yY] ]]
    + YUMDNFBIN=yum
    + march_hostcheck
    ++ curl -4s https://ipinfo.io/org
    (stuck here)
    

    from manually curl verbose https://ipinfo.io/org appears that my server can't connect to ipinfo.io
    Code (Text):
    #curl -v https://ipinfo.io/org
    * About to connect() to ipinfo.io port 443 (#0)
    *   Trying 34.117.59.81...
    * Connection timed out
    * Failed connect to ipinfo.io:443; Connection timed out
    * Closing connection 0
    curl: (7) Failed connect to ipinfo.io:443; Connection timed out
    

    maybe try to add timeout for curl in the centmin.sh script?
    also is ISP org name is important for centmin.sh script?
    thanks :)

     
  2. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    Thanks for the heads up! Looks like maybe ipinfo.io is blocking your server? The org name gets the IP's ASN number as Centmin Mod can auto configure various settings based on detected web host provider via their ASN number. Will look at this issue.
     
  3. th0nkang

    th0nkang New Member

    4
    1
    3
    Jun 29, 2022
    Ratings:
    +3
    Local Time:
    2:13 PM
    1.21.1
    10.3.35
    I haven't take a deeper look about why ipinfo.io blocking my server because I will move to another server provider in near future, so yeah maybe my server have bad IP/ASN reputation. Also thanks for acknowledging the issue :).
     
  4. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    I just updated 130.00beta01 switching ipinfo.io to own geoip server where possible. So try running cmupdate to update your 130.00beta01 code on your server and then run centmin.sh once and exit to apply any changes. Then see if it fixes the issue.
     
  5. th0nkang

    th0nkang New Member

    4
    1
    3
    Jun 29, 2022
    Ratings:
    +3
    Local Time:
    2:13 PM
    1.21.1
    10.3.35
    thanks for updating the script, the issue is fixed now :).
    here's some debug-menuexit.txt logs from cminfo debug-menuexit
    Code (Text):
    ## debug-menuexit.txt ##
    ...
    2022-06-29 17:58:57 + march_hostcheck
    2022-06-29 17:58:57 ++ jq -r '"\(.data.asn) \(.data.description_short)"'
    2022-06-29 17:58:57 ++ curl -4s --max-time 5 --connect-timeout 5 https://geoip.centminmod.com/v3
    2022-06-29 17:58:57 + VPS_ASNCHECK='12345 ASN Name Here.'
    ...
    2022-06-29 17:58:58 ++ jq -r .ip
    2022-06-29 17:58:58 ++ curl -4s --max-time 5 --connect-timeout 5 https://geoip.centminmod.com/v3
    2022-06-29 17:58:59 + CNIP=123.123.123.123
    ...
     
  6. happyhacking

    happyhacking Premium Member Premium Member

    86
    15
    8
    Apr 23, 2021
    Ratings:
    +50
    Local Time:
    1:13 AM
    1.22.0
    MariadDB 10.4.25
    I got the following error after latest cmupdate:
    Code (Text):
    /usr/local/src/centminmod ~
    
    jq: error (at <stdin>:1): Cannot index number with string "ip"
    parse error: Invalid numeric literal at line 1, column 14
    --------------------------------------------------------
         Centmin Mod Menu 124.00stable centminmod.com     
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB MySQL Upgrade & Management
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: zstd,pigz,pbzip2,lbzip2
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Data Transfer (TBA)
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 24
    --------------------------------------------------------
    

    This is the debugged error:
    Code (Text):
    ++ jq -r .ip
    jq: error (at <stdin>:1): Cannot index number with string "ip"
    parse error: Invalid numeric literal at line 1, column 14
    + CNIP=
    
     
  7. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    Yeah seems intermittent. Does it happen everytime or only sometimes?
     
  8. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    @happyhacking you can also try running cmupdate and then this debug command to see what is output - you can mask the actual IP listed but confirm if it is indeed a valid IP for your server
    Code (Text):
    echo 24 | bash -x centmin 2>&1 | grep -C2 'jq '
     
  9. Mastergumble

    Mastergumble Member

    41
    8
    8
    Sep 29, 2016
    Ratings:
    +17
    Local Time:
    7:13 AM
    1.11.x
    10.x
    Same here, seems to be happening all the time, the IP is correct.

    Code:
    [13:53][root@xxx.xxx.xx ~]# echo 24 | bash -x centmin 2>&1 | grep -C2 'jq '
    ++ VPS_VIRTWHAT=d
    +++ curl -4s --max-time 5 --connect-timeout 5 -A 'curl/7.29.0 VPSCHECK 124.00stable.s35 12 Intel Xeon E-2236 @3.40GHz 2532 d' https://geoip.centminmod.com/v3
    +++ jq -r
    ++ VPS_GEOIPCHECK='{
      "ip": "xxx.xxx.xxx.xxx",
    --
      }
    }'
    +++ jq -r '"\(.data.asn) \(.data.description_short)"'
    ++ VPS_ASNCHECK='16276 OVH SAS'
    +++ echo '16276 OVH SAS'
    --
    ++ '[' '' ']'
    +++ echo '16276 OVH SAS'
    +++ jq -r .ip
    jq: error (at <stdin>:1): Cannot index number with string "ip"
    parse error: Invalid numeric literal at line 1, column 10
     
  10. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    a
    ah it's a 124.00stable bug only, 130.00beta01 is ok, hence why I didn't see it. Folks make sure to report your Centmin Mod version with your bugs ;)

    124.00stable update fix coming in ~5 mins :)
     
  11. Mastergumble

    Mastergumble Member

    41
    8
    8
    Sep 29, 2016
    Ratings:
    +17
    Local Time:
    7:13 AM
    1.11.x
    10.x
    Doh!
     
  12. savvasha

    savvasha New Member

    18
    4
    3
    Nov 30, 2018
    Ratings:
    +7
    Local Time:
    9:13 AM
    Nginx 1.15.x
    MariaDB 10.1.x
    Hi there @eva2000 ,
    I am running up to date 124.00stable but I am still receiving this error every time I run centmin command:
    Code:
    [07:39][xxx@xxxx.com ~]# echo 24 | bash -x centmin 2>&1 | grep -C2 'jq '
    ++ VPS_VIRTWHAT=kvm
    +++ curl -4s --max-time 5 --connect-timeout 5 -A 'curl/7.29.0 VPSCHECK 124.00stable.s36 2 DO-Premium-Intel 2494 kvm' https://geoip.centminmod.com/v3
    +++ jq -r
    parse error: Invalid numeric literal at line 1, column 10
    ++ VPS_GEOIPCHECK=
    +++ echo ''
    +++ jq -r '"\(.data.asn) \(.data.description_short)"'
    ++ VPS_ASNCHECK=
    +++ echo ''
    --
    ++ '[' '' ']'
    +++ echo ''
    +++ jq -r .ip
    ++ CNIP=
    +++ LC_ALL=C
    Thanks,
    Savvas
     
  13. happyhacking

    happyhacking Premium Member Premium Member

    86
    15
    8
    Apr 23, 2021
    Ratings:
    +50
    Local Time:
    1:13 AM
    1.22.0
    MariadDB 10.4.25
    latest update fixed it ! please do cmupdate again.
     
  14. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
    Looks like you're running latest 124.00stable.s36 build but your error is in a different place to the latest fix. It's because VPS_GEOIPCHECK= variable is returning an empty response so there's no value to evaluate for the ASN check for VPS_ASNCHECK variable.

    I can see from my logs from geoip server, I see it recording the request but seems all the requests are coming back with internal 500 status errors. Only like 6 errors of which 5 are for your server's requests it seems.
     
  15. eva2000

    eva2000 Administrator Staff Member

    49,578
    11,376
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,679
    Local Time:
    5:13 PM
    Nginx 1.21.x
    MariaDB 10.x
  16. savvasha

    savvasha New Member

    18
    4
    3
    Nov 30, 2018
    Ratings:
    +7
    Local Time:
    9:13 AM
    Nginx 1.15.x
    MariaDB 10.1.x
    Thanks @eva2000 for the quick fix. You are amazing!!