I'm hosting a Python http server from a simple HTML folder on my laptop using py -m http.server
. It works fine on the browser end, (tested from computers on my LAN) but the output often says
::ffff:192.168.1.212 - - [19/Dec/2021 21:58:38] code 404, message File not found
what's with that? (obviously the date/time and local IP are often different, just pasting full line for clarification)
Asked
Active
Viewed 3,706 times
-1

Tuor
- 875
- 1
- 8
- 32
-
The browser is requesting a file that does not exist in your source directory. Most likely the favicon. Unlikely but If you don't know HTTP status codes you might want to read about them [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) – Sujal Singh Dec 20 '21 at 04:22
-
@SujalSingh it has a favicon i was wondering what file its missing. when it was missing favicon it said so, didn't say missing message file – Tuor Dec 20 '21 at 04:39
-
you could open up dev tools in your browser and check which request is getting a 404 response in the network tab. – Sujal Singh Dec 20 '21 at 04:46
1 Answers
1
Right after the error message you given, there should be another one indicating which file the browser is requesting:
$ python3 -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/) ...
::1 - - [20/Dec/2021 00:59:02] "GET / HTTP/1.1" 200 -
::1 - - [20/Dec/2021 00:59:02] code 404, message File not found
::1 - - [20/Dec/2021 00:59:02] "GET /favicon.ico HTTP/1.1" 404 -
In the above example the browser is requesting /favicon.ico
, which is not found.

Extrawdw
- 319
- 2
- 3