LeKovr / webtail

Tail logfile via websocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Permission issue?

user9931 opened this issue · comments

When trying to open files for reading which the user under which the program is running does not have enough rights - such an error


{"level":"info","ts":1632208342.6051297,"caller":"webtail/tail.go:172","msg":"Tailer started","channel":"apt/term.log"}
{"level":"info","ts":1632208342.605446,"caller":"webtail/hub.go:302","msg":"Send reply","message":"{\"type\":\"attach\",\"channel\":\"apt/term.log\",\"data\":\"success\"}"}
{"level":"info","ts":1632208342.6057656,"caller":"webtail/tail.go:168","msg":"tailworker close"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x241f68]

goroutine 50 [running]:
github.com/LeKovr/webtail.tailWorker.run(0x2494680, 0x2882200, 0x369c94, 0x249ebd0, 0x2890120, 0x2884140, 0xc, 0x2882180, 0x24a8690)
        /opt/src/github-my.go/webtail/tail.go:177 +0x200
created by github.com/LeKovr/webtail.(*TailService).TailerRun
        /opt/src/github-my.go/webtail/tail.go:154 +0x214

and app are closes. If we fix permissions someway the app works as it intended.
dont know if there's some useful in those lines but that problem can be easily reproduced.

@thehotery , thank you for reporting.
Ofcourse this error must be handled.
Client will receive "worker create error" If file is not readable, and tailing will be working after permission fix & page reload