The word I'm looking for is probably a synonym of 'discouraged' or 'disheartened'.
Context: You are working on some project, and it has been going smooth so far. Suddenly a problem or challenge presents itself, and you feel that you are ill-equipped to deal with it or that it seems "too difficult". As a result you feel less than good, you lack confidence that you can do it, and you try to either procrastinate or side-step it.
Example sentence: In the above story, John felt ___.
What's the best word to describe this feeling?
'dishearten' as it is defined -- "to cause to lose hope, enthusiasm, or courage" -- is not a bad word, as in this context one does lose enthusiasm as well as confidence (courage?) in proceeding. But bear in mind that the word I'm looking for is in project-context (of a knowledge worker) rather than any dramatic life context.
Above all, it is a word to describe the feeling. To put a precise label on it.
Clarifications
Why not a generic word (like 'discouraged')?
"discouraged" is a fine generic word to describe this. My desire to be more precise however arises from motivation of affect labeling.
I think "discouraged" doesn't quite capture the faux inevitability of the situation. If I did not feel overwhelmed, I would not be discouraged. I would not be dispirited, but rather kept on feeling spirited when presented with an seemingly insurmountable challenge.
Related concept in psychology
This word connotes a mindset that people tend to have, on easily giving up on a challenge (the word itself refers to the feeling engendered by it). Carol Dweck calls the opposite mindset as "growth mindset".