Projet

Général

Profil

Tâche #19350

Scénario #19274: La création des tables MySQL de Bareos ne devrait pas remonter d'erreur

Étude du problème de création de table MySQL pour la base Bareos

Ajouté par Benjamin Bohard il y a environ 7 ans. Mis à jour il y a environ 7 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Début:
21/02/2017
Echéance:
% réalisé:

100%

Temps estimé:
1.00 h
Temps passé:
Restant à faire (heures):
0.0

Description

Les erreurs surviennent lors de la création de deux tables, déclarées dans le fichier /usr/lib/bareos/scripts/ddl/creates/mysql.sql (NDMPLevelMap et NDMPJob Environment)

Historique

#1 Mis à jour par Benjamin Bohard il y a environ 7 ans

  • Temps estimé mis à 1.00 h
  • Restant à faire (heures) mis à 1.0

Première piste, un bug corrigé dans la version de Bareos intégrée : http://bugs.bareos.org/view.php?id=356

#2 Mis à jour par Benjamin Bohard il y a environ 7 ans

  • Statut changé de Nouveau à En cours

#3 Mis à jour par Benjamin Bohard il y a environ 7 ans

  • Assigné à mis à Benjamin Bohard

#4 Mis à jour par Benjamin Bohard il y a environ 7 ans

  • Restant à faire (heures) changé de 1.0 à 0.5

Avec le changement de la longueur des champs FileSystem et EnvName pour les index (passage de 256 à 255) :

run-parts: executing /usr/share/eole/posttemplate/00-bareos instance

## Régénération du catalogue Bareos##
Start Systemd service mysql                                                                                    [  OK  ]
## Réinitialisation des mots de passe Mysql ##
Creating mysql database
mysql: [Warning] Using a password on the command line interface can be insecure.
Creating of bareos database succeeded.
Making mysql tables
mysql: [Warning] Using a password on the command line interface can be insecure.
Creation of Bareos MySQL tables succeeded.
## Réinitialisation des mots de passe Mysql ##
Granting mysql tables
mysql: [Warning] Using a password on the command line interface can be insecure.
Privileges for user bareos granted ON database bareos.
Régénération du catalogue terminée
Suppression des anciens rapports d'état

Les erreurs n’apparaissent plus.

#5 Mis à jour par Benjamin Bohard il y a environ 7 ans

Contexte :
  • bareos-database-mysql en version 14.2.6-3+2
  • mysql-server en version 5.7.17-0ubuntu0.16.04.1

La correction apportée pour la version 13.2 de bareos est toujours en place.

Un autre rapport de bug apparenté (problème évoqué incidemment dans les réponses) : http://bugs.bareos.org/view.php?id=705

#6 Mis à jour par Benjamin Bohard il y a environ 7 ans

Si la méthode de correction implique la modification du script sql à l’installation, voir ce qui peut être fait pour http://bugs.bareos.org/view.php?id=660

Avec le script d’origine, pour la table Device :

| Device | CREATE TABLE `Device` (
  `DeviceId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Name` tinyblob NOT NULL,
  `MediaTypeId` int(10) unsigned DEFAULT '0',
  `StorageId` int(10) unsigned DEFAULT '0',
  `DevMounts` int(10) unsigned DEFAULT '0',
  `DevReadBytes` bigint(20) unsigned DEFAULT '0',
  `DevWriteBytes` bigint(20) unsigned DEFAULT '0',
  `DevReadBytesSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevWriteBytesSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevReadTime` bigint(20) unsigned DEFAULT '0',
  `DevWriteTime` bigint(20) unsigned DEFAULT '0',
  `DevReadTimeSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevWriteTimeSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `CleaningDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `CleaningPeriod` bigint(20) unsigned DEFAULT '0',
  PRIMARY KEY (`DeviceId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |

Avec la déclaration modifiée suivante :

CREATE TABLE Device (
   DeviceId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
   Name TINYBLOB NOT NULL,
   MediaTypeId INTEGER UNSIGNED DEFAULT 0,
   StorageId INTEGER UNSIGNED DEFAULT 0,
   DevMounts INTEGER UNSIGNED DEFAULT 0,
   DevReadBytes BIGINT UNSIGNED DEFAULT 0,
   DevWriteBytes BIGINT UNSIGNED DEFAULT 0,
   DevReadBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
   DevWriteBytesSinceCleaning BIGINT UNSIGNED DEFAULT 0,
   DevReadTime BIGINT UNSIGNED DEFAULT 0,
   DevWriteTime BIGINT UNSIGNED DEFAULT 0,
   DevReadTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
   DevWriteTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0,
   CleaningDate DATETIME DEFAULT 0,
   CleaningPeriod BIGINT UNSIGNED DEFAULT 0,
   PRIMARY KEY(DeviceId),
   FOREIGN KEY (MediaTypeId) REFERENCES MediaType(MediaTypeId),
   FOREIGN KEY (StorageId) REFERENCES Storage(StorageId)
);

| Device | CREATE TABLE `Device` (
  `DeviceId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Name` tinyblob NOT NULL,
  `MediaTypeId` int(10) unsigned DEFAULT '0',
  `StorageId` int(10) unsigned DEFAULT '0',
  `DevMounts` int(10) unsigned DEFAULT '0',
  `DevReadBytes` bigint(20) unsigned DEFAULT '0',
  `DevWriteBytes` bigint(20) unsigned DEFAULT '0',
  `DevReadBytesSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevWriteBytesSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevReadTime` bigint(20) unsigned DEFAULT '0',
  `DevWriteTime` bigint(20) unsigned DEFAULT '0',
  `DevReadTimeSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `DevWriteTimeSinceCleaning` bigint(20) unsigned DEFAULT '0',
  `CleaningDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `CleaningPeriod` bigint(20) unsigned DEFAULT '0',
  PRIMARY KEY (`DeviceId`),
  KEY `MediaTypeId` (`MediaTypeId`),
  KEY `StorageId` (`StorageId`),
  CONSTRAINT `Device_ibfk_1` FOREIGN KEY (`MediaTypeId`) REFERENCES `MediaType` (`MediaTypeId`),
  CONSTRAINT `Device_ibfk_2` FOREIGN KEY
 (`StorageId`) REFERENCES `Storage` (`StorageId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |

#7 Mis à jour par Benjamin Bohard il y a environ 7 ans

  • Statut changé de En cours à Résolu
  • % réalisé changé de 0 à 100
  • Restant à faire (heures) changé de 0.5 à 0.0

#8 Mis à jour par Joël Cuissinat il y a environ 7 ans

  • Statut changé de Résolu à Fermé

Formats disponibles : Atom PDF