Skip to content

Latest commit

 

History

History
196 lines (132 loc) · 6.26 KB

FAQ.md

File metadata and controls

196 lines (132 loc) · 6.26 KB

Read Me > FAQ

Frequently Asked Questions

Problem #1

I'm getting following error:

unable to set up TCP listener: Permission denied (os error 13)

Solution

Try to run rts with admin privileges.

Problem #2

I'm getting following error:

unable to set up TCP listener: Address already in use (os error 48)

Solution

Some application is already using port 80. Find out PID and stop it.

sudo fuser 80/tcp # works on linux

sudo lsof -i :80 # works on macOS as well as on linux

Problem #3

I started rts on http://127.0.0.1:80, but unable to query it from local network.

Solution

Server is running on loopback device. Find out ip address of you network device and restart rts using provided ip.

ifconfig # find ip address

Problem #4

I'm not able to set cookies.

Solution

Cookies are not implemented for Rust TLS Server. As a developer you may use localStorage or sessionStorage to bypass absence of the cookies.

Problem #5

I see the following error in console output

the handshake failed: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:ssl/record/rec_layer_s3.c:1556:SSL alert number 46

Solution

Client may interrupt connection due to various reasons, most of the time you can ignore following message if you are using self-signed certificate.

Problem #6

I see the following error in console output

the handshake failed: unexpected EOF

Solution

Client may interrupt connection due to various reasons, most of the time you can ignore following message.

Problem #7

I'm not able to download files from the server by opening it in the browser

Solution

Most likely you are using self-signed certificate and as security measure browser won't let you download any files. As a solution you may obtain trusted certificate from Let's Encrypt. To do so you can use http-to-https-letsencrypt.

Alternatively you can run Rust Web Server on other port and download files over unencrypted http connection.

Problem #8

I see the following error in the console:

unable to parse request: invalid utf-8 sequence of n bytes from index m

Solution

Server received not properly encoded request in UTF-8 charset. Request may be sent from various software on your network. You can ignore this message.

Problem #9

I see the following error in the console:

unable to parse request: Unable to parse method, request uri and http version

Solution

Server received not valid request, for example it may contain a typo or ASCII invisible control characters. Request may be sent from various software on your network. You can ignore this message.

Problem #10

I see the following error in the console(Linux):

unable to set up TCP listener: Cannot assign requested address (os error 99)

Solution

Most probably you are trying to start server on port 80. To start server on port 80 try to run it as an administrator or user with admin privileges.

Problem #11

How do I start server on IPv6?

Solution

Simply start server with -ip=:: (or -i=::).

Problem #12

I have started server on ip=:: but unable to access it via fe80::... address.

Solution

Try to access the server using IPv4 inet address, from the same interface. Internally your IPv4 address will be converted to IPv6 variant [::ffff:192.168.m.n].

Problem #13

I'm trying to open directory, but getting 404 Not Found error.

Solution

Directory listing is not implemented. The reason behind this decision is security. To eliminate accidental sharing of unintended files.

As a workaround you can create html file with list of files you need to make available.

Problem 14

I'm not able to connect to server, getting error:

Failed to connect to 192.168.m.n port x after y ms: Connection refused

Solution

Most likely firewall is blocking incoming request, try to stop firewall and retry.

Problem 15

I'm not able to start server as root

Command not found

Solution

Root does not have /usr/local/bin as part of his $PATH variable. Try to start server by explicitly specifying path to rts: /usr/local/bin/rts

UPDATE 26 Dec 2022: new guideline is to install rts to /usr/bin directory.

Problem 16

I'm trying to build rts from source and getting the error:

linker 'cc' not found

Solution

You need to install development tools:

sudo dnf group install "Development Tools" #RHEL and derivatives

sudo yum install cmake make gcc #RHEL and derivatives

sudo apt-get install build-essential # Ubuntu and derivatives

sudo apt-get install make gcc cmake # Ubuntu and derivatives

sudo pacman -S base-devel # Arch Linux

Problem 17

I'm trying to build rts from source and getting the error:

Can't locate FindBin.pm in @INC (you may need to install the FindBin module)

Solution

You need to install perl:

sudo dnf install perl # RHEL and derivatives

Problem 18

While building from IDE getting error:

error[E0514]: found crate NAME compiled by an incompatible version of rustc

Solution

Usually whenever such error encountered by me, I'm performing clean and build from the console, eliminating the built-in IDE compilation, and it works fine.

cargo clean

cargo build

Problem 19

While building from IDE getting error:

error: failed to get NAME as a dependency of package `NAME VERSION

failed to load source for dependency rust-web-server

Unable to update registry crates-io

failed to fetch https://github.com/rust-lang/crates.io-index

failed open - 'PATH.git/FETCH_HEAD' is locked: Permission denied; class=Os (2); code=Locked (-14)

Solution

Usually whenever such error encountered by me, I'm performing clean and build from the console as an administrator, eliminating the built-in IDE compilation, and it works fine.

sudo cargo clean

sudo cargo build

Problem 20

While getting sources getting an error:

The following untracked working tree files would be overwritten by merge (checkout): Cargo.lock

Solution

Delete Cargo.lock, it will be regenerated automatically.

rm Cargo.lock