replicate / cog

Containers for machine learning
https://cog.run
Apache License 2.0
7.97k stars 555 forks source link

Server shutting down automatically if provided image URL can't be found #932

Open neverstopforever opened 1 year ago

neverstopforever commented 1 year ago

Thank you for making such great tool. I think I found an issue in the pre-release v0.7.0-beta7. If I provide non-existing URL for the image parameter, docker http server automatically stops. ex.

curl --location --request POST 'http://localhost:5000/predictions' \
--header 'Prefer: respond-async' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": {
        "image": "http://localhost:8080/upload/non-exist.jpeg",
        "task_type": "Real-World Image Super-Resolution",
        "jpeg": 15,
        "noise": 40
    }
}'

Logs:


{"error": "404 Client Error: Not Found for url: http://localhost:8080/upload/non-exist.jpeg", "prediction_id": "1233214433", "logger": "cog.server.runner", "timestamp": "2023-02-09T07:59:32.266753Z", "severity": "INFO", "message": "prediction failed"}
{"logger": "cog.server.http", "timestamp": "2023-02-09T07:59:32.273710Z", "severity": "INFO", "message": "stopping server"}
{"logger": "uvicorn.error", "timestamp": "2023-02-09T07:59:32.309483Z", "severity": "INFO", "message": "Shutting down"}
{"logger": "uvicorn.error", "timestamp": "2023-02-09T07:59:32.409909Z", "severity": "INFO", "message": "Waiting for application shutdown."}
{"logger": "uvicorn.error", "timestamp": "2023-02-09T07:59:32.661435Z", "severity": "INFO", "message": "Application shutdown complete."}
{"logger": "uvicorn.error", "timestamp": "2023-02-09T07:59:32.661528Z", "severity": "INFO", "message": "Finished server process [6]"}
mattt commented 1 year ago

Hi @neverstopforever. Thanks for sharing your feedback. Could you please update to the latest version of Cog (v0.8.0-beta6) and let me know if you're still seeing this? If you are, are you able to share the model code so that we can better understand what's going on?