MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.25k stars 21.42k forks source link

Timeout when calling function #9084

Closed aappddeevv closed 5 years ago

aappddeevv commented 6 years ago

I worked through the example and everything deploys. However, I am unable to call the function, I eventually get a 5min timeout error. I had set the FUNCTIONS_EXTENSION_VERSION to Beta as well. We would probably benefit from a short description of the execution model for java programs e.g. do we need one fat jar or if not, what is the searchpath or how is the classpath structured? Also, It appears the java deployment to the server just needs a simple layout just like everything else but all the IDEs and CLI programs seem to cloud the essence of placing a jar file with a .json config file in a directory on the server--which is really all that is going on for deployment.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

aappddeevv commented 6 years ago

Well, I got this to work. I had to colocate all the jars in the same directory (the hello function directory) and made sure I had "beta" instead of Beta (not sure that mattered but I changed it anyway). I don't think the deployment model in the mvn archetype works, or at least it did not work for me.

mimckitt commented 6 years ago

@aappddeevv Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.

damarna85 commented 6 years ago

Hi, I am experiencing the same issue here. It worked perfect several weeks ago, but now I get a timeout no mater what I deploy. Thanks in advance!

aappddeevv commented 6 years ago

I delved into the code and opened an issue on the java worker project. It appears there is a bug in the classpath setting. I worked through it. Either you use a fatjar in the function directory or you separate out the function jar into the function dir or the root and place all other jar dependencies in the /lib directory. I've requested that the function dir be on the classpath as a default and a config option in function.json for setting the classpath overall. That would solve several issues with fatjar/nonfatjar and conflicting dependencies within the same functionapp. I run in scala so I created a sbt template for this and will keep refining it as hopefully the classpath conventions will be changed.

anamdesibab commented 6 years ago

Do we have any update, I did try to follow above mention steps to run the functions local still getting the error : Function host is not running. Application is shutting down... and when deploy to cloud, not able to call the function and getting I get a timeout.

emaghe commented 6 years ago

Hello I'm getting the same timeout problem. Any update? @aappddeevv tried your workaround (jar in the root and place all other jar dependencies in the /lib directory) + function.json file in the hello folder but still not working. Tried also to change configuration of the maven-dependency-plugin in the pom.xml to put jars and files in root or all in hello folder without success. Thanks for your help!

rezangit commented 6 years ago

I have the same problem so after I deployed the example java code to Azure, and trying to run it, It shows this message.

500 - The request timed out.

The web server failed to respond within the specified time.. any news here

ggailey777 commented 5 years ago

I've been working on updating this quickstart, and I haven't run into this issue.

ggailey777 commented 5 years ago

The quickstart updates have been merged. Please reopen if you are still having issues. #please-close