question

IdanConley-4574 avatar image
0 Votes"
IdanConley-4574 asked SnehaAgrawal-MSFT edited

Exception in worker process

Hi, I deployed my python web app and got this error:

2021-07-06T12:06:25.523850538Z
2021-07-06T12:06:25.523853538Z A P P S E R V I C E O N L I N U X
2021-07-06T12:06:25.523856738Z
2021-07-06T12:06:25.523859738Z Documentation: http://aka.ms/webapp-linux
2021-07-06T12:06:25.523862838Z Python 3.8.6
2021-07-06T12:06:25.523866038Z Note: Any data outside '/home' is not persisted
2021-07-06T12:06:25.622660351Z Starting OpenBSD Secure Shell server: sshd.
2021-07-06T12:06:25.653212940Z Site's appCommandLine: gunicorn application:app.server -b :8000
2021-07-06T12:06:25.653677943Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'gunicorn application:app.server -b :8000'
2021-07-06T12:06:25.667889131Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2021-07-06T12:06:25.673131464Z Build Operation ID: |xv+TsP2gfQ4=.6b62c2d4_
2021-07-06T12:06:25.673709067Z Oryx Version: 0.2.20210420.1, Commit: 85c6e9278aae3980b86cb1d520aaad532c814ed7, ReleaseTagName: 20210420.1
2021-07-06T12:06:25.674042169Z Output is compressed. Extracting it...
2021-07-06T12:06:25.677137089Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8d940729d821028'...
2021-07-06T12:06:37.784222133Z App path is set to '/tmp/8d940729d821028'
2021-07-06T12:06:38.369484414Z Writing output script to '/opt/startup/startup.sh'
2021-07-06T12:06:38.414831332Z Using packages from virtual environment antenv located at /tmp/8d940729d821028/antenv.
2021-07-06T12:06:38.416295248Z Updated PYTHONPATH to ':/tmp/8d940729d821028/antenv/lib/python3.8/site-packages'
2021-07-06T12:06:38.857805188Z [2021-07-06 12:06:38 +0000] [36] [INFO] Starting gunicorn 20.1.0
2021-07-06T12:06:38.859161304Z [2021-07-06 12:06:38 +0000] [36] [INFO] Listening at: http://0.0.0.0:8000 (36)
2021-07-06T12:06:38.859764911Z [2021-07-06 12:06:38 +0000] [36] [INFO] Using worker: sync
2021-07-06T12:06:38.862925947Z [2021-07-06 12:06:38 +0000] [38] [INFO] Booting worker with pid: 38
2021-07-06T12:06:38.866656089Z [2021-07-06 12:06:38 +0000] [38] [ERROR] Exception in worker process
2021-07-06T12:06:38.866669689Z Traceback (most recent call last):
2021-07-06T12:06:38.866674090Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-07-06T12:06:38.866677790Z worker.init_process()
2021-07-06T12:06:38.866714690Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-07-06T12:06:38.866721290Z self.load_wsgi()
2021-07-06T12:06:38.866724090Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-07-06T12:06:38.866727090Z self.wsgi = self.app.wsgi()
2021-07-06T12:06:38.866729790Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-07-06T12:06:38.866732590Z self.callable = self.load()
2021-07-06T12:06:38.866735190Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-07-06T12:06:38.866738090Z return self.load_wsgiapp()
2021-07-06T12:06:38.866740790Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-07-06T12:06:38.866743590Z return util.import_app(self.app_uri)
2021-07-06T12:06:38.866746290Z File "/tmp/8d940729d821028/antenv/lib/python3.8/site-packages/gunicorn/util.py", line 359, in import_app
2021-07-06T12:06:38.866749290Z mod = importlib.import_module(module)
2021-07-06T12:06:38.866751990Z File "/opt/python/3.8.6/lib/python3.8/importlib/init.py", line 127, in import_module
2021-07-06T12:06:38.866754790Z return _bootstrap._gcd_import(name[level:], package, level)
2021-07-06T12:06:38.866757490Z File "", line 1014, in _gcd_import
2021-07-06T12:06:38.866760991Z File "", line 991, in _find_and_load
2021-07-06T12:06:38.866763891Z File "", line 973, in _find_and_load_unlocked
2021-07-06T12:06:38.866766791Z ModuleNotFoundError: No module named 'application'
2021-07-06T12:06:38.872898061Z [2021-07-06 12:06:38 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-07-06T12:06:38.922615428Z [2021-07-06 12:06:38 +0000] [36] [INFO] Shutting down: Master
2021-07-06T12:06:38.923389937Z [2021-07-06 12:06:38 +0000] [36] [INFO] Reason: Worker failed to boot.

Can you help me with it?

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered SnehaAgrawal-MSFT edited

Thanks for asking question! As I can see from above there is ModuleNotFoundError: No module named 'application'

This means that Python could not find one or more of your modules when the application started. This most often occurs if you deploy your virtual environment with your code. Virtual environments are not portable, so a virtual environment should not be deployed with your application code.

Instead, let Oryx create a virtual environment and install your packages on the web app by creating an app setting, SCM_DO_BUILD_DURING_DEPLOYMENT, and setting it to 1. This will force Oryx to install your packages whenever you deploy to App Service.

For more information, please see this article on virtual environment portability.

Check this document link on more details on troubleshooting : https://docs.microsoft.com/en-us/azure/app-service/configure-language-python#troubleshooting

Let us know if further query on this or issue remains.



· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thanks but it still not working , i set the SCM_DO_BUILD_DURING_DEPLOYMENT to 1, and put the venv in .gitignore. i get "Container emtnitool_0_6b546610 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging."



0 Votes 0 ·

Thanks for reply! Your container must respond to an HTTP ping. Could you please confirm if port : 8000 is exposed? as if it was never exposed the attempt to ping the container, we aren't pinging on a port on which the container is listening.
There are a couple of ways to resolve this.

  1.  Use the EXPOSE instruction in your Dockerfile to expose port 8000.
    
  2.  Use the WEBSITES_PORT app setting with a value of "8000" to expose that port.
    

Also, some container takes a long time to start means when we start your container, we'll wait a while for it to start and initialize. We consider the startup to be successful once the container is running and once we get a response to a ping so that we know it's ready to respond to HTTP traffic. We'll wait 230 seconds for that to happen. If we don't have a successful start within 230 seconds, we'll assume there's a problem and we'll stop the container.

You can resolve this by increasing that 230 second wait time up to a limit of 1800 seconds.
To configure that, add an app setting called WEBSITES_CONTAINER_START_TIME_LIMIT and set it to the number of seconds you would like for us to wait for your container to start (up to a maximum of 1800).

Check this detailed link on things you should know web app & linux : https://techcommunity.microsoft.com/t5/apps-on-azure/things-you-should-know-web-apps-and-linux/ba-p/392472

Let us know if issue remains.





0 Votes 0 ·

Hey,
After the previous error, i got this error - "Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts" - this one is i can see on my Github when the push request if failed. I understand that I need to delete artifacts but I did not understand how to do it..

0 Votes 0 ·
IdanConley-4574 avatar image
0 Votes"
IdanConley-4574 answered

Hey,
After the previous error, i got this error - "Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts" - this one is i can see on my Github when the push request if failed. I understand that I need to delete artifacts but I did not understand how to do it..

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.