dropped war in tomcat7: TeamCity server requires technical maintenance

Hi all.

It's a few days I try to install teamcity but I keep having problems.

My environment:
teamcity: 7.0.2a, j2ee version
servlet container: tomcat 7.0.26
java: openjdk 1.6.0_24 and oracle jdk version 1.6.0_32 (started with the first and moved to the second to see if it would help)
JAVA_OPTS passed to tomcat: JAVA_OPTS="-Dteamcity.data.path=/opt/teamcity -Dlog4j.configuration=file:/opt/teamcity/conf/teamcity-server-log4j.xml -Dtea\
mcity_logs=/opt/teamcity/logs/ -Djava.awt.headless=true -Xmx1500m -XX:MaxPermSize=400m"
OS: linux ubuntu 12.04 LTS

The problem:
When I visit the teamcity page I get:

Waiting for maintenance... TeamCity server requires technical maintenance. Please let the server administrator know this.




the teamcity log file shows:
[2012-05-03 14:44:08,008]   INFO -   jetbrains.buildServer.SERVER - ===========================================================
[2012-05-03 14:44:08,008]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2012-05-03 14:44:08,081]   INFO -   jetbrains.buildServer.SERVER - TeamCity version: 7.0.2 (build 21349), data format version 514
[2012-05-03 14:44:08,093]   INFO -   jetbrains.buildServer.SERVER - TeamCity data directory: /opt/teamcity
[2012-05-03 14:44:08,094]  DEBUG -   jetbrains.buildServer.SERVER - CurrentStep: Starting...
[2012-05-03 14:44:08,508]  DEBUG -   jetbrains.buildServer.SERVER - DataDirOk: true
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - MainConfigFileFound: false
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - ConfigVersion: 0
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - InternalDatabaseFound: false
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - DatabasePropertiesFileFound: false
[2012-05-03 14:44:08,509]   INFO -   jetbrains.buildServer.SERVER - Data directory format version: no configuration found
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - DatabaseAccessible: false
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - DatabaseAnyTablesFound: false
[2012-05-03 14:44:08,509]  DEBUG -   jetbrains.buildServer.SERVER - DatabaseOurTablesFound: false
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - DatabaseVersion: 0
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - DatabaseVersionIsGuessed: false
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - WillRetryToConnect: false
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - PotentiallyCanStartServer: false
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - RecoverableErrorEncountered: false
[2012-05-03 14:44:08,510]  DEBUG -   jetbrains.buildServer.SERVER - NonRecoverableErrorEncountered: false
[2012-05-03 14:44:08,510]   INFO -   jetbrains.buildServer.SERVER - Database format version: neither internal database nor 'database.properties' file found
[2012-05-03 14:44:08,511]  DEBUG -   jetbrains.buildServer.SERVER - CurrentStep: System maintenance mode
[2012-05-03 14:44:08,511]   INFO -   jetbrains.buildServer.SERVER - First TeamCity start detected (empty data directory). Please review settings shown on the web UI.


Could any kind soul help me, please?
Thank you!
13 comments
Comment actions Permalink

Hi again.

I forgot to mention that the webapp is deploied without any error/warning.
Here's tomcat logs after a restart:

May 3, 2012 5:09:41 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9080"]
May 3, 2012 5:09:41 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1384 ms
May 3, 2012 5:09:41 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 3, 2012 5:09:41 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
May 3, 2012 5:09:41 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/TeamCity.war
Log4J configuration file /opt/teamcity/conf/teamcity-server-log4j.xml will be monitored with interval 10 seconds.
May 3, 2012 5:10:07 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 3, 2012 5:10:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9080"]
May 3, 2012 5:10:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 27596 ms


Please help.
Thank you.
0
Comment actions Permalink

Anybody on this, please?

0
Comment actions Permalink

Anybody on this, please?

0
Comment actions Permalink

Hi Roberto

Sorry for delay.

Do you see a maintenance token code in later messages in teamcity-server.log?
What happen if you enter it in a form under I'm a server administrator, show me the details link?

Please also check that application has enough permissions over /opt/teamcity directory.

0
Comment actions Permalink

Hi Michael.

Thank you for replying.

No.. I don't see any maintenance token code in teamcity-server.log. I posted above in this thread the content of that file

Also, tomcat runs as user tomcat7 and group tomcat7

And permissions on file system seem to be correct:

# ls -lAFd /opt/teamcity /opt /
drwxr-xr-x 23 root    root    4096 Apr 27 10:38 //
drwxr-xr-x  9 root    root    4096 May  3 16:51 /opt/
drwxr-xr-x  4 tomcat7 tomcat7 4096 Apr 23 16:57 /opt/teamcity/


Do I have to set up a database before starting the webapp? In the logs I see:
[2012-05-11 09:15:28,544]   INFO -   jetbrains.buildServer.SERVER - Database format version: neither internal database nor 'database.properties' file found

and just after that it enters system maintenance mode:
[2012-05-11 09:15:28,545]  DEBUG -   jetbrains.buildServer.SERVER - CurrentStep: System maintenance mode
[2012-05-11 09:15:28,545]   INFO -   jetbrains.buildServer.SERVER - First TeamCity start detected (empty data directory). Please review settings shown on the web UI.


Thank you.
0
Comment actions Permalink

Hello

As I can see from the log above, TeamCity is started with a Data Directory (see http://confluence.jetbrains.net/display/TCD7/TeamCity+Data+Directory for details what is the TeamCity Data Directory) that seems contain any non-TeamCity files. Please ensure that the directory "/opt/teamcity" is empty and accessible by TeamCity.

0
Comment actions Permalink

Hi Leonid.

I stopped tomcat, moved away /opt/teamcity and recreated /opt/teamcity and started again tomcat
Here's what I see:

Apparently, still the same problem.. when I visit the teamcity page it shows:

TeamCity Server Startup

Waiting for maintenance... TeamCity server requires technical maintenance. Please let the server administrator know this.

Enter the Maintenance Authentication Token: Cancel
The Maintenance Authentication Token
can be found in the teamcity-server.log.




/opt/teamcity/logs directory was created and also the log file /opt/teamcity/logs/teamcity-server.log

teamcity-server.log contains:


# tail -f /opt/teamcity/logs/teamcity-server.log

[2012-05-14 17:23:26,113]   INFO -   jetbrains.buildServer.SERVER - ===========================================================
[2012-05-14 17:23:26,113]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2012-05-14 17:23:26,153]   INFO -   jetbrains.buildServer.SERVER - TeamCity version: 7.0.2 (build 21349), data format version 514
[2012-05-14 17:23:26,160]   INFO -   jetbrains.buildServer.SERVER - TeamCity data directory: /opt/teamcity
[2012-05-14 17:23:26,549]   INFO -   jetbrains.buildServer.SERVER - Data directory format version: no configuration found
[2012-05-14 17:23:26,562]   INFO -   jetbrains.buildServer.SERVER - Database format version: neither internal database nor 'database.properties' file found
[2012-05-14 17:23:26,562]   INFO -   jetbrains.buildServer.SERVER - First TeamCity start detected (empty data directory). Please review settings shown on the web UI.






catalina.out contains:
# tail -f /var/log/tomcat7/catalina.out
May 14, 2012 5:15:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 28716 ms
May 14, 2012 5:22:20 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-9080"]
May 14, 2012 5:22:20 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
May 14, 2012 5:22:20 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-9080"]
May 14, 2012 5:22:20 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-9080"]
May 14, 2012 5:23:23 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9080"]
May 14, 2012 5:23:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1386 ms
May 14, 2012 5:23:23 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 14, 2012 5:23:23 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
May 14, 2012 5:23:23 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/TeamCity.war
log4j:WARN No appenders could be found for logger (jetbrains.buildServer.web.AddCacheHeadersFilter).
log4j:WARN Please initialize the log4j system properly.
May 14, 2012 5:23:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 14, 2012 5:23:27 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9080"]
May 14, 2012 5:23:27 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3875 ms


Please help.
0
Comment actions Permalink

Will anybody help me solve this problem? it's twelve days I posted here for help, and I still haven't got a solution..


My users are starting to use jenkins instead, even though they originally wanted to use teamcity.. jenkins was working out of the box while teamcity doesn't.

0
Comment actions Permalink

Hello Roberto,

It seems the mention TC behaviour is the TW-20446 bug, that was resolved in TC version 7.0.3.

Could you please download TC version 7.0.3 and try again?

Thanks

0
Comment actions Permalink

Hi Leonid.
I'll try the new version right away.
Thanks.

0
Comment actions Permalink

Hi Leonid.
Now I see something more in the web page:

TeamCity Server Startup Error

An error was encountered during TeamCity server startup

It seems the content of the TeamCity Data Dir (/opt/teamcity) doesn't belong to TeamCity

The strange part is that the webapp is run by tomcat, as tomcat7 user and tomcat7 group and /opt/teamcity belongs to tomcat7:tomcat7
Also, the webapp has successfully created directory /opt/teamcity/logs and file /opt/teamcity/logs/teamcity-server.log


# ls -lAFd /opt/teamcity /opt/teamcity/logs/ /opt/teamcity/logs/teamcity-server.log
drwxr-xr-x 3 tomcat7 tomcat7  4096 May 14 17:15 /opt/teamcity/
drwxr-xr-x 2 tomcat7 tomcat7  4096 May 14 17:15 /opt/teamcity/logs//
-rw-r--r-- 1 tomcat7 tomcat7 11428 May 15 19:24 /opt/teamcity/logs/teamcity-server.log


and:
# ls -lAF /opt/teamcity
total 4
drwxr-xr-x 2 tomcat7 tomcat7 4096 May 14 17:15 logs/



and here's again the teamcity-server.log file
# tail /opt/teamcity/logs/teamcity-server.log


[2012-05-15 19:24:13,583]   INFO -   jetbrains.buildServer.SERVER - ===========================================================
[2012-05-15 19:24:13,583]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2012-05-15 19:24:13,642]   INFO -   jetbrains.buildServer.SERVER - TeamCity version: 7.0.3 (build 21424), data format version 514
[2012-05-15 19:24:13,645]   INFO -   jetbrains.buildServer.SERVER - TeamCity data directory: /opt/teamcity
[2012-05-15 19:24:14,004]   INFO -   jetbrains.buildServer.SERVER - Data directory format version: no configuration found
[2012-05-15 19:24:14,027]  ERROR -   jetbrains.buildServer.SERVER - It seems the content of the TeamCity Data Dir (/opt/teamcity) doesn't belong to TeamCity
[2012-05-15 19:24:14,033]   INFO -   jetbrains.buildServer.SERVER - Database format version: neither internal database nor 'database.properties' file found
[2012-05-15 19:24:14,034]   INFO -   jetbrains.buildServer.SERVER - First TeamCity start detected (empty data directory). Please review settings shown on the web UI.

What's wrong???
0
Comment actions Permalink

Hello Roberto,

thank you for the detailed info, now the case is obviouse. When TeamCity starts for the very first time, it expects that the Data Directory is empty. However, in this case the Data Directory is not empty - it contains logs. TeamCity attempts to find the known content (files that are expected to be in this directory) but unsuccessful. So it decides that the given directory (/opt/teamcity) doesn't belong to TeamCity.

Now, the simplest way to solve the problem is to configure logging to another directory.

P.S. I've also filed a related issue: TW-21563, you'tre welcome to watch/vote for.

Don't hesitate to contact us on further questions.

--
Leonid Bushuev

0
Comment actions Permalink

Hi Leonid.

Yes! That was it. Thank you, I can now start to configure TeamCity.
Best regards.

0

Please sign in to leave a comment.