PHP Warning: 7 is not a valid MySQL-Link resource

Discussion in 'Installation/Configuration' started by flyguy, Mar 14, 2012.

  1. flyguy

    flyguy New Member

    OK, I've been through all the related threads I could find. The problem is that the cron list of ISPConfig does not get executed.

    My error response when executing

    /usr/local/ispconfig/server/server.sh

    is littered with

    PHP Warning: mysql_real_escape_string(): 7 is not a valid MySQL-Link resource in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 184
    PHP Warning: mysql_select_db(): 7 is not a valid MySQL-Link resource in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 104

    errors. I' ve checked the mysql access using

    mysql -h localhost -u root dbispconfig -p

    with the user(root) and password as stored in

    /usr/local/ispconfig/server/lib/config.inc.php
    /usr/local/ispconfig/server/lib/mysql_clientdb.conf

    Ive done

    cd /tmp
    wget http://www.ispconfig.org/downloads/I...-stable.tar.gz
    tar xvfz ISPConfig-3-stable.tar.gz
    cd ispconfig3_install/install
    php -q update.php

    The /var/log/mysql.err and /var/mysql.log files are empty. I've had to disable the /usr/local/ispconfig/server/server.sh entry in crontab just to keep my sever from misbehaving.

    I have
    IServer: 109.74.195.109 (Debian Squeeze/Sid)
    ISPConfig 3.0.4.3

    Everything worked fine up to the point where I did general system upgrade. My /etc/hosts file looks like this:

    127.0.0.1 localhost localhost.localdomain
    109.74.195.109 www.subxplore.co.za

    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    Anything that I can do next to solve this problem?
     
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    The file /usr/local/ispconfig/server/lib/config.inc.php may not contain the mysql root user or password. If it conatisn the user root on your setup, then you have a installtion error. The mysql user used by ispconfig to connect with the database is always named "ispconfig". The file mysql_cientdb.conf contains the root user which is only used to create new mysql databases.

    The error can also be caused by wrong settings in the mysql my.cnf file e.g. when you set timeout values too low.
     
  3. flyguy

    flyguy New Member

    Thanks till , good to know what is happening behind the scenes. :)

    I changed the root users to ispconfigs, and experimented a bit. The mails get delivered, and adding websites and databases works. BUT the cron list is not deleted, which causes all the actions to be repeated whenever /usr/local/ispconfig/server/server.sh is executed.

    Is there any way to remove the tasks from the cronlist?
     
  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    You mean sys_datalog? Records in that table have to be kept for 30 days and get removed after that time automatically, do nott delete any records in the database manually or the systemwill fail.

    The dont have to be removed. If they get executed again then the permissions of your database sers are still wrong as a repeated execution indicates that the permissions of the ispconfig mysql user or on multiserver systems the ispcsrv users in the main database are wrong.

    Your sytem seams to be really messed up as someone must have altered a lot of ispconfig files manually and entered wrong users there or changed permissions in mysql. You should consider to run a ispconfig update and let the ispconfig updater on all servers that belong to the cluster and let the ispconfig updater reconfigure the permissions in the mysql database.
     
  5. flyguy

    flyguy New Member

    No, I mean the ISPconfig jobqueue under the monitor tab. Wrong wording, sorry.
     
  6. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Login to ispconfig, go to monitor > System state > system log and select loglevel error. If there are any errors listed, delete them by clicking on the delete icon.
     
  7. flyguy

    flyguy New Member

    No errors listed.

    The Monitor-> Show services shows something interesting :
    Web-Server: Offline
    FTP-Server: Online
    SMTP-Server: Online
    POP3-Server: Online
    IMAP-Server: Online
    mySQL-Server: Online

    but my apache server is running. And all the sites are served. The System -.> system services list the web server as activated. Why would it report here as not running?
     
  8. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Then you might want to debug the server process and post the output:

    http://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/

    Check that the apache server listens to IP 127.0.0.1 too. Or your mysql permissions are wrong as I explained in the posts above so that the ispconfig server scrippt can not update the server status anymore.
     
  9. flyguy

    flyguy New Member

Share This Page