PDA

View Full Version : trunk, r7707: sqlite db does not work


richlv
29-07-2009, 12:07
attempting to use zabbix_proxy with sqlite database fails. logfile lists many warning regarding transactions like :

Query without transaction detected [BEGIN TRANSACTION;CREATE TABLE IF NOT EXISTS...
Query without transaction detected [PRAGMA synchronous = 0]
Query without transaction detected [PRAGMA temp_store = 2]

it sort of creates the database, but then dies with :
[Z3005] Query failed: [0] no such table: ids [select nextid from ids where table_name='proxy_history' and field_name='history_lastid']

richlv
29-07-2009, 12:12
additional information :
sqlite 3.2.8;

and it looks actually tables were not created :

$ sqlite3 zabbix_proxy.db
SQLite version 3.2.8
Enter ".help" for instructions
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main /tmp/zabbix_proxy.db
sqlite> .tables
sqlite>

richlv
29-07-2009, 12:46
attempting to create table manually from the logged query :
CREATE TABLE IF NOT EXISTS slideshows ( slideshowid bigint DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, delay integer DEFAULT '0' NOT NULL, PRIMARY KEY (slideshowid));
SQL error: near "NOT": syntax error

richlv
31-07-2009, 14:31
...and, for the record, proxy works just fine if tables are created manually with the same queries, only removing "IF NOT EXISTS" parts

NOB
07-08-2009, 11:20
additional information :
sqlite 3.2.8;

and it looks actually tables were not created :

$ sqlite3 zabbix_proxy.db
SQLite version 3.2.8
Enter ".help" for instructions
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main /tmp/zabbix_proxy.db
sqlite> .tables
sqlite>

Hi

we faced the same problem with "IF NOT EXISTS" and SQLite version 3.2.8 and
used the same work-around like you did.
Are you by chance using Solaris und the Blastwave packages like we did ?
If you read the ZABBIX manual it says: SQLite3 supported starting with version 3.3.5 !

Did you do tests with later versions ?

We didn't do it, yet.

Regards

Norbert.

richlv
07-08-2009, 11:47
heh, i guess i should read manual more =)
but it also fails for me with sqlite 3.6.14.2 :
[Z3001] Connection to database '/tmp/zabbix_proxy.db' failed: [1045] Access denied for user 'root'@'localhost' (using password: NO)

edit : nope, using slackware/sles here, distro provided sqlite packages, self compiled zabbix

richlv
07-08-2009, 12:33
well, duh. that message was quite misleading. turns out, i had proxy compiled with mysql support.
compiling it with sqlite support - and now it seems to work as advertised.
sorry for the noise :>