Unable to connect to MySql using GAE while deploying Java webapp

105 views
Skip to first unread message

Vamsi Singamaneni

unread,
Jun 8, 2018, 9:17:42 AM6/8/18
to Google App Engine
I am trying to deploy my webapp to the google cloud. I have created a MySql instance in the same project. i am using Google App engine Deployment from my intellij to deploy the app. When i try to run the app locally by configuring the IP address of MySql database, i am able to run it. (I have added my local ip in authorizations for MySQl).

When i deploy my app to google cloud, i am getting this error 
Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.google.apphosting.runtime.HardDeadlineExceededError: This request (00000163dd9936e3) started at 2018/06/08 04:13:15.875 UTC and was still executing at 2018/06/08 04:14:16.441 UTC.

I have gone through almost all the documentation to see if I can get something, couldn't get any help. 

Please help me if you know how to fix it.

Regards,
Vamsi

George (Cloud Platform Support)

unread,
Jun 8, 2018, 6:56:23 PM6/8/18
to Google App Engine
Hello Vamsi, 

Can you deploy your app successfully? Is this error received when you try to connect to your app? Very likely, your app does not complete the request-related work within the defined deadline. A request handler has a limited amount of time to generate and return a response to a request, typically around 60 seconds. Once the deadline has been reached, the request handler is interrupted. The Java runtime environment interrupts the servlet by throwing a com.google.apphosting.api.DeadlineExceededException. If the request handler takes more than a second after raising the exception to prepare a custom response, a HardDeadlineExceededError will be raised. Both DeadlineExceededExceptions and HardDeadlineExceededErrors will force termination of the request and kill the instance. You may find more detail in the "Specifying a request deadline" sub-chapter of the "How Requests are Handled" online document. 

A relevant sample of your Cloud SQL related code is needed to identify the possible source of the delays. 

What is the output of the gcloud info command on your development machine? 

Reply all
Reply to author
Forward
0 new messages