rbspy: Error "No stack counts found" when trying to profile ruby 2.6.3 by pid
I ran rbspy record --pid 35 and got the error:
Press Ctrl+C to stop
Wrote raw data to /root/.cache/rbspy/records/rbspy-2019-08-29-E3Qc4TJIj7.raw.gz
Writing formatted output to /root/.cache/rbspy/records/rbspy-2019-08-29-cTpezCRXzx.flamegraph.svg
[2019-08-29T17:04:44Z ERROR inferno::flamegraph] No stack counts found
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: InvalidData, error: StringError("No stack counts found") })', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
This was in a docker container on kubernetes, but i don’t think that should matter since i’m running rbspy in the same container as the process i’m trying to profile.
Running with rbspy record cmd does work, but isn’t very useful for us since the process i’m trying to look at is a web server that spawns 2 other processes which do the actual work.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (3 by maintainers)
I had the same problem and found help in the gitter chat room: If you are using docker you have to add
--cap-add=SYS_PTRACEtodocker runor something similar in your docker-compose file.I support the suggestion from the chatroom that this should be documented somewhere.
Same issue on a Mac, not using docker, using
rbenv:MacOS 10.14.6 Ruby 2.6.1 via
rbenvThanks for working on this amazing project, you are awesome ❤️
With the release of rbspy 0.6, we should print more specific errors instead of “No stack counts found”. We’ve also fixed several initialization bugs that may have been the root cause for some of you. If you still have trouble after upgrading, please open a new issue with the specific error message that you’re getting.
Thanks for your patience and feedback, everyone 👍
I’m getting the same error with ruby 2.5.1 on ubuntu linux:
I’m trying to profile a running
sidekiqprocess:with this output
IIRC you need to run as root on linux
No problem, I definitely omitted some important details.
I was using ruby 2.6.4 installed with rbenv:
The error is not intermittent for me, to generate the flamegraphs in my PR I actually started the ruby script on the side and used
sudo rbspy record --pid xxxxinstead, this version worked without problem for me (requires root access though).I tried running
rbenv recordwith the command as root but as I don’t have any root install ofrubythis doesn’t work at first:(error message is also not great here ^^ but a bit better)
But if I specify the exact path from rbenv user-land install or ruby, like this:
Then it works fine, with the debug mode enabled I managed to catch this before the interface switches to stackframes but as this is working fine I guess not very helpful:
I also tried with the same exact ruby path without sudo but got the same error:
with
RUST_LOG=debugI don’t see more output:And with
RUST_BACKTRACEI get the same - I believe - unhelpful backtrace already shown before which is only related to the lack of data:I have same problem.