Cannot migrate to external database. cannot locate jar driver

Hi,

I am building an new TeamCity7.1 server on Ubuntu 64-bit.

I am using java-6-openjdk and postgresql9.1 database.

The database contains tables too.

I set up an external database and trying to migrate to external database postgres. I followed the steps on http://confluence.jetbrains.com/display/TCD7/Setting+up+an+External+Database +  http://confluence.jetbrains.com/display/TCD7/Migrating+to+an+External+Database?pageVersion=7.


I downloaded the PostgreSQL JDBC driver postgresql-9.1-902.jdbc4.jar and place in /.BuildServer/lib/jdbc/ as mentioned.

However, when I run my maintainDB.sh command, I get the following:



Using source database
 database type: POSTGRESQL
 database driver: <not specified>
 connection: jdbc:postgresql://localhost:5432/build
 login as: build
java.util.zip.ZipException: invalid END header (bad central directory offset)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(ZipFile.java:131)
 at jetbrains.buildServer.util.zip.FileZipReader.<init>(FileZipReader.java:23)
 at jetbrains.buildServer.util.zip.FileZipFactory.makeNewZipReader(FileZipFactory.java:25)
 at jetbrains.buildServer.util.zip.AbstractFileZipFactory.openZipArchive(AbstractFileZipFactory.java:59)
 at jetbrains.buildServer.util.zip.FileZipFactory.openZipArchive(FileZipFactory.java:9)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.listPotentialDriverNamesAsJarFiles(JdbcDriverLoader.java:160)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJar(JdbcDriverLoader.java:148)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJars(JdbcDriverLoader.java:141)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClassesFromOneClassLoader(JdbcDriverLoader.java:81)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClasses(JdbcDriverLoader.java:72)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDrivers(JdbcDriverLoader.java:44)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureJdbcDrivers(BackupRestoreRunner.java:753)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureSourceDB(BackupRestoreRunner.java:818)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:248)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.main(BackupRestoreRunner.java:207)
java.util.zip.ZipException: invalid END header (bad central directory offset)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(ZipFile.java:131)
 at jetbrains.buildServer.util.zip.FileZipReader.<init>(FileZipReader.java:23)
 at jetbrains.buildServer.util.zip.FileZipFactory.makeNewZipReader(FileZipFactory.java:25)
 at jetbrains.buildServer.util.zip.AbstractFileZipFactory.openZipArchive(AbstractFileZipFactory.java:59)
 at jetbrains.buildServer.util.zip.FileZipFactory.openZipArchive(FileZipFactory.java:9)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.listPotentialDriverNamesAsJarFiles(JdbcDriverLoader.java:160)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJar(JdbcDriverLoader.java:148)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJars(JdbcDriverLoader.java:141)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClassesFromOneClassLoader(JdbcDriverLoader.java:81)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClasses(JdbcDriverLoader.java:72)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDrivers(JdbcDriverLoader.java:44)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureJdbcDrivers(BackupRestoreRunner.java:753)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureSourceDB(BackupRestoreRunner.java:818)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:248)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.main(BackupRestoreRunner.java:207)
java.util.zip.ZipException: invalid END header (bad central directory offset)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(ZipFile.java:131)
 at jetbrains.buildServer.util.zip.FileZipReader.<init>(FileZipReader.java:23)
 at jetbrains.buildServer.util.zip.FileZipFactory.makeNewZipReader(FileZipFactory.java:25)
 at jetbrains.buildServer.util.zip.AbstractFileZipFactory.openZipArchive(AbstractFileZipFactory.java:59)
 at jetbrains.buildServer.util.zip.FileZipFactory.openZipArchive(FileZipFactory.java:9)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.listPotentialDriverNamesAsJarFiles(JdbcDriverLoader.java:160)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJar(JdbcDriverLoader.java:148)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJars(JdbcDriverLoader.java:141)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClassesFromOneClassLoader(JdbcDriverLoader.java:81)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClasses(JdbcDriverLoader.java:72)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDrivers(JdbcDriverLoader.java:44)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureJdbcDrivers(BackupRestoreRunner.java:753)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureSourceDB(BackupRestoreRunner.java:818)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:248)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.main(BackupRestoreRunner.java:207)
java.util.zip.ZipException: invalid END header (bad central directory offset)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(ZipFile.java:131)
 at jetbrains.buildServer.util.zip.FileZipReader.<init>(FileZipReader.java:23)
 at jetbrains.buildServer.util.zip.FileZipFactory.makeNewZipReader(FileZipFactory.java:25)
 at jetbrains.buildServer.util.zip.AbstractFileZipFactory.openZipArchive(AbstractFileZipFactory.java:59)
 at jetbrains.buildServer.util.zip.FileZipFactory.openZipArchive(FileZipFactory.java:9)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.listPotentialDriverNamesAsJarFiles(JdbcDriverLoader.java:160)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJar(JdbcDriverLoader.java:148)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJars(JdbcDriverLoader.java:141)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClassesFromOneClassLoader(JdbcDriverLoader.java:95)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClasses(JdbcDriverLoader.java:72)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDrivers(JdbcDriverLoader.java:44)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureJdbcDrivers(BackupRestoreRunner.java:753)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureSourceDB(BackupRestoreRunner.java:818)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:248)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.main(BackupRestoreRunner.java:207)
java.util.zip.ZipException: invalid END header (bad central directory offset)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(ZipFile.java:131)
 at jetbrains.buildServer.util.zip.FileZipReader.<init>(FileZipReader.java:23)
 at jetbrains.buildServer.util.zip.FileZipFactory.makeNewZipReader(FileZipFactory.java:25)
 at jetbrains.buildServer.util.zip.AbstractFileZipFactory.openZipArchive(AbstractFileZipFactory.java:59)
 at jetbrains.buildServer.util.zip.FileZipFactory.openZipArchive(FileZipFactory.java:9)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.listPotentialDriverNamesAsJarFiles(JdbcDriverLoader.java:160)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJar(JdbcDriverLoader.java:148)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.retrievePotentialNamesFromJars(JdbcDriverLoader.java:141)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClassesFromOneClassLoader(JdbcDriverLoader.java:95)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDriverClasses(JdbcDriverLoader.java:72)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDriverLoader.loadJdbcDrivers(JdbcDriverLoader.java:44)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureJdbcDrivers(BackupRestoreRunner.java:753)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.ensureSourceDB(BackupRestoreRunner.java:818)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:248)
 at jetbrains.buildServer.serverSide.maintenance.BackupRestoreRunner.main(BackupRestoreRunner.java:207)
Cannot proceed with 'migrate' command: A driver for the source database not found. Please ensure you have driver jars in /root/.BuildServer/lib/jdbc.
Critical error has occurred during command execution.




It seems that it asking me to manually set up the path to the database driver. Can anyone help and let me know how I can database driver line in my database.properties file.


Thanks in advance.

Please sign in to leave a comment.