doc/auth-server/commonErrors

Common error messages displayed on the auth server


execSql() : An error occured while executing the following SQL query :
SELECT node_id, last_heartbeat_ip from nodes WHERE last_heartbeat_ip='1.2.3.4' ORDER BY last_heartbeat_timestamp DESC

Error message :
ERROR: relation "nodes" does not exist

execSqlUniqueRes() : An error occured while executing the following SQL query :
SELECT network_id FROM networks WHERE is_default_network=TRUE ORDER BY creation_date LIMIT 1

Error message :
ERROR: relation "networks" does not exist
: Network::getDefaultNetwork: Fatal error: Unable to find the default network! in /var/www/wifidog-auth/wifidog/classes/Network.php on line 101

The DB connection on Postgresql is working and the database wifidog exists, but the initial SQL structure and data are missing.


: Unable to connect to database on localhost in /usr/local/apache2/htdocs/wifidog-auth/wifidog/classes/AbstractDbPostgres.php on line 71
  • The database wifidog was not created in Postgresql :
  • The connection to the database Postgresql is not working : Wrong configuration or permissions setting.

install.php can help you resolve this issue and give you more informations about it.


Le systeme tente de mettre a jour le schema de la base de donnees.
Preparing SQL statements to update schema to version 34

execSqlUpdate(): SQL Query :

BEGIN;


UPDATE schema_info SET value='34' WHERE tag='schema_version';
ALTER TABLE node_stakeholders DROP CONSTRAINT "$1";
ALTER TABLE node_stakeholders ADD CONSTRAINT nodes_fkey FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE;
COMMIT;
VACUUM ANALYZE;

0 rows affected by the SQL query.
Elapsed time for query execution : 0,847244 second(s)

execSqlUpdate(): 0 rows affected by the SQL query.

Your DB schema was not up to date, wifidog portal detect this issue and update the schema to the lastest available. If you it refresh in your browser, this message should disappear. If you see it again and you did not update the source code the schema update might be broken (ask for help).


Warning in /classes/Locale.php : Unable to setlocale() to en, return value: , current locale: 
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;
LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
Warning in /classes/Locale.php : Unable to setlocale() to en, return value: , current locale: 
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;
LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
Warning in /classes/Locale.php : Unable to setlocale() to en, return value: , current locale: 
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;
LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
Warning in /classes/Locale.php : Unable to setlocale() to en, return value: , current locale: 
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;
LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C

The "locale" always depend on the server configuration. In most Unix/Linux? system, you could use locale -a to list all available locales on the server. Many systems have locales specific for each countries, thus you'll have to change your config.php or local.config.php with the right values. Ex: fr_CA or fr_FR instead of just fr or change en to en_US or en_GB.

An option on some systems (FC3) is to create a symbolic link in /usr/lib/locale to create the proper file entry eg = ln -s /usr/lib/locale/en_US en


Runtime Notice: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /home/uinn/web/wifidog/include/common.php on line 137

I've found the best solution is to just make sure you have defined "date.timezone = whatever" in your php.ini file, timezones listed here:  http://us3.php.net/manual/en/timezones.php

Note: This notice message has been fixed in WiFiDog as of January 25th. The notice message is being displayed when running PHP 5.1.0+ due to rewritten date functions of PHP. There is a new config flag in config.php named DATE_TIMEZONE. Set it to your local timezone. Don't forget to update your local.config.php in case you're using it.


HTML pages contain strange characters ....

Modify your Apache Server configuration file (httpd.conf) and replace "AddDefaultCharset? on" whith "AddDefaultCharset? utf-8".


Errors running the install.php script. (This follows the "Database access configuration" page)

With error logging turned off, you'll get a blank page... and the install script simply "hangs." (The next steps help confirm that this is the "right" solution.)

If you turn on error logging by:

here's how to turn on php error message display so you can debug problem.

In php.ini (in FC5 most likely located at /etc/php.ini) enable the

error_reporting = E_ALL 
display_errors = On

This will display any error encounter in you browser window. 

Anyway, the error return you get (when you re-run the "install.php" and get to the "hang" screen) will be something like this

Postgresql database connection :
Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user
"wifidog" in /var/www/html/wifidog/install.php on line 1062

The problem is related to PostgreSQL security. One ideally ought to study up on the security system employed by PGSQL, but this will also fix the problem. Be aware that it might create security issues on different systems depending on your database configuration and such. (Again, learning about the security model will help make sure your box stays secure!)

Edit the pg_hba.conf file (On different distro's there may be several versions of this file in different locations. Make sure you edit the correct one!)

#TYPE     DATABASE          USER            IP-ADDRESS             SUBNET MASK               METHOD
host      wifidog           wifidog         192.168.0.11           255.255.255.0             md5

Where the IP address matches the IP address of the machine connecting to the PGSQL server. (127.0.0.1 works if the PGSQL server is on the same box as the web-server that's running WiFiDOG Auth module.)

Restart the PostgreSQL server to load the new settings. (I use /etc/init.d/postgresql restart - though that's probably not the best way - it does work however.)