TeamCity server reporting missing table/view, but not telling me which one

To test upgrading from 4 to 4.5, we had a copy of our team_city oracle database created on another oracle server, after setting 4.5 to point to that server, I'm seeing the below error on startup.  I've compared the tables from one db to the other, and they look the same.  Is there some other system table its looking for I need to make sure it has access to?  I've attached the full teamcity-server.log, debug logging was on.

Thanks!
-Scott MacDonald
srmacdo@monsanto.com

[2010-01-16 13:15:11,861]  ERROR -   jetbrains.buildServer.SERVER - Failed to initialize TeamCity server, due to error (enable debug to see the whole stacktrace):
ORA-00942: table or view does not exist
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildServer' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Cannot resolve reference to bean 'userModel' while setting bean property 'userModelEx'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userModel' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Cannot resolve reference to bean 'hiddenProjectManager' while setting bean property 'projectManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hiddenProjectManager' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Cannot resolve reference to bean 'copyProjectHelper' while setting bean property 'copyProjectHelper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'copyProjectHelper' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Cannot resolve reference to bean 'notificationRulesManager' while setting bean property 'notificationRulesManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'notificationRulesManager' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [jetbrains.buildServer.notification.impl.NotificationRulesManagerImpl]: Constructor threw exception; nested exception is org.springframework.jdbc.BadSqlGrammarException: ConnectionCallback; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00942: table or view does not exist
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverPaths' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbSettings' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverPaths' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbSettings' defined in URL [jar:file:/ci/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerSpring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean



Attachment(s):
teamcity-server.log.zip
7 comments
Comment actions Permalink

Can you provide list of tables from the TeamCity database? What was in the .BuildServer/system/version.dat file before upgrade and after? Can you describe your upgrade process in more details?

0
Comment actions Permalink

The upgrade process was to install team city 4.5 (fresh) on a different linux system than the current 4.0 (on windows).   Then I made a copy of the existing database the 4.0 system was using to another oracle server.  I pointed the 4.5 installation to that server.  That way I could simulate what would happen when we pointed the 4.5 to the existing teamcity database. I didn't see any database upgrade notes in the release documentation for 4.5, so I felt it should be pretty seemless.

The version.dat on the linux box (4.5) is this
#Sat Jan 16 13:05:13 CST 2010
version.oracle.jdbc.driver.OracleDriver=280
version.org.hsqldb.jdbcDriver=280

The version.dat on the windows box (4.0) is this
#Wed Jan 21 06:20:25 CST 2009
version.oracle.jdbc.driver.OracleDriver=267
version.org.hsqldb.jdbcDriver=221

The tables in the database copied from the original is this
ACTION_HISTORY
AGENT
AGENT_BUILD_TYPE_ACCESS
AGENT_SOURCES_VERSION
BUILD_CHECKOUT_RULES
BUILD_DATA_STORAGE
BUILD_DEPENDENCY
BUILD_LABELS
BUILD_QUEUE
BUILD_REVISIONS
BUILD_RUNTIME_INFO
BUILD_STATE
BUILD_TYPE_VCS_CHANGE
CANCELED_INFO
COMMENTS
COMPILER_OUTPUT
DEFAULT_BUILD_PARAMETERS
DELETED_BUILD_TYPES
DOWNLOADED_ARTIFACTS
DUPLICATE_DIFF
DUPLICATE_FRAGMENTS
DUPLICATE_RESULTS
DUPLICATE_STATS
FAILED_TESTS_OUTPUT
FRAGMENTS
HISTORY
IGNORED_TESTS
INSPECTION_DATA
INSPECTION_DIFF
INSPECTION_FIXES
INSPECTION_INFO
INSPECTION_RESULTS
INSPECTION_STATS
LIGHT_HISTORY
PAUSED_BUILD_TYPES
PERSONAL_BUILD_RELATIVE_PATH
PERSONAL_VCS_CHANGES
PERSONAL_VCS_HISTORY
PROJECTS
PROJECT_FILES
REMEMBER_ME
REMOTE_RUN_BUILD_TYPES
RUNNING
RUN_CONFIGURATION_POLICY
SERVER
SERVER_PROPERTY
STATS
STATS_PUBLISHER_STATE
TC_BUILD_TAGS
TEST_FAILURE_RATE
TEST_INFO
TEST_INFO_TRUNK
TEST_NAMES
USERS
USER_BLOCKS
USER_BUILD_PARAMETERS
USER_NOTIFICATION_EVENTS
USER_PROJECTS_ORDER
USER_PROJECTS_VISIBILITY
USER_PROPERTY
USER_ROLES
USER_WATCH_TYPE
VCS_CHANGES
VCS_HISTORY
VCS_ROOT_VERSIONS

0
Comment actions Permalink

Please check that database treats table names case insensitively.

0
Comment actions Permalink

Yes, it treats them case insensitivly

select * from AGENT;
select * from agent;

both work (so does select * from aGeNt;)

0
Comment actions Permalink

I read carefully how you did the upgrade and it seems I understard why you do not have necessary tables. You've installed new 4.5 server (and probably started it), then you copied database, and pointed TeamCity 4.5 to this database. But in this case server did not have a chance to apply converters.

TeamCity 4.5 keeps version of database in version.dat file, when it was started for the first time - there were no database, so the new database was created and version.dat file was set to the version of the newly created schema. Then you stopped the server and replaced database with old one. When server starts it checks version.dat and decides that no conversion is required, but since the schema is old and misses some necessary tables server throws exception.

The right upgrade sequence would be the following:
- create copy of existing 4.0 database
- copy configuration files from .BuildServer and version.dat file from system to new .BuildServer
- install TC 4.5
- point TC 4.5 to new .BuildServer and new database
- start TC 4.5

In this case TC will apply all necessary converters.

0
Comment actions Permalink

Yes, I had started it and was playing with stuff without an external database for a while.  I'll clear out the system files and bring them over from the old server, restart it up and see what happens.

Thanks!

0
Comment actions Permalink

That did it!  I'll make note of that for the future

0

Please sign in to leave a comment.