Description of problem: The set of SQL files for setting up a new Zabbix installation are incomplete (or incorrect) in the zabbix-1.4-2.fc6 package (I would guess that this applies to all zabbix-1.4-2 RPMs - though I have only verified this under FC6). The following files are included in the RPM: [root@quesadilla nst]# ls -l $(rpm -ql zabbix-1.4-2.fc6 | grep '\.sql') -rw-r--r-- 1 root root 40515 May 29 08:53 /usr/share/doc/zabbix-1.4/dbpatches/1.4/mysql/patch.sql -rw-r--r-- 1 root root 37510 May 29 08:53 /usr/share/doc/zabbix-1.4/dbpatches/1.4/postgresql/patch.sql -rw-r--r-- 1 root root 192112 May 29 08:52 /usr/share/zabbix/create/data.sql -rw-r--r-- 1 root root 22568 May 29 08:52 /usr/share/zabbix/create/mysql.sql [root@quesadilla nst]# The following files come in the zabbix-1.4.tar.gz file from SourceForge: [root@quesadilla zabbix-1.4]# ls -l $(find . -name "*.sql") -rw-r--r-- 1 1000 1000 588813 May 29 08:52 ./create/data/data.sql -rw-r--r-- 1 1000 1000 64918 May 29 08:52 ./create/data/images_mysql.sql -rw-r--r-- 1 1000 1000 2516 May 29 08:52 ./create/data/images_oracle.sql -rw-r--r-- 1 1000 1000 114358 May 29 08:52 ./create/data/images_pgsql.sql -rw-r--r-- 1 1000 1000 64918 May 29 08:52 ./create/data/images_sqlite3.sql -rw-r--r-- 1 1000 1000 27597 May 29 08:53 ./create/schema/mysql.sql -rw-r--r-- 1 1000 1000 26660 May 29 08:53 ./create/schema/oracle.sql -rw-r--r-- 1 1000 1000 26156 May 29 08:53 ./create/schema/postgresql.sql -rw-r--r-- 1 1000 1000 25363 May 29 08:53 ./create/schema/sqlite.sql -rw-r--r-- 1 1000 1000 192112 May 29 08:52 ./frontends/php/create/data.sql -rw-r--r-- 1 1000 1000 22568 May 29 08:52 ./frontends/php/create/mysql.sql -rw-r--r-- 1 1000 1000 40515 May 29 08:53 ./upgrades/dbpatches/1.4/mysql/patch.sql -rw-r--r-- 1 1000 1000 0 May 29 08:53 ./upgrades/dbpatches/1.4/oracle/patch.sql -rw-r--r-- 1 1000 1000 37510 May 29 08:53 ./upgrades/dbpatches/1.4/postgresql/patch.sql [root@quesadilla zabbix-1.4]# Version-Release number of selected component (if applicable): 1.4-2.fc6 How reproducible: Always Steps to Reproduce: 1. Bring up mysqld service mysqld start 2. Attempt to follow the MySQL Zabbix Server Installation instructions in the PDF file: /usr/share/doc/zabbix-1.4/ZABBIX\ Manual\ v1.4\ rev\ 7.pdf included in the RPM. [root@quesadilla ~]# echo "create database zabbix;" | mysql [root@quesadilla ~]# cat /usr/share/zabbix/create/mysql.sql | mysql zabbix [root@quesadilla ~]# cat /usr/share/zabbix/create/data.sql | mysql zabbix NOTE: In the above, I changed "schema.sql" to "mysql.sql" (as this looks like what it was renamed to in the RPM). ALSO, the file "images_mysql.sql" was not included in the RPM, but was shown in the PDF installation instructions). ALSO, the "mysql.sql" and "data.sql" files included in the RPM are significantly different in size than the ones found in the current zabbix-1.4.tar.gz file from SourceForge. 3. Edit /etc/zabbix/zabbix_server.conf and set the DBUser variable to root. 4. Start the zabbix server: service zabbix start 5. Review the /var/log/zabbix/zabbix_server.log file, there will be multiple errors about missing fields in tables. Actual results: Expected results: Additional info: To fix the problem: 1. Download the zabbix-1.4.tar.gz source file from http://www.zabbix.com/ 2. Extract the tar file and change to the directory zabbix-1.4 (SQL paths below are shown relative to this directory). 3. Stop the zabbix server service zabbix stop 4. Recreate the database using the SQL files from the zabbix-1.4.tar.gz file [root@quesadilla zabbix-1.4]# echo "drop database zabbix;" | mysql [root@quesadilla zabbix-1.4]# echo "drop database zabbix;" | mysql [root@quesadilla zabbix-1.4]# echo "create database zabbix;" | mysql [root@quesadilla zabbix-1.4]# cat ./create/schema/mysql.sql | mysql zabbix [root@quesadilla zabbix-1.4]# cat ./create/data/data.sql | mysql zabbix [root@quesadilla zabbix-1.4]# cat ./create/data/images_mysql.sql | mysql zabbix [root@quesadilla zabbix-1.4]# 5. Remove old log file and start the Zabbix server rm -f /var/log/zabbix/zabbix_server.log service zabbix start 6. Review new log file (you should see that the Zabbix service came up cleanly) less /var/log/zabbix/zabbix_server.log
Hm... Thanks much for the detailed bug report. I've poked at the spec some, and this appears to be a problem with the upstream Makefile, since I don't do anything special to install the sql files, just a 'make install'. I'll see what I can do to get this fixed shortly.
Created attachment 157856 [details] update for the spec file I have played a lot to find where is the problem. The spec file includes out-dated SQL scripts from the frontend subdir. This patch fixes the issue, but places the SQL files directly into the docdir.
Ideally, I'd like to fix this in the Makefile, but unfortunately, due to lack of time, we'll go with some spec file shuffling, similar to what Dan proposed. I'm taking a slightly different approach though, so as to put all the database files in a sub-directory of the docdir. $ rpm -qpl /data/buildroot/RPMS/x86_64/zabbix-1.4-3.fc7.x86_64.rpm |grep sql /usr/share/doc/zabbix-1.4/dbinit/data/data.sql /usr/share/doc/zabbix-1.4/dbinit/data/images_mysql.sql /usr/share/doc/zabbix-1.4/dbinit/schema/mysql.sql I'll get that checked in and built shortly.
zabbix-1.4-3.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.
Thanks for the fix. Just wanted to let you know that the zabbix-1.4-3.fc6 (which I "yum updated") contained the necessary SQL files to initialize the Zabbix server using a MySQL server as the backend database. Things are working again.