Plesk login page shows: No connection could be made because the target machine actively refused it

Created:

2016-11-16 12:43:38 UTC

Modified:

2017-04-24 11:03:05 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk login page shows: No connection could be made because the target machine actively refused it

Applicable to:

  • Plesk for Windows
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 10.x and below for Windows

Symptoms

  1. Plesk login page is showing an error:

    ERROR: PleskMainDBException
    No connection could be made because the target machine actively refused it.

    0: common_func.php3:637
    reconnect()
    1: common_func.php3:600
    db_connect()
    2: auth.php3:134
  2. The following error appears:

    [panel]: Error during product key mode determination, details: No connection could be made because the target machine actively refused it. ; 
    trace:
    #0 C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\db.php(411): reconnect()
    #1 C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\functions.php(2791): db_connect()
    #2 C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\functions.php(2808): isPpaKeyRequired()
    #3 C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\common_func.php3(7): require_once('C:\\Program File...')
    #4 C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\auth.php(93): require_once('C:\\Program File...')
    #5 {main} ERR (3) [panel]: Unable to get key: error:
    C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\repository\\lock\\repository: cannot create: Permission denied PHP Warning: mysqli::close():
    Couldn't fetch mysqli in C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\db.php on line 491 ERR (3) [panel]: No connection could be made because the target machine actively refused it. :
    0: db.php:451 reconnect()
    1: db.php:411 db_connect()
    2: auth.php:140 PleskMainDBException: No connection could be made because the target machine actively refused it. file: C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\plib\\db.php line: 451 code:

Cause

  • The Plesk MySQL server is stopped
  • MySQL databases are corrupted
  • Incorrect permissions on some Plesk directories (Read-only attribute)
  • Incorrect parameters in configuration file

Resolution

  1. Fix incorrect Plesk SQL Server service configuration or state.

    1.1. Restart Plesk SQL Server service.

    1.2. Make sure that my.ini exists in " %plesk_dir%\\MySQL\\Data\\ " and that basedir and datadir parameters have the correct values:

    C:\\>findstr dir "%plesk_dir%\\Mysql\\Data\\my.ini"
    basedir=C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\MySQL
    datadir=C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\MySQL\\\\Data
    tmpdir=C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\MySQL\\\\Data

    1.2. Ensure that all options and extensions specified in my.ini are valid.

  2. If MySQL goes down, again, with error 1067 "The process terminated unexpectedly":

    Check the MySQL error logs in %plesk_dir%\\MySQL\\Data\\<computer_name>.err :

    2.1. If the following error occurs:

    130904 20:23:16  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite

    This may mean that PSA or another database is broken, or there is inconsistent information in one of the databases. Please see the following articles:

    #213914385 MySQL service fails to start: Can't open and lock privilege tables: Incorrect file format 'host' #213902465 Plesk is not available: Got error -1 from storage engine

    2.2. The other possible errors in the MySQL error log file:

    Version: '5.5.31'  socket: ''  port: 8306  MySQL Community Server (GPL)
    1 1 1 IInnoDB: We intentionally generate a memory trap.
    InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
    InnoDB: If you get repeated assertion failures or crashes, even
    InnoDB: immediately after the mysqld startup, there may be
    InnoDB: corruption in the InnoDB tablespace. Please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
    InnoDB: about forcing recovery.

    Sometimes, it does not mean the database has been corrupted. Make sure that the files in %plesk_dir%\\MySQL\\Data\\ do not have "Read-only" attribute (sub-directories can have this attribute).

    If the files are read-only, it is needed to to right-click on %plesk_dir%\\Plesk\\MySQL\\Data , go to Properties , un-check "Read-only" attribute and click OK. Then, try to start "Plesk SQL Server" service again.

    2.3 Check Event Viewer logs for errors in Application logs section.

    2.4. In case of the following error, change the innodb_log_file_size value in %plesk_dir%\\MySQL\\Data\\my.ini according to the error. In this case, it is needed to specify the file size as 10M

    InnoDB: Error: log file .\\ib_logfile0 is of different size 0 10485760 bytes
    InnoDB: than specified in the .cnf file 0 5242880 bytes!
  3. If Plesk shows an error as above in Case 2 :

    This means incorrect file permissions on some files are set in %plesk_dir%\\admin . It is possible to restore the default permissions using the Plesk Reconfigurator .

    • Run the Plesk Reconfigurator as administrator: %plesk_bin%\\reconfigurator.exe
    • Check component and folder permissions > Browse , select C:\\Program Files (x86)\\Parallels\\Plesk\\admin and press Check

Have more questions? Submit a request
Please sign in to leave a comment.