db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4733) Get error "Failed to create database - directory already exists" when attempting to connect to a database that failed during creation
Date Wed, 07 Jul 2010 22:13:50 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kathey Marsden updated DERBY-4733:
----------------------------------

    Description: 
If you exit a process that is in the middle of creating a database, then when you try to access
the same database again, you get the error "Failed to create database 'foo', see next exception"
followed by "Directory xxx already exists".

A stack trace is below.  I am attaching a simple program that reproduces.  Just try running
it multiple times.  I hit this after the second try.

Opening database
java.sql.SQLException: Failed to create database 'corruptme', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at CorruptMePlease$CreateTableTask.run(CorruptMePlease.java:34)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Failed to create database 'corruptme', see the next exception
for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	... 14 more
Caused by: java.sql.SQLException: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	... 11 more
Caused by: ERROR XBM0J: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.services.monitor.StorageFactoryService$9.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
	... 11 more

  was:
If you exit a process that is in the middle of booting a database or creating a table, then
when you try to access the same database again, you get the error "Failed to create database
'foo', see next exception" followed by "Directory xxx already exists".

A stack trace is below.  I am attaching a simple program that reproduces.  Just try running
it multiple times.  I hit this after the second try.

Opening database
java.sql.SQLException: Failed to create database 'corruptme', see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at CorruptMePlease$CreateTableTask.run(CorruptMePlease.java:34)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Failed to create database 'corruptme', see the next exception
for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	... 14 more
Caused by: java.sql.SQLException: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	... 11 more
Caused by: ERROR XBM0J: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.services.monitor.StorageFactoryService$9.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
	... 11 more


I agree it would be very bad to provide an option to remove an existing directory.   Not only
may a mistype blow away something totally unrelated, but sometimes this error occurs with
corruption and people might get confused and blow away the evidence. Lastly I think such an
option would be a potential security risk.  I think Mike's suggestion of a error message change
might be helpful.




> Get error "Failed to create database - directory already exists" when attempting to connect
to a database that failed during creation
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4733
>                 URL: https://issues.apache.org/jira/browse/DERBY-4733
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.6.1.0
>         Environment: Windows XP
>            Reporter: David Van Couvering
>         Attachments: corruptme.zip, CorruptMePlease.java
>
>
> If you exit a process that is in the middle of creating a database, then when you try
to access the same database again, you get the error "Failed to create database 'foo', see
next exception" followed by "Directory xxx already exists".
> A stack trace is below.  I am attaching a simple program that reproduces.  Just try running
it multiple times.  I hit this after the second try.
> Opening database
> java.sql.SQLException: Failed to create database 'corruptme', see the next exception
for details.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
> 	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
> 	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> 	at java.sql.DriverManager.getConnection(Unknown Source)
> 	at CorruptMePlease$CreateTableTask.run(CorruptMePlease.java:34)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.sql.SQLException: Failed to create database 'corruptme', see the next
exception for details.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
> 	... 14 more
> Caused by: java.sql.SQLException: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
> 	... 11 more
> Caused by: ERROR XBM0J: Directory C:\vontu\depot\sandbox_incremental\DerbyCorruption\corruptme
already exists.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.StorageFactoryService$9.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown
Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown
Source)
> 	at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message