Comments (18)
@chr15m so that was it! Works now.
from piku.
Just did a netstat -lptn
under the piku
user and got this... 😕
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
from piku.
Will see if I can replicate.
from piku.
Are there multiple instances of uwsgi emperor running?
from piku.
how can I tell that?
from piku.
this is the only piku app running on a clean install.
from piku.
piku@pikuserver:/home/pi $ ps aux | grep python
piku 5165 0.0 1.3 21272 13168 ? Ss 13:54 0:02 python3 /home/piku/piku.py logs myapp
piku 5723 0.0 0.0 1940 368 ? Ss 14:15 0:00 /bin/sh -c python3 myapp.py
piku 5724 0.3 1.9 27572 19820 ? S 14:15 0:03 python3 myapp.py
piku 5736 0.1 1.3 21272 13180 ? Ss 14:15 0:01 python3 /home/piku/piku.py logs myapp
piku 5884 0.0 0.0 7348 524 pts/0 S+ 14:31 0:00 grep --color=auto python
piku@pikuserver:/home/pi $ ps aux | grep uwsgi
piku 4459 0.0 0.9 52236 9012 ? S 12:11 0:00 uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini --daemonize /home/piku/.piku/uwsgi/uwsgi.log --pidfile /home/piku/.piku/uwsgi/uwsgi-piku.pid
piku 4461 0.0 0.3 45940 3460 ? S 12:11 0:00 uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini --daemonize /home/piku/.piku/uwsgi/uwsgi.log --pidfile /home/piku/.piku/uwsgi/uwsgi-piku.pid
piku 4471 0.0 1.0 117764 10980 ? Sl 12:11 0:00 uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini --daemonize /home/piku/.piku/uwsgi/uwsgi.log --pidfile /home/piku/.piku/uwsgi/uwsgi-piku.pid
piku 5886 0.0 0.0 7348 468 pts/0 S+ 14:32 0:00 grep --color=auto uwsgi
from piku.
so...
- piku destroy myapp
- rebooted rpi
- git push piku master
still getting the "port in use"... :(
going to try one of the simple sample apps next...
from piku.
You definitely have two copies running there - there are two instances of python3 /home/piku/piku.py logs myapp
in your process table.
How are you starting up Piku? Automatically on boot? Manually (inside of Screen or tmux, maybe)?
from piku.
This is a clean install of Piku onto a Raspberry Pi Buster distro.
I must have had two piku logs
running then because I just did this:
piku@pikuserver:/home/pi $ ps aux | grep python
piku 861 0.0 0.0 1940 388 ? Ss 10:58 0:00 /bin/sh -c python3 myapp.py
piku 862 0.1 1.9 27400 19524 ? S 10:58 0:21 python3 myapp.py
piku 1435 0.0 0.0 7348 468 pts/0 S+ 14:07 0:00 grep --color=auto python
from piku.
this looks concerning... is these three instants of uwsgi running?
piku@pikuserver:/home/pi $ ps aux | grep uwsgi
piku 284 0.0 1.0 52236 10796 ? Ss 10:43 0:01 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
piku 327 0.0 0.3 45940 3404 ? S 10:43 0:01 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
piku 329 0.0 1.0 117764 10692 ? Sl 10:43 0:00 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
piku 1438 0.0 0.0 7348 472 pts/0 S+ 14:13 0:00 grep --color=auto uwsgi
from piku.
@dwightmulcahy I think this is just the way uwsgi does process management. I have the same thing:
root@piku:~# ps aux | grep uwsgi
piku 5453 0.0 0.5 43764 5244 ? Ss Aug03 5:24 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
piku 5456 0.0 0.2 39272 2252 ? S Aug03 9:56 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
piku 5467 0.0 0.6 125144 6396 ? Sl Aug03 0:00 /usr/local/bin/uwsgi-piku --ini /home/piku/.piku/uwsgi/uwsgi.ini
root 31109 0.0 0.1 12944 1032 pts/0 S+ 02:18 0:00 grep --color=auto uwsgi
And when I use pstree to visualise the tree I get this:
root@piku:~# pstree -p 5453
uwsgi-piku(5453)─┬─uwsgi-piku(5456)─┬─uwsgi(2649)───sh(4385)───server(4386)
│ ├─uwsgi(5458)───sh(28207)─┬─cat(28209)
...
└─uwsgi-piku(5467)───{uwsgi-piku}(5511)
As you can see the first process spawns multiple subprocesses, and those are what actually manage running instances.
from piku.
@virtadpt you said:
there are two instances of
python3 /home/piku/piku.py logs myapp
in your process table.
Which is fine as this is just the logging command, and it was probably run on two separate shells.
from piku.
@dwightmulcahy looks like there has been a regression. I am trying to this with a minimal uwsgi example and without the PORT
setting and seeing the same:
wsgi.1 | probably another instance of uWSGI is running on the same address (127.0.0.1:58786).
wsgi.1 | bind(): Address already in use [core/socket.c line 769]
from piku.
@dwightmulcahy Ok, I think I've figured this one out and it's a weird one.
If no NGINX_SERVER_NAME
is specified then piku will insert http
and http-socket
directives into the uwsgi config: https://github.com/piku/piku/blob/master/piku.py#L889-L890
This is apparently causing the clash because if I change http-socket
to http-use-socket
then the bind error goes away and the uwsgi app is launched correctly. I never ran into this myself as I always have NGINX_SERVER_NAME
set and don't use a custom PORT
.
Do you want to make that change to your piku.py (to http-use-socket
) and let me know if it fixes it for you? If it does I'll send a PR with the fix.
from piku.
I'll try it tomorrow morning and get back to you.
from piku.
Cool, wow, this has been broken for years.
from piku.
@dwightmulcahy I've pushed a PR to fix this. Thanks for testing.
from piku.
Related Issues (20)
- Simpler nginx install HOT 5
- Remove certbot references HOT 4
- create ~/bin/piku symlink to ~/piku.py HOT 4
- New NGINX_HTTPS_ONLY logic breaks existing installs HOT 4
- [feat] add config:push / config:pull for working with config vars HOT 6
- config:set var doesn't work with spaces HOT 10
- Suddenly getting Error: app 'myapp' not deployed! HOT 10
- Investigate ways to better manage secrets HOT 3
- Is there a "build" stage HOT 4
- node deploy doesn't run npm install HOT 3
- Having trouble getting set up on a Raspberry Pi 4 HOT 2
- Django / Postgres example - need to move to it's own repo and update HOT 18
- What is fetcher? HOT 4
- Bun support HOT 5
- Is there a way to uninstall Piku? HOT 1
- Trouble with a rails app HOT 1
- Crontabs with ranges fail to parse in uwsgi HOT 6
- MkDocs documentation HOT 5
- go.mod support
- Passthrough mode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piku.