OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python Webapp on Linux App Service Plan failed to start | future = tasks.async(future, loop=self)

  • Thread starter Thread starter ashxos
  • Start date Start date
A

ashxos

Guest
I have Python WebApp running on Linux App Service Plan.

Im using following python code

Code:
import abc
from datetime import datetime
from types import CodeType
from typing import ValuesView
from flask import Flask, request
from fyers_api import accessToken
from fyers_api import fyersModel
from azure.data.tables import TableServiceClient
from azure.data.tables import TableClient
import requests, json, urllib.parse
from datetime import date


app = Flask(__name__)

# default route
@app.route('/')
def index():
    return 'Hello World!'

It was working fine till last week. I did modify code and after that deployed. It stopped working with below error.

The strange part is that I have reverted the code to Original one. So practically there is no code change. The code runs on my Laptop without any issue. When I port it on Azure Linux Web App, it gives this error.

Code:
2021-05-14T05:50:29.559Z INFO - Initiating warmup request to container rockettokensaverapp_0_0408fcd1 for site rockettokensaverapp
2021-05-14T05:50:44.773Z INFO - Container rockettokensaverapp_0_0408fcd1 for site rockettokensaverapp initialized successfully and is ready to serve requests.
2021-05-14T07:28:03.725Z INFO - Starting container for site
2021-05-14T07:28:03.764Z INFO - docker run -d -p 9624:8000 --name rockettokensaverapp_1_ddb77933 -e WEBSITE_SITE_NAME=RocketTokenSaverApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rockettokensaverapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=50a285a49ae3758d44951d408c7ec6cb3077821b90868ed2bf52d6c32be391fa -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.8_20210226.3
2021-05-14T07:28:11.002Z INFO - Initiating warmup request to container rockettokensaverapp_1_ddb77933 for site rockettokensaverapp
2021-05-14T07:28:27.656Z ERROR - Container rockettokensaverapp_1_ddb77933 for site rockettokensaverapp has exited, failing site start
2021-05-14T07:28:27.673Z ERROR - Container rockettokensaverapp_1_ddb77933 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
/home/LogFiles/2021_05_15_lw1sdlwk00003C_default_docker.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/2021_05_15_lw1sdlwk00003C_default_docker.log)
2021-05-15T17:17:39.915599409Z File "/tmp/8d916ea417c6219/antenv/lib/python3.8/site-packages/asyncio/init.py", line 21, in <module>
2021-05-15T17:17:39.915603209Z from .base_events import *
2021-05-15T17:17:39.915606709Z File "/tmp/8d916ea417c6219/antenv/lib/python3.8/site-packages/asyncio/base_events.py", line 296
2021-05-15T17:17:39.915610509Z future = tasks.async(future, loop=self)
2021-05-15T17:17:39.915614109Z ^
2021-05-15T17:17:39.915617609Z SyntaxError: invalid syntax
2021-05-15T17:17:39.923617989Z [2021-05-15 17:17:39 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-05-15T17:17:40.085196098Z [2021-05-15 17:17:40 +0000] [36] [INFO] Shutting down: Master
2021-05-15T17:17:40.094651292Z [2021-05-15 17:17:40 +0000] [36] [INFO] Reason: Worker failed to boot.
/home/LogFiles/2021_05_15_lw1sdlwk00003C_docker.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/2021_05_15_lw1sdlwk00003C_docker.log)
2021-05-15T07:44:02.784Z ERROR - Container rockettokensaverapp_0_2f5e934c for site rockettokensaverapp has exited, failing site start
2021-05-15T07:44:02.786Z ERROR - Container rockettokensaverapp_0_2f5e934c didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-05-15T07:44:02.805Z INFO - Stopping site rockettokensaverapp because it failed during startup.
2021-05-15T17:17:24.298Z INFO - Starting container for site
2021-05-15T17:17:24.299Z INFO - docker run -d -p 4875:8000 --name rockettokensaverapp_0_0ba816d7 -e WEBSITE_SITE_NAME=RocketTokenSaverApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rockettokensaverapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=d4e6216930e8a31ff922c40a616e74d0f121e0e471dd7869291ba087f2c488ec -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.8_20210226.3
2021-05-15T17:17:27.144Z INFO - Initiating warmup request to container rockettokensaverapp_0_0ba816d7 for site rockettokensaverapp
2021-05-15T17:17:42.130Z ERROR - Container rockettokensaverapp_0_0ba816d7 for site rockettokensaverapp has exited, failing site start
2021-05-15T17:17:42.147Z ERROR - Container rockettokensaverapp_0_0ba816d7 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-05-15T17:17:42.159Z INFO - Stopping site rockettokensaverapp because it failed during startup.
/home/LogFiles/webssh/pm2.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)
<p>I have Python WebApp running on Linux App Service Plan.</p>
<p>Im using following python code</p>
<pre><code>import abc
from datetime import datetime
from types import CodeType
from typing import ValuesView
from flask import Flask, request
from fyers_api import accessToken
from fyers_api import fyersModel
from azure.data.tables import TableServiceClient
from azure.data.tables import TableClient
import requests, json, urllib.parse
from datetime import date


app = Flask(__name__)

# default route
@app.route('/')
def index():
return 'Hello World!'

</code></pre>
<p>It was working fine till last week. I did modify code and after that deployed.
It stopped working with below error.</p>
<p>The strange part is that I have reverted the code to Original one. So practically there is no code change. The code runs on my Laptop without any issue. When I port it on Azure Linux Web App, it gives this error.</p>
<pre><code>2021-05-14T05:50:29.559Z INFO - Initiating warmup request to container rockettokensaverapp_0_0408fcd1 for site rockettokensaverapp
2021-05-14T05:50:44.773Z INFO - Container rockettokensaverapp_0_0408fcd1 for site rockettokensaverapp initialized successfully and is ready to serve requests.
2021-05-14T07:28:03.725Z INFO - Starting container for site
2021-05-14T07:28:03.764Z INFO - docker run -d -p 9624:8000 --name rockettokensaverapp_1_ddb77933 -e WEBSITE_SITE_NAME=RocketTokenSaverApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rockettokensaverapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=50a285a49ae3758d44951d408c7ec6cb3077821b90868ed2bf52d6c32be391fa -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.8_20210226.3
2021-05-14T07:28:11.002Z INFO - Initiating warmup request to container rockettokensaverapp_1_ddb77933 for site rockettokensaverapp
2021-05-14T07:28:27.656Z ERROR - Container rockettokensaverapp_1_ddb77933 for site rockettokensaverapp has exited, failing site start
2021-05-14T07:28:27.673Z ERROR - Container rockettokensaverapp_1_ddb77933 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
/home/LogFiles/2021_05_15_lw1sdlwk00003C_default_docker.log (https://rockettokensaverapp.scm.azu.../2021_05_15_lw1sdlwk00003C_default_docker.log)
2021-05-15T17:17:39.915599409Z File "/tmp/8d916ea417c6219/antenv/lib/python3.8/site-packages/asyncio/init.py", line 21, in <module>
2021-05-15T17:17:39.915603209Z from .base_events import *
2021-05-15T17:17:39.915606709Z File "/tmp/8d916ea417c6219/antenv/lib/python3.8/site-packages/asyncio/base_events.py", line 296
2021-05-15T17:17:39.915610509Z future = tasks.async(future, loop=self)
2021-05-15T17:17:39.915614109Z ^
2021-05-15T17:17:39.915617609Z SyntaxError: invalid syntax
2021-05-15T17:17:39.923617989Z [2021-05-15 17:17:39 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-05-15T17:17:40.085196098Z [2021-05-15 17:17:40 +0000] [36] [INFO] Shutting down: Master
2021-05-15T17:17:40.094651292Z [2021-05-15 17:17:40 +0000] [36] [INFO] Reason: Worker failed to boot.
/home/LogFiles/2021_05_15_lw1sdlwk00003C_docker.log (https://rockettokensaverapp.scm.azu...LogFiles/2021_05_15_lw1sdlwk00003C_docker.log)
2021-05-15T07:44:02.784Z ERROR - Container rockettokensaverapp_0_2f5e934c for site rockettokensaverapp has exited, failing site start
2021-05-15T07:44:02.786Z ERROR - Container rockettokensaverapp_0_2f5e934c didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-05-15T07:44:02.805Z INFO - Stopping site rockettokensaverapp because it failed during startup.
2021-05-15T17:17:24.298Z INFO - Starting container for site
2021-05-15T17:17:24.299Z INFO - docker run -d -p 4875:8000 --name rockettokensaverapp_0_0ba816d7 -e WEBSITE_SITE_NAME=RocketTokenSaverApp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=rockettokensaverapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=d4e6216930e8a31ff922c40a616e74d0f121e0e471dd7869291ba087f2c488ec -e HTTP_LOGGING_ENABLED=1 appsvc/python:3.8_20210226.3
2021-05-15T17:17:27.144Z INFO - Initiating warmup request to container rockettokensaverapp_0_0ba816d7 for site rockettokensaverapp
2021-05-15T17:17:42.130Z ERROR - Container rockettokensaverapp_0_0ba816d7 for site rockettokensaverapp has exited, failing site start
2021-05-15T17:17:42.147Z ERROR - Container rockettokensaverapp_0_0ba816d7 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
2021-05-15T17:17:42.159Z INFO - Stopping site rockettokensaverapp because it failed during startup.
/home/LogFiles/webssh/pm2.log (https://rockettokensaverapp.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)
</code></pre>
 
Top