Project

General

Profile

Bug #5005

Disabling components makes server fail to start

Added by Wojciech Kapcia TigaseTeam almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
Due date:
2017-04-10
% Done:

100%

Estimated time:
Database:
n/a
Applicable version:
git/master
Source Code Disclaimer:

Description

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}

Related issues

Related to Tigase XMPP Server - Feature #835: Expanding configuration variables in init.properties.Closed2012-09-162017-03-13

Associated revisions

Revision 50778b7d (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

#5005: fixing issue with conversion of old configuration file to new format

Revision a85f3241 (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

#5005: added support for advanced configuration of logging

Revision 198689da (diff)
Added by Daniel Wisnewski IoT 1 Cloud almost 2 years ago

#5005 Added Custom DSL Logging Configuration Page.

Revision d30ccc93 (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

#5005: added content of a config line which caused an issue to error message

Revision 9483d5fb (diff)
Added by W Administrator over 1 year ago

#5005 fix debug configuration not being correctly applied

History

#2 Updated by Wojciech Kapcia TigaseTeam almost 2 years ago

Possibly related to #835

#3 Updated by Wojciech Kapcia TigaseTeam almost 2 years ago

  • Related to Feature #835: Expanding configuration variables in init.properties. added

#4 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

  • Status changed from New to In QA
  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia

#6 Updated by Wojciech Kapcia TigaseTeam almost 2 years ago

  • Status changed from In QA to Feedback
  • Assignee changed from Wojciech Kapcia to Andrzej Wójcik

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.

#7 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

  • Due date set to 2017-04-10
  • Start date deleted (2017-03-07)

#8 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

  • Status changed from Feedback to In QA
  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia

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.

#9 Updated by Wojciech Kapcia TigaseTeam almost 2 years ago

  • Status changed from In QA to Feedback
  • Assignee changed from Wojciech Kapcia to Andrzej Wójcik

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?

#10 Updated by Daniel Wisnewski IoT 1 Cloud almost 2 years ago

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

#11 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia

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.

#12 Updated by Wojciech Kapcia TigaseTeam almost 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

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!

Also available in: Atom PDF