Error 503 and favicon.ico

4,823 views
Skip to first unread message

M. Jointly

unread,
Apr 5, 2016, 3:59:47 AM4/5/16
to Tornado Web Server
I have simplest hello-world application. It is correctly if it is run locally. But the app show an error on Heroku. The error is "Failed to load resource: https://vast-harbor-19423.herokuapp.com/favicon.ico the server responded with a status of 503 (Service Unavailable)"
This is python code:
import tornado.ioloop
import tornado.web
import tornado.websocket

class Hello(tornado.websocket.WebSocketHandler):
   
def open(self):
       
self.write_message("Hello, world")

   
def on_message(self, message):
       
pass

   
def on_close(self):
       
pass

class Main(tornado.web.RequestHandler):        
   
def get(self):
       
self.render("hello.html")

application
= tornado.web.Application([
   
(r"/", Main),
   
(r"/websocket", Hello),
])

if __name__ == "__main__":
    application
.listen(8888)
    tornado
.ioloop.IOLoop.instance().start()

This is hello.html:
<!DOCTYPE html>
<html>
<head>
   
<title>Tornado Hello</title>    
</head>
<body>
 
<h1>Hello World from Tornado</h1>
 
<script>
 ws
= new WebSocket("ws://vast-harbor-19423.herokuapp.com/websocket");
 ws
.onmessage = function(e) {
    alert
('message received: ' + e.data);
 
};
 
</script>
</body>
</html>

How can I solve the problem?

M. Jointly

unread,
Apr 5, 2016, 4:03:59 AM4/5/16
to Tornado Web Server

There is the favicon.ico file in the root of the app folder.

Ben Darnell

unread,
Apr 5, 2016, 10:26:15 PM4/5/16
to Tornado Mailing List
I'm not sure where this 503 is coming from - could it be coming from heroku? There may be a favicon.ico file in the app folder, but you haven't told tornado to do anything with that file. A request for /favicon.ico on this tornado server will result in a 404, not a 503. You need to set static_path in the Application constructor to serve static files like favicon.ico.

On Tue, Apr 5, 2016 at 4:03 AM, M. Jointly <keyt...@gmail.com> wrote:

There is the favicon.ico file in the root of the app folder.

--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mikhail Visloguzov

unread,
Apr 6, 2016, 5:47:38 AM4/6/16
to python-...@googlegroups.com
Thank you, Ben! It works. I added static_path var, static folder and moved favicon in the folder. 

--
You received this message because you are subscribed to a topic in the Google Groups "Tornado Web Server" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python-tornado/4pfNm9TKAyw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python-tornad...@googlegroups.com.

MARWEN bentalebali

unread,
Jun 25, 2017, 5:31:27 PM6/25/17
to Tornado Web Server

I am creating a GWT project from the GWT Material official website using maven. I am following the tutorial offered by the site. Im getting this in the view page:

HTTP ERROR: 503
Problem accessing /index.html. Reason:
Service Unavailable
Powered by Jetty://

I tried all the solution proposed here but I failed to view the project homepage.

There is no error in the eclipse console. but when inspecting the home page im getting this error:

Voice Instead ready.
content.js:29 Object
favicon.ico Failed to load resource: the server responded with a status of 503 (Service Unavailable)
    enter code here

Ben Darnell

unread,
Jun 30, 2017, 1:16:20 PM6/30/17
to Tornado Web Server
Hi Marwen,

It looks like you've found the wrong forum. This one is about the Tornado web framework; you need a forum about GWT and/or Jetty.

-Ben

--
Reply all
Reply to author
Forward
0 new messages