• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • DSO:L1,DSO:L2
  • nadeem
  • Reporter: teck
  • October 22, 2008
  • 0
  • Watchers: 1
  • November 07, 2008
  • October 29, 2008

Attachments

Description

Attached is tc-config.xml used. Started server with “start-tc-server.sh -f tc-config-prod.xml -n lasstc1”

com.tc.util.TCAssertionError: dbDir ‘/export1/terracotta-data/statistics’ doesn’t exist at com.tc.util.Assert.failure(Assert.java:60) at com.tc.util.Assert.fail(Assert.java:402) at com.tc.statistics.database.impl.H2StatisticsDatabase.(H2StatisticsDatabase.java:28) at com.tc.statistics.store.h2.H2StatisticsStoreImpl.(H2StatisticsStoreImpl.java:99) at com.tc.statistics.StatisticsGathererSubSystem.setup(StatisticsGathererSubSystem.java:48) at com.tc.server.TCServerImpl.(TCServerImpl.java:120) at com.tc.server.TCServerImpl.(TCServerImpl.java:110) at com.tc.server.StandardServerFactory.createServer(StandardServerFactory.java:12) at com.tc.server.TCServerMain.main(TCServerMain.java:27)

The error seems to happen both if the path doesn’t exist and if the directory cannot be created due to permission problems

Comments

Alex Miller 2008-10-28

What do we expect to happen in this case?

Seems like the options are 1) create the dir
2) warn nicely (more nicely than assertion error)
3) refuse to start

I’d be happy with at least 2 and maybe 1 with a fallback to 2.

Walter Harley 2008-10-29

I have a nice fix for the failure to create the directory.

Unfortunately, failing gently in this spot makes us fail really ugly a bit later on: although StatisticsGathererSubSystem.setup() returns a boolean, TCServerImpl.() does not check it. (FWIW, the same code and same bug occur later on in StatisticsAgentSubsystemImpl, if we make it that far.)

The easy way out is #3, with a better error message. But I’ll try to figure out how to make the initialization failure survivable, that is, how to disable statistics and keep running. It seems like that’s the intention of the code but I don’t see how it could have been working.

Walter Harley 2008-10-29

Fixed in 2.7.1 BRANCH, by making server exit gracefully, as below:

[~/dev/branches/2.7/code/base/build/dist/terracotta-2.7.1-snapshot/bin]

./start-tc-server.sh -f ~/test/tc-config-prod.xml -n lasstc1 2008-10-29 12:53:38,216 INFO - Terracotta 2.7.1-SNAPSHOT, as of 20081029-121056 (Revision 10697 by [email protected] from 2.7) 2008-10-29 12:53:38,615 INFO - Configuration loaded from the file at ‘/Users/wharley/test/tc-config-prod.xml’. 2008-10-29 12:53:38,724 INFO - Log file: ‘/tmp/var/log/terracotta/terracotta-server.log’. 2008-10-29 12:53:38,761 ERROR - ************************************************************************************** Unable to create the directory ‘/export1/terracotta-data/statistics’ for the statistics buffer. This directory is specified in the Terracotta configuration. Please ensure that the Terracotta client has read and write privileges to this directory and its parent directories. **************************************************************************************

[~/dev/branches/2.7/code/base/build/dist/terracotta-2.7.1-snapshot/bin]

A better fix would be to replace the stats subsystem with a dummy, so that execution can continue. It seems as though this was the intent of the original code but I don’t think it was completed. I will open a separate Jira for that.

Leaving this bug open until I’ve merged the change into TRUNK.

Walter Harley 2008-10-29

Fixed in trunk with 10705.

Abhishek Singh 2008-10-31

Was trying to start examinator and got the following:

[WARNING] [cargo0] ************************************************************************************** [WARNING] [cargo0] Unable to create the directory ‘/Users/asingh/workspace/examinator/target/terracotta/clients/statistics/cargo0’ for the statistics buffer. [WARNING] [cargo0] The CVT system will not be active for this node. To fix this, ensure that the Terracotta [WARNING] [cargo0] client has read and write privileges to this directory and its parent directories. [WARNING] [cargo0] **************************************************************************************

The terracotta client has write access to ‘/Users/asingh/workspace/examinator/target/terracotta/clients/statistics/cargo0’ Seems like we are giving out a wrong warning message. Maybe we can try doing something similar to “mkdir -p”

Walter Harley 2008-10-31

Interesting. So this is happening on the client, not the server, is that correct? That particular error message comes from StatisticsAgentSubsystemImpl, in dso-statistics. The server fails earlier, in StatisticsGathererSubSystem. The same code is being called, though, they’re just different error messages.

We do call mkdirs(), which is the Java version of mkdir -p. Are you certain about the permissions being right? (E.g., it’s a directory, not a normal file?)

Tim Eck 2008-10-31

Not sure if you think it is overkill, but we could in theory try to test all of these possible conditions and give more specific error messages.

Walter Harley 2008-10-31

I am not sure I trust the consistency of the java.io results on different platforms well enough to make that worthwhile.

nadeem ghani 2008-11-07

Nice error msg:

macbook ~/__releases/07nov/terracotta-2.7.1-ee > bin/start-tc-server.sh -f tools/sessions/configurator-sandbox/tomcat5.5/tc-config.xml 2008-11-07 12:07:30,574 INFO - Terracotta Enterprise 2.7.1, as of 20081106-141116 (Revision 2874-10770 by cruise@su10mo5 from 2.7) 2008-11-07 12:07:31,192 INFO - Configuration loaded from the file at ‘/Users/nghani/__releases/07nov/terracotta-2.7.1-ee/tools/sessions/configurator-sandbox/tomcat5.5/tc-config.xml’. 2008-11-07 12:07:31,232 INFO - Log file: ‘/tmp/logs/server-logs/terracotta-server.log’. 2008-11-07 12:07:31,393 ERROR - ************************************************************************************** Unable to create the directory ‘/Users/noone/stats/server-stats’ for the statistics buffer. This directory is specified in the Terracotta configuration. Please ensure that the Terracotta client has read and write privileges to this directory and its parent directories. **************************************************************************************