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

Web app is running and waiting for content #230

Closed
dmore123 opened this issue May 22, 2023 · 11 comments
Closed

Web app is running and waiting for content #230

dmore123 opened this issue May 22, 2023 · 11 comments

Comments

@dmore123
Copy link

dmore123 commented May 22, 2023

I was able to deploy the app on my azure subscription. It deployed successfully a "App Service", "Form Recognizer", "Search Service", "App service plan" , and " Storage Account"

I can upload my data in the "Storage Account" and create an Indexers and Index.

When I ran the app from the "App Service" I get the following message

Your web app is running and waiting for your content
Your web app is live, but we don’t have your content yet. If you’ve already deployed, it could take up to 5 minutes for your content to show up, so come back soon.

But nothing happens. Any idea?

Thanks

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here.
azd version 0.8.0-beta.2

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@pamelafox
Copy link
Collaborator

Is this after running azd up or just azd provision? azd up should have also included the deployment step, after uploading all the data for the index, and should have shown the website URL at the end. You could check the deployment logs to see if something failed - I have tips on doing that here: https://blog.pamelafox.org/2023/01/tips-for-debugging-django-app.html

@dmore123
Copy link
Author

dmore123 commented Jun 7, 2023

Hi Pamela, Thank you

I tried to redeploy and get the following error

Executing postprovision hook => .\scripts\prepdocs.ps1
'pwsh' is not recognized as an internal or external command,
operable program or batch file.

ERROR: failed running post hooks: 'postprovision' hook failed with exit code: '1', Path: '.\scripts\prepdocs.ps1'. : exit status 1

Any suggestions on how to fix it?

On the Azure side I got no error on the deployment.

Thanks

@pamelafox
Copy link
Collaborator

What operating system are you using? The pwsh command is triggered to run on Windows machines, per the postprovision hook section in https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/azure.yaml

If you're on a Windows machine and pwsh does not work, then you'll need to fix up your Powershell installation.

@dmore123
Copy link
Author

dmore123 commented Jun 7, 2023

Thank you. I fixed the Powershell PATH as you suggested.

I got a successful deployment:

Deploying services (azd deploy)

(✓) Done: Deploying service backend

SUCCESS: Your application was provisioned and deployed to Azure in 38 minutes 40 seconds.

However, when I click on the link I get a "404 Not Found" page

Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

when I look at the logs. I have the following

2023-06-07T23:53:50 No new trace in the past 1 min(s).
2023-06-07 23:54:36.441 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMR7M62JHRRT" accepted.
2023-06-07 23:54:36.506 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMR7M62JHRRT" started.
2023-06-07 23:54:36.516 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://app-backend-p6vm57r657yt4.azurewebsites.net/ - -
2023-06-07 23:54:36.545 +00:00 [Trace] Middleware: Request came in on normal port, sending to normal target http://169.254.130.8:8000/
2023-06-07 23:54:36.545 +00:00 [Trace] Middleware: Forwarding request to http://xxx.xxx.xxx.xxx:8000/
2023-06-07 23:54:36.690 +00:00 [Trace] Middleware: Forwarded request finished in 143.986ms 200 NOT FOUND
2023-06-07 23:54:36.708 +00:00 [Information] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://app-backend-p6vm57r657yt4.azurewebsites.net/ - - - 404 207 text/html;+charset=utf-8 192.6512ms
2023-06-07 23:54:36.708 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMR7M62JHRRT" disconnecting.
2023-06-07 23:54:36.708 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Connections: Connection id "0HMR7M62JHRRT" stopped.
2023-06-07 23:54:36.711 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets: Connection id "0HMR7M62JHRRT" sending FIN because: "The Socket transport's send loop completed gracefully."
2023-06-07T23:54:36.689451990Z 169.254.130.9 - - [07/Jun/2023:23:54:36 +0000] "GET / HTTP/1.1" 404 207 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.41"

Thank you

@pamelafox
Copy link
Collaborator

Hm, that's interesting. What should have happened is that App Service auto-recognized the app as a Flask app (based off requirements.txt) and used gunicorn to run the app inside app.py.

Then the / route should have been handled by this in app.py:

@app.route("/", defaults={"path": "index.html"})
@app.route("/<path:path>")
def static_file(path):
    return app.send_static_file(path)

Considering that didn't happen, I wonder if the index.html file was not built. The building should have happened at the beginning of the azd up process, and the files should be in backend/static. Look for an index.html file there.

Other things you could do:

  • Check deployment (Oryx) logs to make sure it successfully realized it was a Flask app.
  • Using the Advanced Tools, SSH into the server and see what the files look like.

@dmore123
Copy link
Author

dmore123 commented Jun 8, 2023

I redeployed - success ! Thank you!

@pamelafox
Copy link
Collaborator

Woot! Seems safe to close this issue now, in that case.

@clemenspeters
Copy link

I also had to run azd up again (two times) before the "Your web app is running and waiting for your content" page was replaced by the actual chat app 🤔
Thanks for pointing out that this can solve the issue 👍

@blackboxdelta
Copy link

I am having the exact same issue! tried azd up- No luck. Is there a easier fix?

@pamelafox
Copy link
Collaborator

If you do not yet see the website content, please go through the debugging steps in http://blog.pamelafox.org/2023/06/tips-for-debugging-flask-deployments-to.html

  • Confirm the deployment was successful
  • Assuming it was, download the logs from Advanced Tools and look for issues in default_docker.txt

@mohapatras
Copy link

mohapatras commented Mar 6, 2025

Hm, that's interesting. What should have happened is that App Service auto-recognized the app as a Flask app (based off requirements.txt) and used gunicorn to run the app inside app.py.

Then the / route should have been handled by this in app.py:

@app.route("/", defaults={"path": "index.html"})
@app.route("/<path:path>")
def static_file(path):
    return app.send_static_file(path)

Considering that didn't happen, I wonder if the index.html file was not built. The building should have happened at the beginning of the azd up process, and the files should be in backend/static. Look for an index.html file there.

Other things you could do:

  • Check deployment (Oryx) logs to make sure it successfully realized it was a Flask app.
  • Using the Advanced Tools, SSH into the server and see what the files look like.

Is the routing needed changing for the codes hosted in the devops repository also ?

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

5 participants