Help needed in deploying a flask app

Greetings…! I’m Samuel and this is my first time attempting to deploy my flask app (dm for the github repo). The deployment succeeds but it’s returning a 404 error at the backend and “Not found…” at the front end. Could the routing be wrong in the code, or could it be that (“This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.”) I should be using a production server ie. gunicorn? I’ll appreciate help navigating this process. Thanks a bunch!

Logs
Oct 15 06:57:13 AM * Debugger is active!
Oct 15 06:57:13 AM * Debugger PIN: 162-090-409
Oct 15 06:58:13 AM 2023-10-15 05:58:13.132303: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Oct 15 06:58:13 AM 2023-10-15 05:58:13.228092: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2199985000 Hz
Oct 15 06:58:13 AM 2023-10-15 05:58:13.229244: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55c017d59eb0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
Oct 15 06:58:13 AM 2023-10-15 05:58:13.229415: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Oct 15 06:58:15 AM * Serving Flask app “chatbot.init” (lazy loading)
Oct 15 06:58:15 AM * Environment: production
Oct 15 06:58:15 AM WARNING: This is a development server. Do not use it in a production deployment.
Oct 15 06:58:15 AM Use a production WSGI server instead.
Oct 15 06:58:15 AM * Debug mode: on
Oct 15 06:58:15 AM * Running on all addresses.
Oct 15 06:58:15 AM WARNING: This is a development server. Do not use it in a production deployment.
Oct 15 06:58:15 AM * Running on http://10.214.239.197:8080/ (Press CTRL+C to quit)
Oct 15 06:58:15 AM * Restarting with stat
Oct 15 06:58:22 AM Your service is live :tada:
Oct 15 06:58:43 AM 2023-10-15 05:58:43.238778: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Oct 15 06:58:43 AM 2023-10-15 05:58:43.333803: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2199985000 Hz
Oct 15 06:58:43 AM 2023-10-15 05:58:43.334791: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5594305b96c0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
Oct 15 06:58:43 AM 2023-10-15 05:58:43.334898: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Oct 15 06:58:45 AM * Debugger is active!
Oct 15 06:58:45 AM * Debugger PIN: 672-195-580
Oct 15 06:58:46 AM 127.0.0.1 - - [15/Oct/2023 05:58:46] “GET / HTTP/1.1” 404 -
Oct 15 06:58:46 AM 127.0.0.1 - - [15/Oct/2023 05:58:46] “GET / HTTP/1.1” 404 -
Oct 15 06:58:47 AM 127.0.0.1 - - [15/Oct/2023 05:58:47] “GET /favicon.ico HTTP/1.1” 404 -
Oct 15 07:03:14 AM 127.0.0.1 - - [15/Oct/2023 06:03:14] “GET / HTTP/1.1” 404 -
Oct 15 07:03:17 AM 127.0.0.1 - - [15/Oct/2023 06:03:17] “GET / HTTP/1.1” 404 -

Hey,

The logs are telling you what’s happening here. There are no handlers in your code for the route specified in your health check path.

Jérémy.
Render Support, UTC+3

1 Like

Hello there,
Thanks for the response. Its the same thing I was told previously and it seems like a simple solution however, I’ve tried adding handles to the code as far as I know but no results yet. Could I send you the repo to help me check? It’s my first experience attempting to deploy a web app and its a bit tough to deploy. If you can also help from your end, it will be great…
T hanks

Hello there,
Thanks for the response. Its the same thing I was told previously and it seems like a simple solution however, I’ve tried adding handles to the code as far as I know but no results yet. Could I send you the repo to help me check? It’s my first experience attempting to deploy a web app and its a bit tough to deploy. If you can also help from your end, it will be great…
Thanks

Hey,

We cannot help a lot with code-related issues but you can always send a few things we can look at. As long as you’re trying to troubleshoot the issue on your end, provide us with what you’ve tried, etc.

Jérémy.
Render Support, UTC+3

Hello there,
I’ve made more corrections and these are the logs and screenshots I’m left with. Can it be looked into and advice me on what to do as it seems to be running out of memory?? Could it be that I need to upgrade my plan in order to get it working and if so, what plan do you recommend I upgrade it to?

Logs
Oct 26 01:38:58 PM Your service is live :tada:
Oct 26 01:38:56 PM [nltk_data] Downloading package punkt to /opt/render/nltk_data…
Oct 26 01:38:56 PM [nltk_data] Unzipping tokenizers/punkt.zip.
Oct 26 01:38:56 PM [nltk_data] Downloading package wordnet to /opt/render/nltk_data…
Oct 26 01:38:56 PM [2023-10-26 12:38:56 +0000] [40] [INFO] Starting gunicorn 21.2.0

Oct 26 01:38:56 PM [2023-10-26 12:38:56 +0000] [40] [INFO] Using worker: gevent
Oct 26 01:38:57 PM [2023-10-26 12:38:57 +0000] [68] [INFO] Booting worker with pid: 68
Oct 26 01:38:57 PM [2023-10-26 12:38:57 +0000] [69] [INFO] Booting worker with pid: 69
Oct 26 01:38:57 PM [2023-10-26 12:38:57 +0000] [70] [INFO] Booting worker with pid: 70
Oct 26 01:39:05 PM pygame 2.5.2 (SDL 2.28.2, Python 3.7.10)
Oct 26 01:39:05 PM Hello from the pygame community. Contribute - pygame wiki
Oct 26 01:39:05 PM 127.0.0.1 - - [26/Oct/2023:12:39:05 +0000] “GET / HTTP/1.1” 200 3270 “-” “Go-http-client/2.0”


Oct 26 01:45:54 PM ==> Running ‘gunicorn --worker-class=gevent --worker-connections=1000 --workers=3 chatbot:app’
Oct 26 01:45:59 PM 2023-10-26 12:45:59.092964: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
Oct 26 01:45:59 PM To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Oct 26 01:46:35 PM 2023-10-26 12:46:35.056760: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
Oct 26 01:46:35 PM To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Oct 26 01:46:40 PM [nltk_data] Downloading package punkt to /opt/render/nltk_data…
Oct 26 01:46:40 PM [nltk_data] Package punkt is already up-to-date!
Oct 26 01:46:40 PM [nltk_data] Downloading package wordnet to /opt/render/nltk_data…
Oct 26 01:46:40 PM [nltk_data] Package wordnet is already up-to-date!
Oct 26 01:46:40 PM [2023-10-26 12:46:40 +0000] [41] [INFO] Starting gunicorn 21.2.0
Oct 26 01:46:41 PM [2023-10-26 12:46:41 +0000] [41] [INFO] Listening at: http://0.0.0.0:10000 (41)
Oct 26 01:46:41 PM [2023-10-26 12:46:41 +0000] [41] [INFO] Using worker: gevent
Oct 26 01:46:41 PM [2023-10-26 12:46:41 +0000] [69] [INFO] Booting worker with pid: 69
Oct 26 01:46:41 PM [2023-10-26 12:46:41 +0000] [70] [INFO] Booting worker with pid: 70
Oct 26 01:46:41 PM [2023-10-26 12:46:41 +0000] [71] [INFO] Booting worker with pid: 71

Hey,

Yes, it does look like your instance is running out of memory, and upgrading your instance type should definitely help to alleviate this problem.

The next interesting instance after ‘free’, in terms of memory allocation, would be the ‘Standard’ one.

Jérémy.
Render Support, UTC+3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.