Support Questions
Find answers, ask questions, and share your expertise

Re: Why I cannot connect to the metron rest/management UI / kafka ?

/var/log/metron/metron-rest.log:

ERROR [org.apache.curator.ConnectionState] - Connection timed out for connection string (master.localdomain:2181) and timeout (15000) / elapsed (15514)
org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss
at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:197)
at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:87)
at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:115)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.performBackgroundOperation(CuratorFrameworkImpl.java:806)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.backgroundOperationsLoop(CuratorFrameworkImpl.java:792)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.access$300(CuratorFrameworkImpl.java:62)
at org.apache.curator.framework.imps.CuratorFrameworkImpl$4.call(CuratorFrameworkImpl.java:257)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Re: Why I cannot connect to the metron rest/management UI / kafka ?

@Jasper

Due to other things delayed for a few days

This is metron-rest.log:

log4j:ERROR Could not read configuration file from URL [file:/usr/metron/0.4.1/config/log4j.properties].
java.io.FileNotFoundException: /usr/metron/0.4.1/config/log4j.properties (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:557)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:189)
at org.apache.metron.rest.MetronRestApplication.main(MetronRestApplication.java:27)
log4j:ERROR Ignoring configuration file [file:/usr/metron/0.4.1/config/log4j.properties].
log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Super Collaborator

@bigdata smalldata

It says it can't find the log4j.properties file you assigned it. That file does not exist out-of-the-box after a Metron install you have to create it.

Please make sure the file at '/usr/metron/0.4.1/config/log4j.properties' exists and is readable/writable to Metron daemon user.

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Explorer

I have the same issue. even though I changed the spring configuration in application.yml to mysql I could still see the error referring to org.h2.jdbc.JdbcSQLException while my config in application.yml:

spring:
datasource:   
driverClassName: com.mysql.jdbc.Driver   
url: jdbc:mysql://myhost:3306/metronrest   
username: metron  
password: metron

debugging log shows

...

2017-08-17T15:29:49.938 DEBUG [org.springframework.security.web.FilterChainProxy] - /api/v1/user at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter' 2017-08-17T15:29:49.938 DEBUG [org.springframework.security.web.authentication.www.BasicAuthenticationFilter] - Basic Authentication Authorization header found for user 'metron' 2017-08-17T15:29:49.938 DEBUG [org.springframework.security.authentication.ProviderManager] - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider 2017-08-17T15:29:49.939 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing prepared SQL query 2017-08-17T15:29:49.939 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing prepared SQL statement [select username,password,enabled from users where username = ?] 2017-08-17T15:29:49.939 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC Connection from DataSource 2017-08-17T15:29:49.940 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource 2017-08-17T15:29:49.940 DEBUG [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Translating SQLException with SQL state '42S02', error code '42102', message [Table "USERS" not found; SQL statement: select username,password,enabled from users where username = ? [42102-192]]; SQL was [select username,password,enabled from users where username = ?] for task [PreparedStatementCallback] 2017-08-17T15:29:49.940 DEBUG [org.springframework.security.authentication.DefaultAuthenticationEventPublisher] - No event was found for the exception org.springframework.security.authentication.InternalAuthenticationServiceException 2017-08-17T15:29:49.940 DEBUG [org.springframework.security.web.authentication.www.BasicAuthenticationFilter] - Authentication request for failed: org.springframework.security.authentication.InternalAuthenticationServiceException: PreparedStatementCallback; bad SQL grammar [select username,password,enabled from users where username = ?]; nested exception is org.h2.jdbc.JdbcSQLException: Table "USERS" not found; SQL statement: select username,password,enabled from users where username = ? [42102-192] 2017-08-17T15:29:49.940 DEBUG [org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint] - Trying to match using RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]

it seems it's still trying to use h2?

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Super Collaborator

@Frank Kam

I think you are missing

platform : mysql

Now it is unknown what connection to choose and H2 is the default

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Explorer

@Jasper

THANKS for the hint! In fact it was missing from the HCP documentation.

Important to mention the order in which it appears is crucial: here my yaml configuration file (spring section) that is finally working and I'm able to connect to metron UI :)

spring:
  jpa:
    database: MYSQL
    hibernate:
      ddl-auto: update
  datasource:
    platform: mysql
    url: jdbc:mysql://myhost.localdomain:3306/metronrest
    driverClassName: com.mysql.jdbc.Driver
    username: metron
    password: metron

Cheers!

Frank.

Re: Why I cannot connect to the metron rest/management UI / kafka ?

What documents do you refer to? HCP needs to be installed after the installation of metron?

Can you provide a link to the documentation for your reference? My action are based on bare metal .

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Super Collaborator

@bigdata smalldata HCP installs and manages Metron for you from Ambari.

You can find the documentation here: HCP

Re: Why I cannot connect to the metron rest/management UI / kafka ?

Super Collaborator

@bigdata smalldata could you set the question to answered (by selecting the best anwser) if sufficiently answered?