Exception in worker process

Idan Conley 1 Reputation point

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

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.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: (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 App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,858 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,286 Reputation points

    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://learn.microsoft.com/en-us/azure/app-service/configure-language-python#troubleshooting

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

  2. Idan Conley 1 Reputation point

    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 comments No comments