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

func new hangs - improve logging #3867

Open
gsouf opened this issue Oct 8, 2024 · 2 comments
Open

func new hangs - improve logging #3867

gsouf opened this issue Oct 8, 2024 · 2 comments

Comments

@gsouf
Copy link

gsouf commented Oct 8, 2024

Version

func --version
4.0.6280

Description

cli func hangs when creating a new python function following the official guide

Steps to reproduce

Follow instruction here: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=linux%2Cbash%2Cazure-cli%2Cbrowser

python -m venv .venv
source .venv/bin/activate
func init --python
func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"

Nothing happens after func new, hangs for a long time (at least 5~10 minutes) and finally prints:

One or more errors occurred. (A task was canceled.)

That's all, nothing to help debugging

@surgupta-msft
Copy link
Contributor

I tried your repro steps and it worked fine for me. I am on windows.

(.venv) C:\pythonrepro>func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"
Appending to C:\pythonrepro\function_app.py
The function "HttpExample" was created successfully from the "HTTP trigger" template.

(.venv) C:\pythonrepro>func start
Found Python version 3.9.13 (py).

Azure Functions Core Tools
Core Tools Version:       4.0.6280 Commit hash: N/A +421f0144b42047aa289ce691dc6db4fc8b6143e6 (64-bit)
Function Runtime Version: 4.834.3.22875

Can you retry and see if it helps? And are you only getting that single line as error, nothing else?

@gsouf
Copy link
Author

gsouf commented Nov 1, 2024

@surgupta-msft I think it's environment related. Might even be just a temporary network problem.

But the biggest problem here is not the issue itself, it's that there is no message to debug the issue. May I suggest that you add better debugging information in case of an error rather than finding what caused the issue in my specific case, otherwise it will just be a wild goose chase

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

2 participants