<@ULVA73B9P>: Why would my server suddenly start e...
# marvin-ai
c
@Marvin: Why would my server suddenly start erroring with this upon server start?
ImportError: cannot import name 'PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL' from 'prefect.settings'
m
thought for 195.5 seconds
This usually means you have a Prefect version mismatch.
PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL
is a newer setting. If something in your server startup path is trying to import it, but the installed
prefect
package is older, startup will fail with exactly that
ImportError
. Most likely causes - You upgraded or changed some server-related code/image, but not the installed
prefect
package - You have a partial/broken environment or mixed site-packages - In Docker, your image layers are out of sync - You're running code from a newer Prefect checkout against an older installed version What to check first
Copy code
bash
python -c "import prefect; print(prefect.__version__)"
That setting is available in newer 3.x releases, but not in older 3.6.x installs. So if you see something like
3.6.x
, that's probably the issue. Fix Upgrade Prefect so the code and settings model match:
Copy code
bash
pip install --upgrade "prefect>=3.7.3"
Then verify the import works:
Copy code
bash
python -c "from prefect.settings import PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL; print(PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL.value())"
If this started “suddenly” That often points to one of these: - a fresh rebuild pulled a newer startup script - a dependency/image changed underneath you - a deploy reused an old environment with newer Prefect server code If you're using Docker Make sure the image itself has the right Prefect version installed, not just your local environment. Relevant docs: - Prefect docs - Prefect GitHub repo If you want, I can help you pinpoint it from: - your
prefect version
- how you start the server - whether this is local, Docker, or Kubernetes