Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install: Error Loading database schema #205

Open
tanimientras opened this issue Oct 28, 2022 · 9 comments
Open

Fresh install: Error Loading database schema #205

tanimientras opened this issue Oct 28, 2022 · 9 comments

Comments

@tanimientras
Copy link

tanimientras commented Oct 28, 2022

Fresh install on a clean machine (db is on another host) fails:

env \
 DBHOST='********' \
 DBNAME='pandora' \
 DBUSER='root' \
 DBPASS='********' \
 DBROOTPASS='********' \
 DBPORT='3306' \
 SKIP_PRECHECK=1 \
 SKIP_DATABASE_INSTALL=1 \
 sh -c "$(curl -fsSL https://raw.githubusercontent.com/pandorafms/pandorafms/develop/extras/deploy-scripts/pandora_deploy_community.sh)"

Database installed in Ubuntu host.

mysql --version
mysql Ver 8.0.31-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Installer output:

...
Downloading Pandora FMS Server community... OK
Downloading Pandora FMS Console community... OK
Downloading Pandora FMS Agent community... OK
installing PandoraFMS packages... OK
Dowloading gotty util... OK
Installing gotty util... OK
Enabling Database service... OK
Enabling HTTPD service... OK
Loading pandoradb.sql to pandora database...Fail
Error Loading database schema
Error installing Pandora FMS for detailed error please check log: /tmp/pandora-deploy-community-2022-10-28.log

Installer log:

CentOS Linux release 7.9.2009 (Core)
CentOS Linux 7 (Core)
'Starting community deployment' > /tmp/pandora-deploy-community-2022-10-28.log
Community installer version: 2022050901
...
...
...
2022-10-28 08:38:46 (9,36 MB/s) - “gotty_linux_amd64.tar.gz” guardado [2950953/2950953]
./gotty
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
ERROR 1101 (42000) at line 2588: BLOB, TEXT, GEOMETRY or JSON column 'name' can't have a default value

Messing around with the web installer, it complains:

BLOB, TEXT, GEOMETRY or JSON column 'name' can't have a default value
CREATE TABLE IF NOT EXISTS `tdashboard` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` TEXT NOT NULL DEFAULT '',
  `id_user` VARCHAR(255) NOT NULL DEFAULT '',
  `id_group` INT NOT NULL DEFAULT 0,
  `active` TINYINT NOT NULL DEFAULT 0,
  `cells` INT UNSIGNED DEFAULT 0,
  `cells_slideshow` TINYINT NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
<br></i>Table 'pandora.tmodule_inventory' doesn't exist<i><br>--
--
INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`,
 `description`, `interpreter`, `data_format`, `code`, `block_mode`) 
VALUES 
(1,1,'CPU','CPU','/usr/bin/perl','Model;Company;Speed','IyEvdXNyL...AwOw0K',0);

If there's something more I can provide, please let me know.

@JoseMartinPFMS
Copy link
Contributor

Hello.

Pandora database scheme seems to be missing or failing. Have you made sure it is correctly configured?
Please, take a look on these pandora wiki pages if you haven't before:

If problems with the database persist, try installing Pandora with a local database and configure the external one later, as a workaround.

@tanimientras
Copy link
Author

Pandora database scheme seems to be missing or failing. Have you made sure it is correctly configured?
It's a clean install, the issue might be on the .sql file being imported.

Actually seems there's a DEFAULT '' on a TEXT field, which is unsupported by MySQL [1]

If problems with the database persist, try installing Pandora with a local database and configure the external one later, as a workaround.

Going to try...

[1] https://stackoverflow.com/questions/3466872/why-cant-a-text-column-have-a-default-value-in-mysql

@tanimientras
Copy link
Author

Default install went OK. How/Where's the config to change database?

@fbsanchez
Copy link
Member

sql-mode=""

@tanimientras
Copy link
Author

tanimientras commented Oct 28, 2022

sql-mode=""

That would be a workaround. They should fix the SQL statements instead.

How/Where's the config to change database in pandoraFMS?

@fbsanchez
Copy link
Member

fbsanchez commented Oct 28, 2022

sql-mode=""

That would be a workaround. They should fix the SQL statements instead.

How/Where's the config to change database?

you're right they should, but I'm not sure if they are working on it... meanwhile there's the disable sql-mode trick...

check https://raazkumar.com/tutorials/mysql/mysql-configuration-file/

if working with containers you can set it explicitely

https://stackoverflow.com/questions/48924667/changing-sql-mode-on-mariadb-image-with-docker-compose

@tanimientras
Copy link
Author

Thanks. Updated my previous comment, 'cause it was misleading.

How/Where's the config to change database in pandoraFMS?

@tanimientras
Copy link
Author

tanimientras commented Nov 3, 2022

@tanimientras seems the same problem as the rocky installation, are you using an external database?

Im using a fresh machine running a clean install of mysql
mysql Ver 8.0.31-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Is this database optimized for pandorafms? Could you try to deploy on a local database (default one) to check it?

a local one seems to work, but then I cannot find an option in pandorafms to change database (it's an enterprise-only feature?)

@Tatsibayashi
Copy link

I can't install sql because it doesn't click next on the final account path it doesn't accept any file to install please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants