Setting TEAMCITY_DATA_PATH and getting errors

I want to set my datapath to some network attached storage while I am testing things out. I'll also be using HSQLDB with this configuration. The docs tell me that I can set the TEAMCITY_DATA_PATH environment variable and that all will be well. Oddly, this is not the case for me.

SYSTEM
-


TeamCity 3.1.2 (build 6881) initialized, OS: Linux, JRE: 1.5.0_10-b03

SNIPS FROM ATTACHED CAT LOG
-


TeamCity data path directory: /mvn-repo/teamcity_work_test/
Cannot find /mvn-repo/teamcity_work_test/config/database.properties.
Use database settings from buildServerSpring.xml

Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbSettings' defined in URL : Unsatisfied dependency expressed through constructor argument with index 0 of type : No unique bean of type is defined: Unsatisfied dependency of type : expected at least 1 matching bean


Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class : Constructor threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The database is already in use by another process: org.hsqldb.persist.NIOLockFile@f1606f26[file =/mvn-repo/teamcity_work_test/system/buildserver.lck, exists=true, locked=false, valid=false, fl =null]: )



Attachment(s):
catalina.2008-08-22.log
10 comments

FWIW, I have always added the value to CATALINA_OPTS in the teamcity-server.sh script.

In my case, I add this to the end of that opts line:
-Dteamcity.data.path=/data/teamcity-data

-Dave

0

Thanks for the feedback. I'll give that a try as well.

0

Robert,

It seems you have your TeamCity data directory set to "/mvn-repo/teamcity_work_test" (which is not the default value).

You can read on the ways to redefine the directory in our docs.
You probably already have the directory redefined using one of the ways.


--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

You are correct about the path. The problem is that after setting the path via an environment variable, TeamCity fails to startup properly. I attached a log file that shows some of the failures.

Sorry if I did not make that clear in my first post.

0

Robert,

This line form the logs suggests that you have another process (one more TeamCity instance?) running that accesses the database:

Caused by: java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@f1606f26[file =/mvn-repo/teamcity_work_test/system/buildserver.lck, exists=true, locked=false, valid=false, fl =null]:

If you are absolutely sure there are no processes that use the file, this could probably be caused by abrupt process finish. You could try to delete system/buildserver.lck file and start the TeamCity again.

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

I have exactly the same problem.  One one machine, I had an old installation of TeamCity 3 which I removed and replaced with TeamCity 5.  On another machine, I installed TeamCity 5 for the first time.  In both cases I verified that the machines had absolutely no trace (file or registry) of TeamCity.

Both installations report problems with HSQLDB when browsing to TeamCity.  This makes no sense at all because no other software on either machine uses HSQLDB.  I have confirmed this by searching files and registry, both before and after installation of TeamCity 5.

Moreover on either machine I cannot find the lockfile that is mentioned.  Anyone out there got any ideas?

Full browser rrror message given here.  It is identical on both machines (Windows Server 2003 x64).

Ooops, something went wrong...

Error on step: Waiting for a database server...

SQL error when doing: Connecting to HSQLDB
SQL  exception: The database is already in use by another process: lockFile:  org.hsqldb.persist.LockFile@cb2628cf[file =D:\Company Data\Userdocs\TeamCity"  --StdOutput auto --StdError auto\system\buildserver.lck, exists=false,  locked=false, valid=false, ] method: openRAF reason:  java.io.FileNotFoundException: D:\Company Data\Userdocs\TeamCity" --StdOutput  auto --StdError auto\system\buildserver.lck (The filename, directory name, or  volume label syntax is incorrect)
Copy  to clipboard
Stacktrace copied!
jetbrains.buildServer.serverSide.db.UnexpectedDBException:  SQL error when doing: Connecting to HSQLDB
SQL exception: The database is  already in use by another process: lockFile:  org.hsqldb.persist.LockFile@cb2628cf[file =D:\Company Data\Userdocs\TeamCity"  --StdOutput auto --StdError auto\system\buildserver.lck, exists=false,  locked=false, valid=false, ] method: openRAF reason:  java.io.FileNotFoundException: D:\Company Data\Userdocs\TeamCity" --StdOutput  auto --StdError auto\system\buildserver.lck (The filename, directory name, or  volume label syntax is incorrect)
   at  org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
   at  org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
   at  jetbrains.buildServer.serverSide.db.TeamCityDataSource.checkDatabaseConnection(TeamCityDataSource.java:22)
   at  jetbrains.buildServer.serverSide.db.TeamCityDataSource.connect(TeamCityDataSource.java:55)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:24)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:46)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:77)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:2)
   at  java.lang.Thread.run(Thread.java:595)
caused by: java.sql.SQLException: The  database is already in use by another process: lockFile:  org.hsqldb.persist.LockFile@cb2628cf[file =D:\Company Data\Userdocs\TeamCity"  --StdOutput auto --StdError auto\system\buildserver.lck, exists=false,  locked=false, valid=false, ] method: openRAF reason:  java.io.FileNotFoundException: D:\Company Data\Userdocs\TeamCity" --StdOutput  auto --StdError auto\system\buildserver.lck (The filename, directory name, or  volume label syntax is incorrect)
   at  org.hsqldb.jdbc.Util.sqlException(Unknown Source)
   at  org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
   at  org.hsqldb.jdbcDriver.getConnection(Unknown Source)
   at  org.hsqldb.jdbcDriver.connect(Unknown Source)
   at  org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
   at  org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
   at  org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
   at  org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
   at  org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
   at  jetbrains.buildServer.serverSide.db.TeamCityDataSource.checkDatabaseConnection(TeamCityDataSource.java:22)
   at  jetbrains.buildServer.serverSide.db.TeamCityDataSource.connect(TeamCityDataSource.java:55)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:24)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:46)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:77)
   at  jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:2)
   at  java.lang.Thread.run(Thread.java:595)
0

It seems HSQLDB tries to create file with the name:  D:\Company Data\Userdocs\TeamCity" --StdOutput  auto --StdError auto\system\buildserver.lck
How did you configure TeamCity data directory path?

0

Thanks for very quick answer.  Much appreciated.

I tried again with a new path, this time making sure it was a path with no whitespace in it.  Also to be sure nothing else could be using same path.

TeamCity directory D:\LocalTech\TeamCity
Config directory D:\LocalTech\Config\TeamCity

Screenshot of other config attached.

I get the same error again!

Screenshots attached.



Attachment(s):
TeamCity error.JPG
TeamCity config.JPG
0

Now this is very weird.  I uninstalled this new failed installation and then reinstalled.  Then it worked!  So it seems to be something to do with maybe whitespace of non-alphanumeric characters in the installation and config paths?

0

Did you specify \ at the end of TeamCity data path for the first time?

0

Please sign in to leave a comment.