PacketFence - BTS - PacketFence
View Issue Details
0001040PacketFenceweb adminpublic2010-07-28 00:132011-05-04 11:51
DanCreed 
obilodeau 
normalminoralways
closedno change required 
1.9.0 
 
0001040: PHP errors when clicking on NODE
Error: Problems executing 'PFCMD node view all order by mac asc limit 0,25'

    /usr/local/pf/bin/pfcmd line 2004 (0000001) Can't use string ("0") as a HASH ref while "strict refs" in use at /usr/local/pf/bin/pfcmd line 2004. at /usr/local/pf/bin/pfcmd line 2004 main::print_results('node_view_all', 'all', 'orderby', 'order by mac asc', 'limit', 'limit 0,25') called at /usr/local/pf/bin/pfcmd line 1872 main::command_param('node') called at /usr/local/pf/bin/pfcmd line 173 main::__ANON__() called at /usr/local/pf/bin/pfcmd line 203
I'm running packetfence on CentOS 5.5 and using the repositories listed in the documentation.

Thanks,
Dan
No tags attached.
Issue History
2010-07-28 00:13DanCreedNew Issue
2010-07-28 10:42obilodeauNote Added: 0001616
2010-07-28 12:05DanCreedNote Added: 0001617
2010-07-28 12:23obilodeauNote Added: 0001618
2010-07-28 14:05DanCreedNote Added: 0001619
2010-07-28 14:44obilodeauNote Added: 0001620
2010-07-28 14:50obilodeauSeveritymajor => minor
2010-07-28 15:48DanCreedNote Added: 0001621
2010-07-28 16:00obilodeauNote Added: 0001622
2010-08-08 23:59obilodeauStatusnew => assigned
2010-08-08 23:59obilodeauAssigned To => obilodeau
2010-08-09 00:01obilodeauNote Added: 0001627
2010-08-09 00:01obilodeauStatusassigned => feedback
2010-09-08 14:12obilodeauNote Added: 0001643
2010-09-08 14:12obilodeauStatusfeedback => resolved
2010-09-08 14:12obilodeauResolutionopen => no change required
2011-05-04 11:51obilodeauStatusresolved => closed

Notes
(0001616)
obilodeau   
2010-07-28 10:42   
Did you upgrade recently? If so have you looked at the UPGRADE document for upgrade instructions?

If not upgrading, can you restart packetfence, reproduce the error and send me the last 25 lines of logs/packetfence.log and logs/admin_debug_log.

Thanks
(0001617)
DanCreed   
2010-07-28 12:05   
I found the issue.. it's when the RPM upgrades it something doesn't go right... when doing the RPM upgrade (via YUM) I had to drop the database and run installer.pl again... I am seeing on startup some database issues barking about whitelisted something or other not being a valid collum however..

Thanks,
Dan
(0001618)
obilodeau   
2010-07-28 12:23   
RPM upgrade will _never_ upgrade your database schema. UPGRADE provides instructions about it.

If you check in UPGRADE for 1.9.0:

    - Database change
    A new table and a few fields were added for the new node categorization
    feature. To upgrade your schema, run:
    mysql -u root -p pf -v < db/upgrade-1.8.6-1.9.0.sql

No need to drop your database, just upgrade it.

Now, you're saying you are still experiencing issues, can you give me the output of: ls -l /usr/local/pf/db/

thanks
(0001619)
DanCreed   
2010-07-28 14:05   
I get a bunch of these on startup

Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) ERROR: Database issue: We tried 3 times to serve query trigger_exist_sql called from pf::trigger::trigger_exist and we failed. Is the database running? (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) WARN: database query failed with: Unknown column 'whitelisted_categories' in 'field list'. (errno: 1054), will try again (pf::db::db_query_execute)
Jul 27 23:11:13 pfcmd(0) ERROR: Database issue: We tried 3 times to serve query trigger_add_sql called from pf::trigger::trigger_add and we failed. Is the database running? (pf::db::db_query_execute)


here is the ls -l

[root@quigonn bind-9.7.1-P2]# ls -l /usr/local/pf/db
total 140
lrwxrwxrwx 1 pf pf 18 Jul 16 23:48 pfschema.mysql -> pfschema.mysql.190
-rw-r--r-- 1 pf pf 2884 Jul 15 12:15 pfschema.mysql.144
-rw-r--r-- 1 pf pf 3349 Jul 15 12:15 pfschema.mysql.150
-rw-r--r-- 1 pf pf 4537 Jul 15 12:15 pfschema.mysql.160
-rw-r--r-- 1 pf pf 6344 Jul 15 12:15 pfschema.mysql.170
-rw-r--r-- 1 pf pf 6049 Jul 15 12:15 pfschema.mysql.171
-rw-r--r-- 1 pf pf 6067 Jul 15 12:15 pfschema.mysql.174
-rw-r--r-- 1 pf pf 6375 Jul 15 12:15 pfschema.mysql.180
-rw-r--r-- 1 pf pf 6544 Jul 15 12:15 pfschema.mysql.181
-rw-r--r-- 1 pf pf 6781 Jul 15 12:15 pfschema.mysql.183
-rw-r--r-- 1 pf pf 7925 Jul 15 12:15 pfschema.mysql.184
-rw-r--r-- 1 pf pf 8290 Jul 15 12:15 pfschema.mysql.186
-rw-r--r-- 1 pf pf 8944 Jul 15 12:15 pfschema.mysql.190
-rw-r--r-- 1 pf pf 1495 Jul 15 12:15 upgrade-1.4.4p1-1.5.0.sql
-rw-r--r-- 1 pf pf 1642 Jul 15 12:15 upgrade-1.5.0-1.6.0.sql
-rw-r--r-- 1 pf pf 1832 Jul 15 12:15 upgrade-1.6.0-1.7.0.sql
-rw-r--r-- 1 pf pf 1017 Jul 15 12:15 upgrade-1.7.0-1.7.1.sql
-rw-r--r-- 1 pf pf 154 Jul 15 12:15 upgrade-1.7.1-1.7.4.sql
-rw-r--r-- 1 pf pf 381 Jul 15 12:15 upgrade-1.7.4-1.8.0.sql
-rw-r--r-- 1 pf pf 170 Jul 15 12:15 upgrade-1.8.0-1.8.1.sql
-rw-r--r-- 1 pf pf 368 Jul 15 12:15 upgrade-1.8.1-1.8.3.sql
-rw-r--r-- 1 pf pf 1230 Jul 15 12:15 upgrade-1.8.3-1.8.4.sql
-rw-r--r-- 1 pf pf 422 Jul 15 12:15 upgrade-1.8.4-1.8.6.sql
-rw-r--r-- 1 pf pf 898 Jul 15 12:15 upgrade-1.8.6-1.9.0.sql
(0001620)
obilodeau   
2010-07-28 14:44   
Check your database schema. It probably has not been upgraded to 1.9.0.

Do you have whitelisted_categories in the `trigger` table?

mysql> explain `trigger` 
    -> ;
+------------------------+--------------+------+-----+---------+-------+
| Field                  | Type         | Null | Key | Default | Extra |
+------------------------+--------------+------+-----+---------+-------+
| vid                    | int(11)      | NO   | PRI | 0       |       | 
| tid_start              | int(11)      | NO   | PRI | NULL    |       | 
| tid_end                | int(11)      | NO   | PRI | NULL    |       | 
| type                   | varchar(255) | NO   | PRI |         |       | 
| whitelisted_categories | varchar(255) | NO   |     |         |       | 
+------------------------+--------------+------+-----+---------+-------+
5 rows in set (0.05 sec)


If not and you don't mind starting the database over, drop your pf database and re-create it by using msyql... < db/pfschema.mysql
Otherwise if you are _sure_ that your schema is at version 1.8.6 or 1.8.7 you can upgrade with the instructions provided in UPGRADE.
(0001621)
DanCreed   
2010-07-28 15:48   
mysql> explain `trigger`;
+------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+--------------+------+-----+---------+-------+
| vid | int(11) | NO | PRI | 0 | |
| tid_start | int(11) | NO | PRI | NULL | |
| tid_end | int(11) | NO | PRI | NULL | |
| type | varchar(255) | NO | PRI | | |
| whitelisted_categories | varchar(255) | NO | | | |
+------------------------+--------------+------+-----+---------+-------+

Thats not the problem?? While I've got your attention another quick question as well.. I've got VOIP VLAN 100 setup in my switches and in the config files but when I plug a VOIP phone in, it detects that it's a VOIP device but still puts it in VLAN 1 instead of 100... Maybe you can e-mail me and we can take that discussion off-line as it's not related to this issue.

Thanks,
Dan
(0001622)
obilodeau   
2010-07-28 16:00   
Do you have a whitelisted_categories= under [defaults] in your violations.conf? Sorry I haven't thought about that earlier.

A blank statement should do it:
whitelisted_categories=

As for your other question, we don't give private support for free. Be ready to discuss it publicly or consider paying for support. Free support option: join the -users mailing list and ask your question or file another issue.
https://lists.sourceforge.net/lists/listinfo/packetfence-users [^]
(0001627)
obilodeau   
2010-08-09 00:01   
Did the help I provided fixed your issue?
(0001643)
obilodeau   
2010-09-08 14:12   
Re-open if problem still persists.