Subject: Rocket3 hangs on restart after code changes — listening but not processing requests

46 views
Skip to first unread message

Paul Gerrard

unread,
Apr 1, 2026, 7:49:26 AM (12 days ago) Apr 1
to py4web

Hi all,


We're running py4web with Rocket3 behind nginx on Ubuntu. After systemctl restart py4web.service, Rocket3 sometimes enters a state where it binds to port 8000 (systemd reports "active/running", logs show "Listening on sockets: 127.0.0.1:8000") but does not process any HTTP requests. Curl to 127.0.0.1:8000 times out — confirmed it's not nginx or any upstream proxy.

A second restart via systemd always fixes it.

py4web version: 1.20250922.1
Rocket3 version: 20241225.1
Python 3.12
Ubuntu, systemd-managed service
reloader=False
Feels like a thread deadlock during startup.


Happy to provide logs or test a patch. By the way, I'm using Claude Code and the above it its diagnosis of a problem I've had for months. 2 Restarts always seems to work - I kind of took it for granted, but asked Claude to diagnose the problem. Is this a known Rocket 3 problem? Would a Rocket upgrade or config help? Best regards,

Paul.

Massimo DiPierro

unread,
Apr 1, 2026, 7:53:11 AM (12 days ago) Apr 1
to Paul Gerrard, py4web
hello Paul,

I never heard of this before. I will look into it. Meanwhile if you discover anything else let us know. 

Massimo 

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/py4web/f4e4e5d3-c6a7-4c35-a4e2-858b5f822c70n%40googlegroups.com.

Paul Gerrard

unread,
Apr 1, 2026, 10:07:57 AM (12 days ago) Apr 1
to py4web
Hi Massimo,

I asked Claude Code to give me the diagnostic etc. but I had a hunch that perhaps there was a second py4web process hanging around. Better check that.

We found one.

It looks like some months ago, I had difficuly getting a py4web systemd service working. In the interim I had a crontab job at startup that worked OK. The job was commented out. But... it appears I had ALSO a root crontab job which was left active.

It seems that the systemd jobe launches first, and grabs the port. The other process grabbed the port when systemd restarted. Why a second restart corrected the problem - I don't know.

Anyway, I'm really sorry for raising an alarm. All my own fault.

How often do we think of a different path of research when we explain the problem to someone else?

Best regards,
Paul.

Massimo DiPierro

unread,
Apr 1, 2026, 10:17:12 AM (12 days ago) Apr 1
to Paul Gerrard, py4web
No problem at all. This is good to know and a false positive is always better than an unreported issue. Thanks for letting us know.

Paul Gerrard

unread,
Apr 8, 2026, 8:44:07 AM (5 days ago) Apr 8
to py4web
Hi again Massimo,

Well, the py4web hang recurred so it was clear that the fix above helped but really, it only made the problem less frequent.

I'm working almost entirely with Claude Code nowadays. I put the problem to it and it proposed an experiment to flush out where the problem actually was. Long story short - we found the bug. I can take no credit. Claude code did 99% of the work. I asked it to write a report for you as it might impact other people and could be worth knowing about.

See attachement. It's a Markdown file. Do you want a rendered/PDF version?

I don't know if you are experimenting with AI to write code etc. Perhaps you're a sceptic. At any rate, this is a short case study of its powers of debugging, I'd say.

Best regards,
Paul.

report_for_massimo.md

Massimo DiPierro

unread,
Apr 8, 2026, 8:54:38 AM (5 days ago) Apr 8
to Paul Gerrard, py4web
Thank you Paul. I am traveling for work but I will look at this asap.

Reply all
Reply to author
Forward
0 new messages