Projects tigase _server server-core Issues #771
Disabling components makes server fail to start (#771)
Closed
wojciech.kapcia@tigase.net opened 8 years ago
Due Date
2017-04-09

When trying to disable muc and pubsub in the latest version with:

pubsub (active: false) {}
muc (active: false) {}
2017-03-07 09:00:05.655 [main]             DSLBeanConfigurator.dumpConfiguration()  WARNING: Dumping full server configuration to: etc/config-dump.properties

  --------------------------------------
  ERROR! Terminating the server process.
  Problem initializing the server: java.lang.UnsupportedOperationException: Invalid operation for String!
  Please fix the problem and start the server again.
java.lang.UnsupportedOperationException: Invalid operation for String!
	at tigase.conf.ConfigReader$CompositeVariable.calculateValue(ConfigReader.java:532)
	at tigase.conf.ConfigWriter.writeObject(ConfigWriter.java:155)
	at tigase.conf.ConfigWriter.writeObject(ConfigWriter.java:102)
	at tigase.conf.ConfigWriter.writeMap(ConfigWriter.java:328)
	at tigase.conf.ConfigWriter.write(ConfigWriter.java:97)
	at tigase.component.DSLBeanConfigurator.dumpConfiguration(DSLBeanConfigurator.java:165)
	at tigase.server.Bootstrap.start(Bootstrap.java:133)
	at tigase.server.XMPPServer.start(XMPPServer.java:138)
	at tigase.server.XMPPServer.main(XMPPServer.java:119)
ShutdownThread started...

Version

componentInfo{Title=Tigase XMPP Server, Version=7.2.0-SNAPSHOT-b4673/c5ddc489 (2017-03-06/00:10:15), Class=tigase.server.XMPPServer}
wojciech.kapcia@tigase.net commented 8 years ago

Complete configs:

  • tigase.conf
tigase@node1:~/tigase-server72$ cat etc/tigase.conf
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"
GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2"
#DEBUGGER="-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n"
#JAVA_HOME="/usr/lib/jvm/jdk7/"
JAVA_HOME="/usr/lib/jvm/jdk/"
CLASSPATH=""
#JMX=" -Djava.rmi.server.hostname=188.165.249.130 "
JAVA_OPTIONS="${GC} ${ENC} ${DRV} ${DEBUGGER} ${JMX} -server -Xms1500M -Xmx1500M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m "
TIGASE_OPTIONS=" --property-file etc/init.properties "
  • init.properties
tigase@node1:~/tigase-server72$ cat etc/init.properties
--cluster-mode = true
--debug = server,pubsub,cluster
--packet.debug.full = true
--sm-cluster-strategy-class = tigase.server.cluster.strategy.OnlineUsersCachingStrategy
--test = false
--trusted = http@{clusterNode}
--vhost-disable-dns-check = true
--virt-hosts = xmpp-test.com,xmpp-test.biz
admins = [ 'admin@xmpp-test.net', 'admin@xmpp-test.org', 'admin@xmpp-test.biz', 'admin@xmpp-test.com' ]
config-type = '--gen-config-def'
dataSource {
    default {
        uri = 'jdbc:mysql://xxxx.xmpp-test.net/tigasedb_cl1?user=xxx&password=xxxxx&autoCreateUser=true'
    }
}
basic-conf {
    logging {
        java.util.logging.FileHandler.count = '20'
        java.util.logging.FileHandler.limit = '500000000'
    }
}

pubsub (active: false) {}
muc (active: false) {}
wojciech.kapcia@tigase.net commented 8 years ago

Possibly related to #835

Andrzej Wójcik (Tigase) commented 8 years ago

I've fixed issue with conversion from properties file to DSL.

Your config should be:

--cluster-mode = true
--debug = 'server,pubsub,cluster'
--packet.debug.full = true
--test = false
--trusted = http@{clusterNode}
--vhost-disable-dns-check = true
--virt-hosts = 'xmpp-test.com,xmpp-test.biz'
admins = [ 'admin@xmpp-test.net', 'admin@xmpp-test.org', 'admin@xmpp-test.biz', 'admin@xmpp-test.com' ]
'config-type' = '--gen-config-def'
test = false
dataSource {
    default {
        uri = 'jdbc:mysql://xxxx.xmpp-test.net/tigasedb_cl1?user=xxx&password=xxxxx&autoCreateUser=true'
    }
}
basic-conf {
    logging {
        java.util.logging.FileHandler.count = '20'
        java.util.logging.FileHandler.limit = '500000000'
    }
}
'sess-man' {
    strategy (class: tigase.server.cluster.strategy.OnlineUsersCachingStrategy) {}
}
pubsub (active: false) {}
muc (active: false) {}

Part related to basic-conf is now obsolete and will be ignored;

wojciech.kapcia@tigase.net commented 8 years ago

Andrzej Wójcik wrote:

I've fixed issue with conversion from properties file to DSL.

OK, however thrown exception still doesn't indicate what caused the problem in the first place:

  --------------------------------------
  ERROR! Terminating the server process.
  Problem initializing the server: java.lang.UnsupportedOperationException: Cannot substract a String
  Please fix the problem and start the server again.
java.lang.UnsupportedOperationException: Cannot substract a String

We should include there information which config line caused the server shutdown.

Part related to basic-conf is now obsolete and will be ignored;

How do we set the custom logging?

We also discussed that right now all string properties MUST be enclosed in quotes - this information must go in the documentation (and it must be revised that all dash properties use the quotations.

I've noticed that --trusted = http@{clusterNode} doesn't follow this rule - is it treated differently? Why 'sess-man' is quoted and other beans not?

As for the issue at hand - with the quoting of the strings it works.

Andrzej Wójcik (Tigase) commented 7 years ago

Wojciech Kapcia wrote:

Andrzej Wójcik wrote:

I've fixed issue with conversion from properties file to DSL.

OK, however thrown exception still doesn't indicate what caused the problem in the first place:

[...]

We should include there information which config line caused the server shutdown.

Done, added information about line causing issue and position in line.

Part related to basic-conf is now obsolete and will be ignored;

How do we set the custom logging?

It was configured by Bootstrap class and worked only with --debug and --debug-packages entries.

After your comment I reviewed possible usages supported in previous versions of Tigase XMPP Server and added new logging bean which will be responsible for advanced configuration of logging.

Possible ways to configure logging:

  • using --debug and --debug-packages (same as before)
--debug=server
--debug-packages=tigase.conf
  • using logging bean
logging () {
    rootLevel = CONFIG
    loggers = {
        'tigase.server' = {
            level = ALL
        }
        'tigase.conf' = {
            level = FINEST
        }
    }
    handlers = {
        ' java.util.logging.FileHandler' = {
            level = ALL
            append = true
            count = 5
            formatter = 'tigase.util.LogFormatter'
            limit = 10000000
            pattern = 'logs/tigase.log'
        }
        'java.util.logging.ConsoleHandler' = {
            level = WARNING
            formatter = 'tigase.util.LogFormatter'
        }
    }
}

It is not required to pass all settings shown in above example - settings which you want to modify may be passed.

We also discussed that right now all string properties MUST be enclosed in quotes - this information must go in the documentation (and it must be revised that all dash properties use the quotations.

Done.

I've noticed that --trusted = http@{clusterNode} doesn't follow this rule - is it treated differently? Why 'sess-man' is quoted and other beans not?

As stated in documentation only properties/values which contain any char from specified list need to be quoted. In fact property names and bean names are not so strict about it however, we should suggest to wrap any bean names containing '+-*:/' in quotes.

As for the issue at hand - with the quoting of the strings it works.

wojciech.kapcia@tigase.net commented 7 years ago

Andrzej Wójcik wrote:

Wojciech Kapcia wrote:

Andrzej Wójcik wrote:

We should include there information which config line caused the server shutdown.

Done, added information about line causing issue and position in line.

I can only see information about the position and it's a bit burried:

  --------------------------------------
  ERROR! Terminating the server process.
  Problem initializing the server: java.lang.RuntimeException: Failed to load configuration from file etc/init-tts-ng.properties
  Please fix the problem and start the server again.
java.lang.RuntimeException: Failed to load configuration from file etc/init-tts-ng.properties
        at tigase.conf.ConfigHolder.loadFromDSLFiles(ConfigHolder.java:152)
        at tigase.conf.ConfigHolder.loadConfiguration(ConfigHolder.java:73)
        at tigase.server.Bootstrap.init(Bootstrap.java:64)
        at tigase.server.XMPPServer.start(XMPPServer.java:137)
        at tigase.server.XMPPServer.main(XMPPServer.java:119)
Caused by: java.lang.UnsupportedOperationException: Cannot substract a String at line 6 char 15
        at tigase.conf.ConfigReader.process(ConfigReader.java:344)
        at tigase.conf.ConfigReader.read(ConfigReader.java:76)
        at tigase.conf.ConfigReader.read(ConfigReader.java:84)
        at tigase.conf.ConfigHolder.loadFromDSLFiles(ConfigHolder.java:149)
        ... 4 more

Can we include actual line as well and move the information about position to more distinct place? Or better yet - have only human-readable error with line and position skipping stacktrace? (Yes, I know it's cosmetics but stacktraces gives bad impression and fishing out details what was wrong could be easier)

Part related to basic-conf is now obsolete and will be ignored;

How do we set the custom logging?

It was configured by Bootstrap class and worked only with --debug and --debug-packages entries.

After your comment I reviewed possible usages supported in previous versions of Tigase XMPP Server and added new logging bean which will be responsible for advanced configuration of logging.

Possible ways to configure logging:

  • using --debug and --debug-packages (same as before)

[...]

  • using logging bean

[...]

It is not required to pass all settings shown in above example - settings which you want to modify may be passed.

Thank you! %Daniel - can you add this to the debugging documentation in master?

Daniel Wisnewski commented 7 years ago

Added to configuration documentation. Andrzej, I pulled information for logging bean, let me know if there's any options I missed.

Andrzej Wójcik (Tigase) commented 7 years ago

I've added content of a line which caused an issue to error message and improved error reporting to make it more readable.

%Daniel Thank you for adding documentation. I've looked at it briefly and it looks that all is there.

wojciech.kapcia@tigase.net commented 7 years ago

Andrzej Wójcik wrote:

I've added content of a line which caused an issue to error message and improved error reporting to make it more readable.

  =============================================================================
  ERROR! Terminating the server process.
  Cannot substract a String at line 4 position 17
  Line: 'config-type' = --default
  Please fix the problem and start the server again.
  =============================================================================

It's great now, thanks!

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
5005
Version
tigase-server-8.0.0
Spent time
60h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#771
Please wait...
Page is in error, reload to recover