GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
320 stars 59 forks source link

Unable to debug PyCharm default Flask Application #3181

Open natgainer opened 10 months ago

natgainer commented 10 months ago

I have created the default flask app and wanted to make sure I have everything working. I am able to run locally and deploy, but I get the error in the attached screen shot. I tried to run: `kubectl logs timeline-655f887ccb-6kthk -n default -c timeline-container which was specified in the error and I get this error.

E0202 13:26:01.761715 3188 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it. Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it. Screenshot 2024-02-02 125637

Additional Information

Feel free to deviate from this template as needed, especially if you are submitting a feature request.

ivanporty commented 10 months ago

Thanks for the report @natgainer

I am able to run locally and deploy

Could you explain a bit more what exactly is not working after that?

couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

It seems you app tries to connect to a local memcache server and fails - does it run as part of your Cloud Run application? Normally, CR app runs as a single container and handles a single port.

natgainer commented 10 months ago

The error that you are asking about is what I get when I run: kubectl logs timeline-655f887ccb-6kthk -n default -c timeline-container

This was in the output from the original error when the deployment fails. I'm not really familiar with Kubernetes, but wonder if I have something configured incorrectly. It does work when I run locally. It just doesn't work when I execute it with debug.

natgainer commented 9 months ago

I'm still at a loss as to why I cannot run the default Cloud Run flask program in debug. I have reset docker to default settings and renabled Kubernetes. I'm a newbie and don't know a lot about Kubernetes and Docker. It runs without errors locally. Any thoughts or suggestions out there? My project is called timeline and attached is the output from my debug run. DebugErrorScreen

natgainer commented 9 months ago

I have uninstalled pycharm and reinstalled. I have utilized a virtual environment interpreter, local interpreter and a docker interpreter. All with the same result. If anyone has any ideas to try, please let me know. In my searches, I haven't found an issue exactly the same. The reason that I bought the developer version of pycharm was to be able to debug. I would also appreciate any help to debug the container to see why container install-python-debug-support is failing. I haven't been able to find any logs in docker which indicates the problem.