tornadoweb / tornado

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
http://www.tornadoweb.org/
Apache License 2.0
21.68k stars 5.5k forks source link

Error in 'blog' demo --- can't open blog.py #2870

Open rocapp opened 4 years ago

rocapp commented 4 years ago

I'm unable to build the 'blog' demo application using docker-compose up. I'm definitely not a docker expert, so it could just be an easy fix.

I try to run docker-compose up in the demos/blog directory, but the build fails because of an unknown option for the iptables command during postgres configuration ( docker0: iptables v1.8.4 (legacy): unknown option "--\dport" ).

Below is the full output from docker-compose up:

[robertc@Z38S blog]$ docker-compose up                                                                                                                                                          
Starting blog_postgres_1 ...                                                                                                                                                                    
WARNING: Host is already in use by another container                                                                                                                                            

ERROR: for blog_postgres_1  Cannot start service postgres: driver failed programming external connectivity on endpoint blog_postgres_1 (7fc11caf4be5a390d6ccdced928c5ea11d1768090d32b3b0709d41e\
d571e00bd):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 32797 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables v1.8.4 (legacy): unknown option "--\
dport"                                                                                                                                                                                          
Try `iptables -h' or 'iptables --help' for more information.                                                                                                                                    
 (exit status 2))                                                                                                                                                                               

ERROR: for postgres  Cannot start service postgres: driver failed programming external connectivity on endpoint blog_postgres_1 (7fc11caf4be5a390d6ccdced928c5ea11d1768090d32b3b0709d41ed571e00\
bd):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 32797 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables v1.8.4 (legacy): unknown option "--dport"  
Try `iptables -h' or 'iptables --help' for more information.                                                                                                                                    
 (exit status 2))                                                                                                                                                                               
ERROR: Encountered errors while bringing up the project.

Edit: This could be related to this issue. I'll check to see if the suggested fix (symlink iptables-nft) works later today.

rocapp commented 4 years ago

postgres now loads after applying the fix suggested (see above), but I'm still having trouble getting the blog demo to work properly with docker-compose up.

Output now:

[robertc@Z38S blog]$ docker-compose up                                                                                                             
Starting blog_postgres_1 ...                                                                                                                       
Starting blog_blog_1     ...                                                                                                                       
Attaching to blog_postgres_1, blog_blog_1                                                                                                          
postgres_1  | 2020-06-01 21:41:24.620 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432                                                 
postgres_1  | 2020-06-01 21:41:24.620 UTC [1] LOG:  listening on IPv6 address "::", port 5432                                                      
postgres_1  | 2020-06-01 21:41:24.624 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"                                   
postgres_1  | 2020-06-01 21:41:24.645 UTC [23] LOG:  database system was shut down at 2020-06-01 20:54:53 UTC                                      
postgres_1  | 2020-06-01 21:41:24.648 UTC [1] LOG:  database system is ready to accept connections                                                 
blog_1      | python3: can't open file 'blog.py': [Errno 2] No such file or directory                                                              
blog_blog_1 exited with code 2