Rdesmond Rdesmond - 1 year ago 278
YAML Question

Cassandra Invalid Yaml despite valid values

I'm writing a python script in Windows that takes in a cassandra.yaml file, writes a new one with different values, then copies that file to a linux server. However, I get this error from the linux server when starting cassandra:

ERROR 00:53:03 Exception encountered during startup
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [credentials_validity_in_ms, prepared_statements_cache_size_mb, transparent_data_encryption_options, thrift_prepared_statements_cache_size_mb, column_index_cache_size_in_kb] from your cassandra.yaml
at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:188) ~[apache-cassandra-3.0.7.jar:3.0.7]
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:119) ~[apache-cassandra-3.0.7.jar:3.0.7]

I looked at the file that was copied to the linux server, below is a portion of it when viewed in vi. Does the error have to do with invalid properties like the error message says, or does it have to do with the carriage returns instead of line feed characters? Or something else entirely (can post the full yaml file if needed)?

# Validity period for credentials cache. This cache is tightly coupled to^M
# the provided PasswordAuthenticator implementation of IAuthenticator. If^M
# another IAuthenticator implementation is configured, this cache will not^M
# be automatically used and so the following settings will have no effect.^M
# Please note, credentials are cached in their encrypted form, so while^M
# activating this cache may reduce the number of queries made to the^M
# underlying table, it may not bring a significant reduction in the^M
# latency of individual authentication attempts.^M
# Defaults to 2000, set to 0 to disable credentials caching.^M
credentials_validity_in_ms: 2000^M
# Refresh interval for credentials cache (if enabled).^M

Answer Source

Does the error have to do with invalid properties like the error message says?

Yes. I think that it is related to the properties you added using your python script. I also tried to add some addition properties (which are not part of the original cassandra.yaml), but cassandra failed to start. I think it is just not allowed in cassandra.yaml

does it have to do with the carriage returns instead of line feed characters?

I don't think so. As far as this error is concerned, it clearly stated that you must not use any addition properties in cassandra.yaml.

DOS/Windows use CR-LF characters as a line separator but Linux based systems use only LF. That is why ^M characters are appearing in your vi editor. You can use dos2unix utility to remove CR characters from any file.

BTW why do you want to add these properties in cassandra.yaml file? You can create you own property file and read the configurable value from there

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download