Debugging OSS Teleport with Dlv and VSCode #5629
stevenGravy
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you're experiencing an issue or just curious here are steps to setup debugging with Teleport OSS. The examples here were done in a Ubuntu 20.04.2.0 desktop env on Teleport V6 alpha-2. This example shows running with
sudo
. You can certainly run withoutsudo
if you choose not to do assh_service
and use folders your user owns.Ex Debugging:
Prerequisites:
make
sudo
rights on the machine1. Clone the current master
If you are investigating an issue on a particular version pull that branch.
2. Confirm Teleport build
make full
should produce Teleport executes in
build
folder withtctl
,teleport
, andtsh
.3. Configure Teleport.yaml
If you don't already have a teleport instance here is a sample configuration to start with.
/etc/teleport.yaml
Build with Debug enabled
Open VSCode
Add a attach option
Start Teleport with dlv
Return to VSCode and Start Attach
Set a breakpoint in function
CheckAndSetDefaults
inlib/auth/resetpasswordtoken.go
or another location you're interested in.Start the Attach launch configuration. You may need to do Restart on the debug menu to start Teleport.
Create a user and then reset
The breakpoint will be triggered.
Step through or continue.
Ready to exit
When you're ready to exit
Additional:
If you'd like to run or debug from VSCode directly you can configure other launch configurations.
Open the
tool/tsh/tsh.go
and run this Launch configuration.Beta Was this translation helpful? Give feedback.
All reactions