I tried to install karafka-web ui and managed to complete all the steps written in the docs. I also manage to view the database via localhost:3000/karafka
But when i try to run karafka server by running bundle exec karafka server i got error :
gems/karafka-web-0.7.3/lib/karafka/web/tracking/consumers/sampler.rb:253:in `memory_threads_ps': undefined method `split' for nil:NilClass (NoMethodError)
.split("\n")
^^^^^^
Its weird since i can run this on my terminal :
❯ ps -A -o rss=,thcount,pid
ps: thcount: keyword not found
PID
18784 1
16160 80
7296 82
1120 84
5600 85
7056 89
7072 91
but in rails console :
irb(main):001> @shell = Karafka::Web::Tracking::MemoizedShell.new
=> #<Karafka::Web::Tracking::MemoizedShell:0x0000000113c3bea0 @accu={}>
irb(main):002> @shell.call('ps -A -o rss=,thcount,pid')
ps: thcount: keyword not found
ps: thcount: keyword not found
ps: thcount: keyword not found
ps: thcount: keyword not found
=> nil
irb(main):003>
I tried to modify sampler.rb and it works, heres the snippet :
# Loads our ps results into memory so we can extract from them whatever we need
def memory_threads_ps
@memory_threads_ps = case RUBY_PLATFORM
when /darwin|bsd|linux/
@shell
.call('ps -A -o rss=,pid')
.split("\n")
.map { |row| row.strip.split(' ').map(&:to_i) }
else
@memory_threads_ps = false
end
end
the difference is in the call method, i removed the thcount
I tried to install karafka-web ui and managed to complete all the steps written in the docs. I also manage to view the database via
localhost:3000/karafka
But when i try to run karafka server by runningbundle exec karafka server
i got error :Its weird since i can run this on my terminal :
but in rails console :
Expected behavior
Karafka server run without problem
Actual behavior
exception thrown and karafka server not working
Steps to reproduce the problem
bundle exec karafka server
Your setup details
karafka info
Quickfix
I tried to modify
sampler.rb
and it works, heres the snippet :the difference is in the call method, i removed the
thcount