0

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

d-_-b
  • 4,142
  • 6
  • 28
  • 43
james800
  • 61
  • 9
  • 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 Feb 17 '17 at 07:42
  • 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 Feb 18 '17 at 08:09

1 Answers1

0

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.

Oleksandr
  • 449
  • 3
  • 7
  • Thanks for your reply. Unfortunately it is still not working. I re-did the FileAppender config, but got the same error. Here are the details of what I did: – james800 Feb 23 '17 at 05:53
  • 1. login to the ubuntu server as user ubuntu and created the directory /kaa_log_uploads. To make sure that the kaa process has the permission to write it, I changed the owner of the directory to kaa and its permission to 777. – james800 Feb 23 '17 at 05:54
  • 2. then I reconfigured the FileAppender. The config file is here https://www.dropbox.com/s/q6w1rgbe2zeuk1w/fileAppenderConfig.txt?dl=0 – james800 Feb 23 '17 at 05:56
  • 3. I started the data collection client and see the same error in the kaa log. No file is created in /kaa_log_uploads. The kaa server log is here https://www.dropbox.com/s/w0wz0ehdtgtrft5/kaa-node.log?dl=0 – james800 Feb 23 '17 at 05:58
  • any help is appreciated. Thanks. -james – james800 Feb 23 '17 at 05:58
  • Thanks Oleksandr for the update. I made the change as you suggested:# User privilege specification root ALL=(ALL:ALL) ALL kaa ALL=(ALL:ALL) ALL but still get the same exceptions. see the log file at https://www.dropbox.com/s/xpot5q3whhsfjqa/kaa-node.log?dl=0 – james800 Mar 09 '17 at 06:42
  • I checked the file /etc/sudoers on the sandbox server (AWS image), it does not have the line either. – james800 Mar 09 '17 at 06:43