[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"problem-detail-warning-python-app-is-restarting-before-it-can-serve":3},{"stack":4,"error":5,"seoName":6,"seoStack":7,"seo":8,"breadcrumb":10,"titlePrefix":17,"titleAccent":18,"lead":19,"facts":22,"why":37,"log":42,"fix":75,"engine":84,"related":92,"pitch":108},"python","python-app-is-restarting-before-it-can-serve","Python app restarts because Gunicorn fails to import the application","Python",{"description":9},"The application started but did not answer on any port it publishes. The deploy log has the per-port result; a worker or queue-only app can ignore this. | The a",[11,14,16],{"label":12,"href":13},"App Installations","\u002Fapps",{"label":7,"href":15},"\u002Fapps\u002Fstacks\u002Fpython",{"label":6},"Python app restarts because ","Gunicorn fails to import the application",[20],{"text":21},"The application started but did not answer on any port it publishes. The deploy log has the per-port result; a worker or queue-only app can ignore this. | The application is running but does not answer on the port it publishes. app listens on 39879, not on 8095. Its output is in the deploy log, or read it with container_service_logs.",[23,28,31,33],{"label":24,"value":25,"tone":26,"tooltip":27},"Type","Warning","warn","An issue PanelAlpha Engine catches around a deploy that does not break it. It tells you, before or after, that you may need to do something.",{"label":29,"value":30},"Seen","6 times",{"label":32,"value":7},"Where",{"label":34,"value":35,"tooltip":36},"Status","Observed","Our team will look into this soon, verify the cause and try to fix it in an upcoming release.",{"heading":38,"body":39},"Why it happens",[40],{"text":41},"The container starts, but the Gunicorn process exits while loading the application. Because it keeps restarting, port 8000 never answers the health check. The final import error is not included in the available log excerpt, so the specific startup cause is unclear.",{"heading":43,"block":44},"What the log looks like",{"header":45,"lines":46},"Deploy log",[47,51,55,59,63,67,71],{"segments":48},[49],{"text":50},"Starting application (docker compose up -d)",{"segments":52},[53],{"text":54},"Container project-app-1 Started",{"segments":56},[57],{"text":58},"Health check: http:\u002F\u002F[ip]:8000\u002F did not answer — Failed to connect to [ip] port 8000",{"segments":60},[61],{"text":62},"Check failed: The application is restarting, not running",{"segments":64},[65],{"text":66},"app-1  | ... gunicorn\u002Fapp\u002Fwsgiapp.py ...",{"segments":68},[69],{"text":70},"app-1  | return util.import_app(self.app_uri)",{"segments":72},[73],{"text":74},"app-1  | ... importlib.import_module(module)",{"heading":76,"steps":77,"block":81},"How to fix it",[78],[79],{"text":80},"Review the complete container output for the final Gunicorn\u002FPython exception, using the app container logs. Fix the reported import, configuration, database, or required environment-variable issue, then redeploy. Confirm that the configured Gunicorn module and callable match the application and that the app listens on port 8000.",{"header":82,"lines":83},"Fix by hand",[],{"heading":85,"body":86,"block":89},"How PanelAlpha Engine solves it",[87],{"text":88},"Capture and surface the final exception from the restarting container instead of truncating the import traceback. The health result should link directly to container logs and distinguish an application startup failure from an unavailable health endpoint.",{"header":90,"lines":91},"",[],{"heading":93,"items":94},"Apps affected",[95,100,104],{"title":96,"badge":97,"tone":98,"href":99},"music_assistant","3 occurrences","err","\u002Fapps\u002Fmusic-assistant\u002Fserver",{"title":101,"badge":102,"tone":98,"href":103},"kokoro-fastapi","2 occurrences","\u002Fapps\u002Fremsky\u002Fkokoro-fastapi",{"title":105,"badge":106,"tone":98,"href":107},"indextts","1 occurrence","\u002Fapps\u002Findex-tts\u002Findex-tts",{"heading":109,"body":110,"footNote":111,"docsLabel":112,"docsHref":113},"Try PanelAlpha Engine yourself.","The easiest way to turn your server into a safe, controlled environment for your AI agent. Deploy, manage and maintain any project from Claude Code, Cursor, Codex or any other MCP client. Open source under Apache 2.0, free to run.","Requires Ubuntu 24.04 or 26.04 · 2 GB RAM · 1 CPU","Read the documentation","https:\u002F\u002Fpanelalpha.com\u002Fdocs"]