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

Mosh fails on downloading non existing Linux 64-bit static mosh-server binary #1963

Open
3 tasks done
mpepping opened this issue Feb 16, 2024 · 14 comments
Open
3 tasks done
Labels
bug Bug that's either related to Blink Shell or prevents the user to use the app in normal conditions.

Comments

@mpepping
Copy link

mpepping commented Feb 16, 2024

Checklist

Configuration

  • Blink v17.2.1.866 on iPadOS 17.3
  • A Red Hat Enterprise Linux 8 host (4.18.0-513.9.1.el8_9.x86_64 SMP Thu Nov 16 10:29:04 EST 2023 x86_64 x86_64 x86_64 GNU/Linux)

Describe the bug

The mosh --install-static --verbose myhost command to a 64bit linux host tries to download the mosh-server-1.4.0-linux-x86_64 static binary. This throws a 404. The actual binary name on the Github release page is mosh-server-1.4.0-linux-amd64.

mosh --install-static --verbose myhost
[..]
bootstrapMoshServer: Bootstrap failed with NoMoshServerArgs
bootstrapMoshServer: Trying Blink.InstallStaticMosh
platformAndArchitecture: uname output: ["Linux", "x86_64", ""]
getMoshServerBinary: linux x86_64
getMoshServerBinary: Downloading https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-x86_64
getMoshServerBinary: Download mismatch. Downloaded size: 9
NoChecksumMatch - Error downloading binary. The checksums do not match.
@mpepping mpepping added the bug Bug that's either related to Blink Shell or prevents the user to use the app in normal conditions. label Feb 16, 2024
@verypacific
Copy link

I can confirm the same behavior trying to connect to an unraid instance using the mosh --install-static command.
Unraid machine code also refers to

❯ uname -m    
x86_64

@mpepping mpepping changed the title Mosh fails on downloading non existing LInux 64-bit static mosh-server binary Mosh fails on downloading non existing Linux 64-bit static mosh-server binary Feb 19, 2024
@carloscabanero
Copy link
Member

Thanks for reaching out guys and apologies for the slow reply. I will review and do a quick fix for this. In the meantime, you can download it manually from Blink (using curl https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-amd64 -o .blink/mosh-server-1.4.0-linux-amd64). Blink will then take it from there and upload it to the server next time.

@carloscabanero
Copy link
Member

I can confirm the same behavior trying to connect to an unraid instance using the mosh --install-static command. Unraid machine code also refers to

❯ uname -m    
x86_64

I was actually very interested on this use case as I even saw it on Reddit, but never got to try it on uRaid. Would you mind telling me if the binary works there? Thanks!

@verypacific
Copy link

verypacific commented Feb 21, 2024

I was actually very interested on this use case as I even saw it on Reddit, but never got to try it on uRaid. Would you mind telling me if the binary works there? Thanks!

✅ I can confirm the binary you posted above does work on unraid 6.12.8 (with several NerdTools installed).

❌ The curl command method did not work though (let me know if you are interested in the verbose output)

Using the below commands and eventually saving them as a user script (running at first start of the array) made mosh working like charm

wget -O /usr/bin/mosh-server https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-amd64
chmod a+x /usr/bin/mosh-server

@Markmaster
Copy link

Thanks for reaching out guys and apologies for the slow reply. I will review and do a quick fix for this. In the meantime, you can download it manually from Blink (using curl https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-amd64 -o .blink/mosh-server-1.4.0-linux-amd64). Blink will then take it from there and upload it to the server next time.

Hi,
This is not working for me too. I'm on Ubuntu.

@carloscabanero
Copy link
Member

Thanks for reaching out guys and apologies for the slow reply. I will review and do a quick fix for this. In the meantime, you can download it manually from Blink (using curl https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-amd64 -o .blink/mosh-server-1.4.0-linux-amd64). Blink will then take it from there and upload it to the server next time.

Hi, This is not working for me too. I'm on Ubuntu.

We are working on a fix for this that should be out soon, but in the meantime you can install on your own in the server by just doing what @verypacific suggested:

wget -O /usr/bin/mosh-server https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-amd64
chmod a+x /usr/bin/mosh-server

@carloscabanero
Copy link
Member

Fixed. Will be out on 17.2.2

@verypacific
Copy link

Just updated to 17.2.2 but unfortunately the mosh static is not working.
Trying to connect to a system running unraid 6.12.8

Running the mosh --install-static command I get asked to download the binary this time.
Though when inspecting the mosh-server binary it is empty consisting of a single line only stating Not Found.
Running mosh on the server as posted above using the same binary still works like charm.

Maybe the logging below helps.

blink> mosh --install-static --verbose n1
socket_callback_connected: Socket connection callback: 1 (0)
ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey
ssh_agent_get_ident_count: Answer type: 12, expected answer: 12
bootstrapMoshServer: Trying bootstrap with sequence: [Blink.UseMoshOnPath, Blink.InstallStaticMosh], experimental: BKMoshExperimentalIP(rawValue: 0), family: nil, args: new -s -c 256 -l LANG=en_US.UTF-8 -p 60060
bootstrapMoshServer: Trying Blink.UseMoshOnPath
bootstrapMoshServer: Connecting to ~/.local/blink/mosh-server new -s -c 256 -l LANG=en_US.UTF-8 -p 60060
ssh_packet_global_request: Invalid SSH_MSG_GLOBAL_REQUEST packet
bootstrapMoshServer: Command output: bash: line 1: /root/.local/blink/mosh-server: No such file or directory

bootstrapMoshServer: Bootstrap failed with NoMoshServerArgs
bootstrapMoshServer: Trying Blink.InstallStaticMosh
platformAndArchitecture: uname output: ["Linux", "x86_64", ""]
getMoshServerBinary: linux amd64
installMoshServerBinary: on .local/blink/mosh-server
sftp_canonicalize_path: SFTP server: No such file
sftp_xstat: SFTP server: No such file
installMoshServerBinary: Path not found: .local/blink. Creating it...
sftp_xstat: SFTP server: No such file
installMoshServerBinary: File uploaded at .local/blink/mosh-server-1.4.0-linux-amd64. Moving to .local/blink/mosh-server
installMoshServerBinary: chmod +x /root/.local/blink/mosh-server
bootstrapMoshServer: Connecting to /root/.local/blink/mosh-server new -s -c 256 -l LANG=en_US.UTF-8 -p 60060
bootstrapMoshServer: Command output: /root/.local/blink/mosh-server: line 1: Not: command not found

bootstrapMoshServer: Bootstrap failed with NoMoshServerArgs
NoMoshServerArgs - Did not find mosh server startup message. (Have you installed mosh on your server?)
Use mosh1 for the deprecated (previous) mosh version.

@verypacific
Copy link

Just for reference below is what a successful attempt to use the mosh --install-static command on a system running Ubuntu 23.10 looks like.

The only difference I noticed is that there is an actual binary upload progress bar seen after I got asked to download the binary to the server.

blink> mosh --install-static --verbose upi4
socket_callback_connected: Socket connection callback: 1 (0)
ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,password
ssh_agent_get_ident_count: Answer type: 12, expected answer: 12
bootstrapMoshServer: Trying bootstrap with sequence: [Blink.UseMoshOnPath, Blink.InstallStaticMosh], experimental: BKMoshExperimentalIP(rawValue: 0), family: nil, args: new -s -c 256 -l LANG=en_US.UTF-8 -p 60040 -- byobu
bootstrapMoshServer: Trying Blink.UseMoshOnPath
bootstrapMoshServer: Connecting to ~/.local/blink/mosh-server new -s -c 256 -l LANG=en_US.UTF-8 -p 60040 -- byobu
ssh_packet_global_request: Invalid SSH_MSG_GLOBAL_REQUEST packet
bootstrapMoshServer: Command output: zsh:1: no such file or directory: /home/ubuntu/.local/blink/mosh-server

bootstrapMoshServer: Bootstrap failed with NoMoshServerArgs
bootstrapMoshServer: Trying Blink.InstallStaticMosh
platformAndArchitecture: uname output: ["Linux", "aarch64", ""]
getMoshServerBinary: linux arm64
installMoshServerBinary: on .local/blink/mosh-server
sftp_canonicalize_path: SFTP server: No such file
sftp_xstat: SFTP server: No such file
installMoshServerBinary: Path not found: .local/blink. Creating it...
sftp_xstat: SFTP server: No such file
installMoshServerBinary: File uploaded at .local/blink/mosh-server-1.4.0-linux-arm64. Moving to .local/blink/mosh-server
installMoshServerBinary: chmod +x /home/ubuntu/.local/blink/mosh-server
bootstrapMoshServer: Connecting to /home/ubuntu/.local/blink/mosh-server new -s -c 256 -l LANG=en_US.UTF-8 -p 60040 -- byobu
bootstrapMoshServer: Command output: 

MOSH CONNECT 60040 REDACTED

mosh-server (mosh 1.4.0) [build mosh 1.4.0]
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 527155]

startMoshServer: Remote Mosh server bootstrapped with params MoshServerParams(key: "REDACTED", udpPort: "60040", remoteIP: "REDACTED")

@carloscabanero
Copy link
Member

@verypacific thanks for taking a look at this so quickly. I think I may have made a rookie mistake and forgot to delete the "invalid" binaries you may already have in .blink folder. Would you mind doing so?

The flow is to download the binary if there is none (but in your case there is, although invalid) and do a checksum. Then we upload the binary to the server. But if you already have a file there, we skip the checksum and upload directly. I did it that way so people could also "automatically upload" binaries they may have from their side.

@mpepping
Copy link
Author

Same here; after the "Mosh server not found" dialog and the download attempt, ~/.local/blink/mosh-server is a zero bytes file.

@verypacific
Copy link

Hi @carloscabanero I was thinking the same too so I completely removed the ~/.local/blink folder before using the command again.

The log I posted above for unraid already shows the process of a fresh download with no file present. The upload progress bar is practically not present as the small pop-up notification is only shown for a split of a second (whereas on Ubuntu an actual upload to the server is happening)

Unfortunately it still results in the mosh-server file consisting only of a single line Not Found.

@carloscabanero
Copy link
Member

Apologies for the delay getting back on this @verypacific & @mpepping. We have 17.3.0 coming up and it is taking most of the time.

I fixed the issue of an erroneous download being kept in the file system, but unfortunately, I haven't been able to reproduce your issue. I have tried many different distros (Ubuntu, Fedora, etc...), and they are all working fine. The flow is really easy, but the thing is that except for the original message that has already been fixed, I don't see now from the logs what is the new location Blink is trying to download from that is causing the "Not Found" error message.

Can you send me the specific new line:
getMoshServerBinary: Downloading https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-xxxx

Also, it cannot happen that on the same run Blink downloads a file with "Not Found" and uploads that trash to the server. We perform a checksum validation and that would have failed. On a subsequent run though it would be uploaded - and that's what your logs show -, and is what I realized we were not doing properly and should be fixed for 17.3.0.

@mpepping
Copy link
Author

Can you send me the specific new line:
getMoshServerBinary: Downloading https://github.com/blinksh/mosh-static-multiarch/releases/latest/download/mosh-server-1.4.0-linux-xxxx

Hmm, the line is:

getMoshServerBinary: linux amd64

Blink v17.2.2.868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that's either related to Blink Shell or prevents the user to use the app in normal conditions.
Projects
None yet
Development

No branches or pull requests

4 participants