My master thesis is going in the wrong direction I'm a CS master student in a German university. Here we have to do a master project in one semester and the master thesis in another semester, so in total 12 months. In the project you start in defining and exploring the problem space and so on and building a preliminary software framework that will help you more in the thesis. In the thesis you build on that to expand your work and finally summarize everything.

My problem started with the problem definition. My supervisor didn't have an idea of what to work on, so he just came up with a fancy idea and told me to work on without knowing if it's logical or it can be applied or not. So I started working on that problem and trying to reformulate the problem into a logical project and thesis. I spent 8 months on that and finally I built the software framework and so on. However after finishing the work, I found that continuing with the problem in the same formulation as-is won't be logical and would make everything as rubbish work. So I found a better formulation to the problem that makes it much much better and would lead to publish a paper in a conference or a workshop. However my new formulation cancels out 75% of my previous work. This way I won't have much of stuff to write in my master thesis.

I sent my proposal to my advisor for the thesis and I'm still looking for his opinion, but I'm very depressed with what happened to me. Having a better advisor with a far clearer idea wouldn't have led me to this point.

Is what I'm going through normal?
As a researcher, you should expect to fail.

In general, you will frequently finding yourself coming up with ideas that don't pan out, results that suggest that what you did previously was wrong, or that a particular problem can't be solved yet (you need to do time-consuming step X before you can tackle interesting problem Y). Encountering these situations doesn't mean that what you've done is wrong, it means that you're doing research. (If everything you do is always successful, I'd argue you're doing development, as opposed to research.)

Success as a research comes from learning to cope with and overcome adversity. So I'd suggest that you use this as a learning experience. Rather than be depressed about it, try to work around your problems. It will be a valuable tool that will stay with you for the rest of your career.

Now, with respect to handle the master's thesis itself, this is something that you need to discuss with a number of people: your Betreuer (the person in charge of the thesis), as well as the head of the institute plus the person in charge of supervising students in your department. This is particularly important because your Betreuer is not normally allowed to grade your thesis, unless the Betreuer is a professor. Therefore, the people doing the grading may not be aware of the issues you had in the process. However, I would advise you to frame your questions in a positive way: that is, ask 


  What can I do to make sure I end up with a successful thesis?


rather than 


  How do I get myself out of this problem?


The former is much more likely to result in a satisfactory resolution than the latter.