0
votes

I am running kaa 0.10 on ubuntu 14. When I choose File appender, I do not see any log file created. The kaa log at /var/log/kaa has the exception:

2017-02-16 22:10:47,890 [EPS-log-dispatcher-10] TRACE o.k.k.s.c.l.s.a.AbstractLogAppender - Avro header record converter [org.kaaproject.kaa.common.avro.GenericAvroConverter@6ee5ba4b]
2017-02-16 22:10:47,890 [EPS-log-dispatcher-10] DEBUG o.k.k.s.a.f.a.FileSystemLogAppender - [/home/ubuntu/log/null/null] saving 5 objects
2017-02-16 22:10:47,891 [EPS-log-dispatcher-10] ERROR o.k.k.s.a.f.a.FileSystemLogAppender - [DataCollectionFileAppender] Attempted to append logs failed
java.lang.NullPointerException: null
        at org.kaaproject.kaa.server.appenders.file.appender.LogbackFileSystemLogger.append(LogbackFileSystemLogger.java:92) ~[file-appender-0.10.0.jar:na]
        at org.kaaproject.kaa.server.appenders.file.appender.FileSystemLogAppender.doAppend(FileSystemLogAppender.java:63) ~[file-appender-0.10.0.jar:na]
        at org.kaaproject.kaa.server.common.log.shared.appender.AbstractLogAppender.doAppend(AbstractLogAppender.java:74) [log-shared-0.10.0.jar:na]
        at org.kaaproject.kaa.server.operations.service.akka.actors.core.ApplicationLogActorMessageProcessor.lambda$processLogEventPack$0(ApplicationLogActorMessageProcessor.java:111) [kaa-node-0.10.0.jar:na]
        at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_121]
        at org.kaaproject.kaa.server.operations.service.akka.actors.core.ApplicationLogActorMessageProcessor.processLogEventPack(ApplicationLogActorMessageProcessor.java:111) [kaa-node-0.10.0.jar:na]
        at org.kaaproject.kaa.server.operations.service.akka.actors.core.ApplicationLogActor.onReceive(ApplicationLogActor.java:59) ~[kaa-node-0.10.0.jar:na]

Here is my File appender configuration:

{"publicKey":"AAAAB3NzaC1yc2EAAAABJQAAAQEA4Tp8W48b31VDlb9ARbqpsK8dwER3d+OD8gOp7H8kwPBj6IICZILYVsns3ngAHJtJYOEkGCPlOMudF8iWtmdkcEvVo7X/Nrvn//MW7ze36B7rUx0u86jBS4Cg19GxCtKG2LnyEp0Rk+9YvEfI99kFxmRoT3yHrtwWxkQ7fxfLQ4AUuhdBlpeoepYksoNWpy0CNdAEL6vzI3nl+EaQcesdNgUu6LlUzOl7Z3Qo8sOXCfSHvACzMnfVfEMOmO7arHmDcIlegb7stuCUE5YuuKbGofeEAwuARLROwlvHfeMJPhpHOv6+Q/39SZLqu+FfWDdrGEn9+9+UGAlZ2iN6SYYD7w==","logsRootPath":"/home/ubuntu/log","rollingFileNamePatern":"logFile.%d{yyyy-MM-dd}.log","rollingMaxHistory":30,"triggerMaxFileSize":"1GB","encoderPattern":"%-4relative[%thread]%-5level%logger{35}-%msg%n","minLogSchemaVersion":1,"maxLogSchemaVersion":2147483647,"pluginTypeName":"File","pluginClassName":"org.kaaproject.kaa.server.appenders.file.appender.FileSystemLogAppender","headerStructure":["Timestamp","Logschemaversion"]}

I tried the same configuration in the kaa sandbox which worked fine. But I cannot make it work on my own server.

Please help. Thanks.

James

1
It seems that the problem is the path where kaa creates the log files: /home/ubuntu/log/null/null. On the kaa sandbox, I can see that the two nulls should be tenant and application. Any thoughts what could be wrong on my own server?james800
a prior error is the following: 2017-02-18 00:01:29,699 [EPS-log-dispatcher-10] ERROR o.k.k.s.a.f.a.FileSystemLogAppender - Failed to init file system log appender: java.lang.RuntimeException: Process returned bad exit value: 1 at org.kaaproject.kaa.server.appenders.file.appender.FileSystemLogEventServiceImpl.executeCommand(FileSystemLogEventServiceImpl.java:52) ~[file-appender-0.10.0.jar:na] at org.kaaproject.kaa.server.appenders.file.appender.FileSystemLogEventServiceImpl.prepareScriptFile(FileSystemLogEventServiceImpl.java:136) ~[file-appender-0.10.0.jar:na]james800

1 Answers

0
votes

You got an ERROR o.k.k.s.a.f.a.FileSystemLogAppender - Failed to init file system log appender:.. Looks like the file system log appender was not initialised because log directory "logsRootPath":"/home/ubuntu/log" was not created. Create "/home/ubuntu/log" directory manually and after that add your File system log appender at Administration UI page.

Update:

Looks like user 'kaa' has not privileged to create 'Logs root path' directory. I have created an issue to improve the File system log appender documentation. See the issue description for details and add line

kaa ALL=(ALL:ALL) ALL

to the /etc/sudoers file.