Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image broken #11

Open
sebastianhaas opened this issue Oct 23, 2018 · 8 comments
Open

Image broken #11

sebastianhaas opened this issue Oct 23, 2018 · 8 comments

Comments

@sebastianhaas
Copy link

The image seems to be missing Python lately. I encountered the following problem when creating a clone of a web app of mine:

2018-10-23T07:45:34.950438211Z 
2018-10-23T07:45:34.950510711Z   _____                               
2018-10-23T07:45:34.950624712Z   /  _  \ __________ _________   ____  
2018-10-23T07:45:34.950641312Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
2018-10-23T07:45:34.950650813Z /    |    \/    /|  |  /|  | \/\  ___/ 
2018-10-23T07:45:34.950659813Z \____|__  /_____ \____/ |__|    \___  >
2018-10-23T07:45:34.950668913Z         \/      \/                  \/ 
2018-10-23T07:45:34.950677713Z 
2018-10-23T07:45:34.950686113Z A P P   S E R V I C E   O N   L I N U X
2018-10-23T07:45:34.950694613Z 
2018-10-23T07:45:34.950702813Z Documentation: http://aka.ms/webapp-linux
2018-10-23T07:45:34.950711313Z NodeJS quickstart: https://aka.ms/node-qs
2018-10-23T07:45:34.950719713Z 
2018-10-23T07:45:36.767424995Z Starting OpenBSD Secure Shell server: sshd.
2018-10-23T07:45:36.857890131Z Running python /usr/local/bin/entrypoint.py
2018-10-23T07:45:37.933818270Z executing:
2018-10-23T07:45:37.934141573Z python --version
2018-10-23T07:45:37.975129452Z Python 3.7.0
2018-10-23T07:45:37.977691776Z executing:
2018-10-23T07:45:37.982036116Z pip --version
2018-10-23T07:45:38.152536891Z Traceback (most recent call last):
2018-10-23T07:45:38.152620791Z   File "/usr/local/bin/pip", line 7, in <module>
2018-10-23T07:45:38.152632192Z     from pip._internal import main
2018-10-23T07:45:38.152640992Z ModuleNotFoundError: No module named 'pip._internal'
2018-10-23T07:45:38.157763339Z 
2018-10-23T07:45:38.168770241Z found flask app
2018-10-23T07:45:38.169593648Z executing:
2018-10-23T07:45:38.169874151Z . antenv/bin/activate
2018-10-23T07:45:38.175971007Z /bin/sh: 1: .: Can't open antenv/bin/activate
2018-10-23T07:45:38.176351411Z 
2018-10-23T07:45:38.176709014Z executing:
2018-10-23T07:45:38.177021817Z GUNICORN_CMD_ARGS="--bind=0.0.0.0 --timeout 600" gunicorn application:app
2018-10-23T07:45:42.009289819Z [2018-10-23 07:45:42 +0000] [38] [INFO] Starting gunicorn 19.9.0
2018-10-23T07:45:42.015367975Z [2018-10-23 07:45:42 +0000] [38] [INFO] Listening at: http://0.0.0.0:8000 (38)
2018-10-23T07:45:42.015735878Z [2018-10-23 07:45:42 +0000] [38] [INFO] Using worker: sync
2018-10-23T07:45:42.051312007Z [2018-10-23 07:45:42 +0000] [41] [INFO] Booting worker with pid: 41
2018-10-23T07:45:45.202130914Z [2018-10-23 07:45:44 +0000] [41] [ERROR] Exception in worker process
2018-10-23T07:45:45.202180014Z Traceback (most recent call last):
2018-10-23T07:45:45.202191114Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2018-10-23T07:45:45.202219914Z     worker.init_process()
2018-10-23T07:45:45.202230114Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
2018-10-23T07:45:45.202239515Z     self.load_wsgi()
2018-10-23T07:45:45.202248415Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2018-10-23T07:45:45.202257415Z     self.wsgi = self.app.wsgi()
2018-10-23T07:45:45.202265915Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2018-10-23T07:45:45.202274915Z     self.callable = self.load()
2018-10-23T07:45:45.202283415Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2018-10-23T07:45:45.202292515Z     return self.load_wsgiapp()
2018-10-23T07:45:45.202301415Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2018-10-23T07:45:45.202310315Z     return util.import_app(self.app_uri)
2018-10-23T07:45:45.202318815Z   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
2018-10-23T07:45:45.202327615Z     __import__(module)
2018-10-23T07:45:45.202336015Z   File "/home/site/wwwroot/application.py", line 3, in <module>
2018-10-23T07:45:45.202345316Z     from authlib.flask.client import OAuth
2018-10-23T07:45:45.202353816Z ModuleNotFoundError: No module named 'authlib'
2018-10-23T07:45:45.202892021Z [2018-10-23 07:45:45 +0000] [41] [INFO] Worker exiting (pid: 41)
2018-10-23T07:45:45.410102235Z [2018-10-23 07:45:45 +0000] [38] [INFO] Shutting down: Master
2018-10-23T07:45:45.410492338Z [2018-10-23 07:45:45 +0000] [38] [INFO] Reason: Worker failed to boot.
2018-10-23T07:45:45.561115630Z
@sardinois
Copy link

sardinois commented Oct 30, 2018

Experiencing the same behaviour.
The antenv virtualenv is not created, nor are the requirements.txt installed

@sebastianhaas
Copy link
Author

I could resolve this issue be deleting the App Service and creating a new one. Everything works fine for me when building the container locally. It is hard to reproduce this problem actually.

@amahlaka
Copy link

I am having this same issue, I was not able to fix it by removing and creating a new web app.

@JBuitelaar
Copy link

I'm having the same issue when trying to deploy from Azure DevOps using Azure App Service Deploy (version 4). It doesn't create the virtualenv and doesn't install the packages from requirements.txt.

However, it works fine when deploying using localgit.

@sargemonkey
Copy link

Same here

@gxsins
Copy link

gxsins commented Oct 22, 2019

Have this exact issue with Devops, But today started getting the issue for Github deployments too.
What i did notice was these lines.

Good Github Deployment:
Writing output script to '/opt/startup/startup.sh'
Using packages from virtual environment antenv located at /home/site/wwwroot/antenv.
Updated PYTHONPATH to ':/home/site/wwwroot/antenv/lib/python3.7/site-packages'

Bad Deployment:
Writing output script to '/opt/startup/startup.sh'
Found virtual environment .tar.gz archive.
Removing existing virtual environment directory /antenv...
Extracting to directory /antenv...
Using packages from virtual environment antenv located at /antenv.
Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages'

looking at the directory on Root of both shows this.
Good Deploy:
/home/site/wwwroot>ls
CHANGELOG.md
README.md
Requirements.txt
SubmittedBugs.txt
Untitled.ipynb
pycache
antenv
app.py
app_original.py
config.py
env
oryx-manifest.toml
static
templates

Bad Deploy:
/home/site/wwwroot>ls
README.md
Requirements.txt
pycache
antenv.tar.gz
app.py
config.py
oryx-manifest.toml
static
templates

Good deployment has the enviroment built and ready to go???

@gxsins
Copy link

gxsins commented Oct 22, 2019

I think i solved it (for myself). I believe. Although requirements.txt never had an issue before with a 'R' it seems to now.
https://APPNAME.scm.azurewebsites.net/api/vfs/site/deployments/XXXXX/log.log
in there i found these lines

2019-10-22T20:49:02.9871595Z,Command: oryx build /home/site/wwwroot -o /home/site/wwwroot --platform python --platform-version 3.8 -i /tmp/xxx-p compress_virtualenv=tar-gz -p virtualenv_name=antenv --log-file /tmp/test.log ,,0
2019-10-22T20:49:36.1051840Z,Could not find requirements.txt; Not running pip install,,0

We Changed our Requirements file to a lowercase r in githuib AND in wwwRoot. Then redployed and it then showed pip install in the oryx build log files in deployment.

Good luck to anyone else.

Oh yea, in the shell, you cant just rename

/home/site/wwwroot>mv Requirements.txt requirements.txt
mv: 'Requirements.txt' and 'requirements.txt' are the same file

had to renamen to temp_req and then back

@penkin
Copy link

penkin commented Jun 8, 2020

For anyone else stumbling on this, this did the trick for me;

Configuration -> App Settings -> Add new App Settings
SCM_DO_BUILD_DURING_DEPLOYMENT=true

Credit: StackOverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@penkin @JBuitelaar @sebastianhaas @sargemonkey @amahlaka @sardinois @gxsins and others