Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos ssh pty error #114

Open
celestial-30 opened this issue Apr 22, 2022 · 8 comments
Open

Macos ssh pty error #114

celestial-30 opened this issue Apr 22, 2022 · 8 comments

Comments

@celestial-30
Copy link

celestial-30 commented Apr 22, 2022

Running sampler on darwin. Installed via homebrew.

Attempting to include a box that connects to local server via ssh. Copied config from github page as follows.

textboxes:
  - title: SSH
    pty: true
    init: ssh -i ~/.ssh/id_rsa [email protected]
    sample: top

With the server address replaced with the appropriate username and address.

This returns the error:

┌──────────────────────────────────────────────────────────────────┐     │
│     │                         SAMPLING FAILURE                         │     │
│     │    fork/exec /bin/sh: Setctty set but Ctty not valid in child    │     │
│     └──────────────────────────────────────────────────────────────────┘panic: runtime error: invalid memory address or nil pointer dereference              │
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x102505a98]     │
│                                                                              │
goroutine 37 [running]:                                                        │
io.WriteString(0x0, 0x0, 0x140001c4098, 0x5, 0x0, 0x140001c4098, 0x5)──────────┘
	/opt/homebrew/Cellar/go/1.15.6/libexec/src/io/io.go:311 +0xa8
github.com/sqshq/sampler/data.(*PtyInteractiveShell).execute(0x140001dc190, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/sampler-20201225-38055-jays8r/sampler-1.1.0/data/int_pty.go:70 +0xdc
github.com/sqshq/sampler/data.(*Item).nextValue(0x14000192080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)config.ymlet alerts   (<->) selection   (p) pause   (q) quit
	/private/tmp/sampler-20201225-38055-jays8r/sampler-1.1.0/data/item.go:57 +0x58
github.com/sqshq/sampler/data.(*Sampler).sample(0x140000bc7e0, 0x14000192080, 0x140000a0720, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/sampler-20201225-38055-jays8r/sampler-1.1.0/data/sampler.go:59 +0x44
created by github.com/sqshq/sampler/data.NewSampler.func1
	/private/tmp/sampler-20201225-38055-jays8r/sampler-1.1.0/data/sampler.go:35 +0x78

My terminal also does not accept scrolling or clicking after this error, instead writing the codes for those actions to the prompt. This continues until I reload or switch my shell.

This error does not occur if i remove pty: true, however, if i do so it instead brings up the wake text of the server.

I believe this is caused by some issue with the pseudoterminal, But I am not experienced enough on that subject to provide any more meaningful analysis. If you need any more information please let me know.

@celestial-30
Copy link
Author

I do not know if sampler produces logs, if it does, does anyone know where to find them?

@EsEnZeT
Copy link

EsEnZeT commented Sep 30, 2022

I confirm having exact same issue.

@oversize
Copy link

I can also confirm this exact error. Installed via brew and tried to run the ssh example..

@gregfr
Copy link

gregfr commented Nov 20, 2022

I've having the same issue, but on Ubuntu (however also installed with Brew).
The term is messed up until I type "reset".

@zliebersbach
Copy link

Same bug here! Would love this for monitoring my dev environment but sadly is unusable without PTY feature for me.

@sikmir
Copy link

sikmir commented Dec 7, 2023

I have the same problem on macos and linux(

@bebsworthy
Copy link

Proposed fix here: #134.
The issue seems to have been fixed in creak/pty but sampler is using an older fork kr/pty. The pr change the dependency to the upstream project creak/pty. It solves the issue for me.

@sikmir
Copy link

sikmir commented Mar 21, 2024

Proposed fix here: #134. The issue seems to have been fixed in creak/pty but sampler is using an older fork kr/pty. The pr change the dependency to the upstream project creak/pty. It solves the issue for me.

It works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants