Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Ellen Shelton
9,049 PointsFlask Basics (Forms) - pdb causing 502 Bad Gateway error
I'm working on the "Forms" portion of Flask Basics, and am running into a 502 Bad Gateway error when I try to save a name for the bear. This only happens after adding the line to import pdb and set trace. Once I delete the pdb line, I can save the name (redirect to 'index') without issue.
2 Answers

Chris Freeman
Treehouse Moderator 68,390 PointsAfter playing with pdb
in the workspaces environment I was able to reproduce the error.
502 Bad Gateway
The server returned an invalid or incomplete response.
This isn't an error, it is just the browser timing out while waiting for a response from the flask app. The app can not respond while it is stalled in the pdb
debugger. This is a normal side effect of using the debugger (unless you're really fast and release the debugger quickly using 'c')

Ellen Shelton
9,049 PointsAh, thank you so much!

Ellen Shelton
9,049 PointsChris Freeman, thanks for replying! Screenshot here-- http://imgur.com/fbzgCWL
FWIW, I ran into this problem last week as well, so I tried everything anew today with the same result.
Chris Freeman
Treehouse Moderator 68,390 PointsChris Freeman
Treehouse Moderator 68,390 PointsAre you running locally or in Workspaces? If in Workspaces, can you provide a snapshot link to your code (including where you insert
pdb.set_trace()
)? If local, can you paste your code into your post?