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

ttyplay can break with ZSTD_decompressStream() error on ttyd/ttyrec/tmux chain #33

Open
amsnek opened this issue Sep 18, 2023 · 2 comments

Comments

@amsnek
Copy link

amsnek commented Sep 18, 2023

Hello again!

Now that ttyrec works even better with -Z and -a i noticed the following issue with ttyrec (or maybe ttyplay) in a very specific setup/use case. This may not be the fault of ttyrec/ttyplay, in which case feel free to close.

I am using ttyrec in a chain with ttyd (https://github.com/tsl0922/ttyd/) and tmux
for example: ttyd -> ttyrec -> tmux -> bash
simplified setup:
/usr/local/bin/ttyd.x86_64 -p 4200 /usr/local/bin/ttyrec -a -Z -f /logs/ttyrec_test -- /usr/local/bin/tmux new -A -s ttyrec_recording /bin/bash

-> connect via browser: http://:4200/

when a second browser connects -> the recording borks (or maybe ttyplay) with errors like
ZSTD_decompressStream() error: Data corruption detected
ZSTD_decompressStream() error: Unknown frame descriptor

This also happens without compression/append so that is probably not to cause.

The error does not occur if the chain is swapped:
for example: ttyd -> tmux -> ttyrec -> bash

however, then the recorded "lines" are often multiline/broken (e.g top) and the recording is not 1:1 or as "clean" as the other way round.

@speed47
Copy link
Contributor

speed47 commented Oct 2, 2023

Hey @amsnek,

Your use case is interesting! Glad to see that ttyrec can be of use for this.

When you don't use compression (by not using -Z), ttyplay should not call ZSTD_decompressStream, so I'm wondering whether this is due to the fact that you did not use -Z but still named your ttyrec file something.zst, because ttyplay has a logic where it automatically tries to decompress uzind zstd for files ending in .zst

@amsnek
Copy link
Author

amsnek commented Oct 2, 2023

hello, no, the files/recording do not have .zst extension. I admit the Problem is really weird, and i suspect the second connection joining the terminal somehow introduces some artifact that breaks the recording. I am not sure how to provide usefull information though (please let me know if there is something that would be usefull to) other then the procedure howto reproduce it.

Please let me know if i can provide anything usefull or if the should close it :)

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

2 participants