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

Non-Descriptive Error When RoundhousE Structure Not Created In Oracle #65

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Connect to the Oracle database as SYSTEM or a similar user and run the 
attached CreateNoQuotaRoundhouseUser.sql script. This creates a user that has 
the privileges to create database objects but hasn't been given any physical 
space to hold tables.
2. Run RoundhousE against the database, using the connection information for 
the user created in step 1. The script directories can all be empty.
3. Observe the error below.
4. Connect to the database as the user created in step 1 and execute the 
following query:
SELECT DISTINCT *
  FROM USER_OBJECTS
 WHERE OBJECT_TYPE = 'TABLE' AND OBJECT_NAME LIKE '%ROUNDHOUSE%';

Observe that the query returns no results, indicating that no tables with 
"ROUNDHOUSE" in the name exist on the schema.

What is the expected output? What do you see instead?

Running RoundhousE v0.8.5.0 against roundhouse_bugs - .
Looking in . for scripts to run.
==================================================
Setup, Backup, Create/Restore/Drop
==================================================
==================================================
RoundhousE Structure
==================================================
 Running database type specific tasks.
Creating a sequence for the 'Version' table.
Creating a sequence for the 'ScriptsRun' table.
Creating a sequence for the 'ScriptsRunErrors' table.
 Creating [Version] table if it doesn't exist.
 Creating [ScriptsRun] table if it doesn't exist.
 Creating [ScriptsRunErrors] table if it doesn't exist.
==================================================
Versioning
==================================================
roundhouse.databases.oracle.OracleDatabase with provider 
System.Data.OracleClient does not provide a facility for retrieving versions at 
this time.
 Attempting to resolve version from C:\Projects\CSharp\experiments\roundhousebugs\_BuildInfo.xml using //buildInfo/version.
 Found version 1.0.0.0 from C:\Projects\CSharp\experiments\roundhousebugs\_BuildInfo.xml.
 Migrating  from version 0 to 1.0.0.0.
 Versioning  database with version 1.0.0.0 based on blah.
RoundhousE encountered an error.
System.ArgumentException: The OracleParameter is already contained by another 
OracleParameterCollection.
   at System.Data.OracleClient.OracleParameterCollection.Validate(Int32 index, Object value)
   at System.Data.OracleClient.OracleParameterCollection.Add(Object value)
   at roundhouse.databases.AdoNetDatabase.setup_database_command(String sql_to_run, ConnectionType connection_type, IEnumerable`1 parameters)
   at roundhouse.databases.AdoNetDatabase.run_command_with(String sql_to_run, ConnectionType connection_type, IList`1 parameters)
   at roundhouse.databases.AdoNetDatabase.run_sql(String sql_to_run, ConnectionType connection_type, IList`1 parameters)
   at roundhouse.databases.oracle.OracleDatabase.insert_version_and_get_version_id(String repository_path, String repository_version)
   at roundhouse.migrators.DefaultDatabaseMigrator.version_the_database(String repository_path, String repository_version)
   at roundhouse.runners.RoundhouseMigrationRunner.run()
The OracleParameter is already contained by another OracleParameterCollection.


What version of the product are you using? On what operating system?

RoundhousE v0.8.5.0
Windows 7, 64-bit
Oracle XE 11g 32-bit running locally

Please provide any additional information below.

My Summary makes some assumptions about the missing RoundhousE structure tables 
being the problem, but I think that's what's happening. There are other 
situations where the RoundhousE tables are not created and this error occurs; a 
quota of zero is just a simple way to ensure that they are not created. It is 
also a case when RoundhousE clearly can't do anything to remedy the issue. I'll 
be reporting a case that RoundhousE could possibly do someting differently to 
avoid the error (although I'm not sure what).

Doing the same thing in v0.8.0.300 still causes an error to occur at the same 
point, but it is more descriptive:

Running RoundhousE v0.8.0.300 against roundhouse_bugs - .
Looking in . for scripts to run.
==================================================
Setup, Backup, Create/Restore/Drop
==================================================
==================================================
RoundhousE Structure
==================================================
 Running database type specific tasks.
 Creating [Version] table if it doesn't exist.
 Creating [ScriptsRun] table if it doesn't exist.
 Creating [ScriptsRunErrors] table if it doesn't exist.
==================================================
Versioning
==================================================
roundhouse.databases.oracle.OracleDatabase with provider 
System.Data.OracleClient does not provide a facility for retrieving versions at 
this time.
 Attempting to resolve version from C:\Projects\CSharp\experiments\roundhousebugs\_BuildInfo.xml using //buildInfo/version.
 Found version 1.0.0.0 from C:\Projects\CSharp\experiments\roundhousebugs\_BuildInfo.xml.
 Migrating  from version 0 to 1.0.0.0.
 Versioning  database with version 1.0.0.0 based on blah.
RoundhousE encountered an error.
System.Data.OracleClient.OracleException: ORA-00942: table or view does not 
exist

   at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
   at roundhouse.databases.AdoNetDatabase.run_sql(String sql_to_run, IList`1 parameters)
   at roundhouse.databases.oracle.OracleDatabase.insert_version_and_get_version_id(String repository_path, String repository_version)
   at roundhouse.migrators.DefaultDatabaseMigrator.version_the_database(String repository_path, String repository_version)
   at roundhouse.runners.RoundhouseMigrationRunner.run()
ORA-00942: table or view does not exist

The point as which the error occurs is strange as well. I would expect that 
failure to create the structure tables would result in an error before the 
Versioning phase began. That's manageable, though; an error occurs and it's 
relatively simple to figure out that something kept the version table from 
being created. An error message that doesn't indicate the real problem is less 
so. Honestly, I probably wouldn't have realized that the problem was the 
missing structure tables if I hadn't seen the v0.8.0.300 error first.

Original issue reported on code.google.com by [email protected] on 3 Dec 2011 at 10:49

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

1 participant