Chalice: PyCharm breakpoints don't work with Chalice 1.3.0

Created on 19 Jun 2018  路  10Comments  路  Source: aws/chalice

I updated to chalice 1.3.0 yesterday and my breakpoints stopped working when running chalice through PyCharm (i.e. not remote debugging).

The code executes correctly, and any changes are correctly reflected in the running code, but I cannot get PyCharm to stop on ANY breakpoints anywhere in my code.

Switching my chalice version back to 1.2.3 fixes the problem. Can anyone verify?

Most helpful comment

Worth mention that until we have a better solution in place, you can disable auto reloading (and therefore creating two processes) using chalice local --no-autoreload. This will bring back the original behavior in 1.2.3.

All 10 comments

Can you give more details about what you're doing, specifically a concrete set of steps that demonstrate the issue? I'm not aware of why any changes in 1.3.0 would result in the pycharm debugger not working, but we'll need more information to help troubleshoot.

It's pretty straight-forward. I have a chalice project that I've been developing in PyCharm for a few weeks. I run/debug the service locally by using a PyCharm run configuration:
Script Path: ~/home/project/venv/bin/chalice
Parameters: local --stage local
Working Dir: ~/home/project

When I debug the project through PyCharm with chalice-1.3.0, the code executes correctly, but the debugger will not stop on a single breakpoint. If I revert the chalice version to anything before 1.3.0, the breakpoints work just fine (with absolutely no changes to any PyCharm settings). When I set chalice back to 1.3.0, the breakpoints will not work.

I can't claim that chalice is 100% culpable (or that PyCharm is completely in-culpable), just that the behavior is perfectly consistent.

Just to be clear though, the local dev server appears to work ok, it's just that none of your breakpoints are being hit correct?

I am currently having the exact same issue. I am not sure that is a chalice issue entirely, perhaps pycharm.
Running chalice local:

Serving on 127.0.0.1:8000

Pycharm with breakpoint in accessible code: Run --> Attach To Local Process

I have been using postman for my endpoints. After creating the request, the response comes back fine, no issues from chalice. However, it will not stop on the breakpoints in pycharm. Is there a better way to debug the application through an IDE? Without pdb?

Just switched to @ereboschi suggestion with chalice==1.2.3. This works fine, and seems like a chalice issue.
A difference I noticed between the versions.. In chalice 1.2.3, Pycharm recognizes only one process running after chalice local. In the most recent version, Pycharm notices 2 processes running for chalice after starting the local server only once.

I am also experiencing the same problem. A short-term solution to this problem is to run (Not Debug) the chalice application and then run-->Attach To Local Process and connect the second process. Breakpoints will work again. It's not a great solution but it allows development to continue.

Yea that makes sense. Local mode has auto-reload now so the parent process has a child process that actually runs the dev server, and it reloads the child server whenever it detects a change to any of the files under the app path.

Worth mention that until we have a better solution in place, you can disable auto reloading (and therefore creating two processes) using chalice local --no-autoreload. This will bring back the original behavior in 1.2.3.

@jamesls: Thanks for the tip. That'll make my testing much easier.

All, I appreciate the support and suggestions.

Closing this since there isn't really anything we can do in the default case and there is a workaround.

Was this page helpful?
0 / 5 - 0 ratings