[root@localhost appp_dai]# python3 run_app.py
Traceback (most recent call last):
File “run_app.py”, line 33, in < module>
app. The run (debug = True, the host = ‘0.0.0.0’, the port = 5000)
the File “/ usr/local/python3/lib/python3.6/site – packages/flask/app. Py”, line 841, in the run
run_simple(host, port, self, **options)
the File “/ usr/local/python3/lib/python3.6/site – packages/werkzeug/serving. Py”, line 795, in run_simple
s.b ind (get_sockaddr (hostname, port, address_family))
OSError: [Errno 98] Address already in use
[root@localhost appp_dai]#
ps -elf|grep 500
4 S root 14674 14513 0 80 0-47537 futex_ April 02?00:00:00/usr/libexec/docker/docker – proxy – current proto TCP – host – IP 0.0.0.0 – host – port 50070 – container – IP 172.17.0.2 – container – port 50070
0 S root 17743 1076 0 80 0-28170 pipe_w 18:34 PTS /0 00:00:00 grep –color=auto 500
[root @ localhost appp_dai] #
[root@localhost appp_dai]#
net
netreport netstat
[root@localhost appp_dai]#
netstat -tlnp|grep 5000
TCP 0 0 0.0.0.0:5000 0.0.0.0: * LISTEN 2345/python
[root@localhost appp_dai]#
kill -9 2345
[root@localhost appp_dai]#
netstat -tlnp|grep 5000
[1]+ python run_app.py killed
View all ongoing processes on the machine
[root@localhost appp_dai]# ps -elf|grep 500
View the native 5000 port process
[root@localhost appp_dai]# netstat -tlnp|grep 5000
Reason: Close the IDE without stopping the project.
Or the previous project did not stop and the project was run again.
Solution: The former is simple and kills the process. The latter is easier to stop a project that is running.
The order to kill the process (a little insulting to everyone’s intelligence, but to add) :
lsof -i :
5000
This command is for the hostport5000 I am using. Please change it by yourself.
1
If you are viewing all ongoing processes on the machine:
ps aux
# See all processes with PS-A
1
Kill process:
kill
–
9
PID
# PID is the process number, which is displayed when viewing a process, such as 23645
Read More:
- Solution to the problem that listen TCP 0.0.0.0:3306: bind: address already in use port is occupied in Linux centos7
- Python failed to use PIL writer library. TTF, etc. oserror: cannot open resource
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Solve the oserror: [errno 22] invalid argument: ‘u202ad’ in Python
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- Failed to set up listener: socketexception: address already in use
- What should be paid attention to in socket programming — bind socket error: address already in use
- Error starting userland proxy: listen TCP 0.0.0.0:9000: Listen: address already in use
- Error: listen eadrinuse: address already in use
- Kill the specified port CMD command line taskkill in window
- error: <class ‘OSError‘>, [Errno 97] Address family not supported by protocol
- Error running ‘Tomcat 9‘: Address localhost:1099 is already in use
- docker Error creating default “bridge“ network: failed to allocate gateway Address already in use
- Eclipse port occupied( java.net.BindException : address already in use: bind) solution
- [exception] address already in use: bind
- How to Solve failed Precondition Error: attempting to use uninitialized value beta1_power
- JMeter: java.net.bindexception: address already in use: connect solution
- Error: transport error 202: bind failed: address already in use
- Some error occurred error: listen eaddinuse: address already in use 127.0.0.1:3000
- The @ Autowired annotation in springboot is invalid in ordinary classes. How to solve and use the null pointer exception java.lang.nullpointerexception