How do you build a healthy and productive relationship with your supervisor? Some graduate students and post-docs have reported serious problems with their advisors and supervisors. Some of the problems are severe enough to be career ending. Not all problems can be avoided but it is possible that some can be if the student or post-doc takes some actions, especially in their first days of the new position. The goal is to build a solid and positive relationship with the advisor from the beginning so that small problems later don't escalate.

What can a student or post-doc do, starting in their first days and weeks, to help assure a strong and positive relationship with a supervisor?

There is no assumption here that it is all up to the student, but what can a person do in a new environment to maximize their chances of having a good and lasting relationship?

Students who have done this successfully and faculty members who can help students fit in are invited to give advice. 



Note that I'm not looking to collect horror stories here in which things went terribly wrong. What can the student do so that the horror scenario is unlikely to ever become an issue.
I would say that one of the largest things that a student/post-doc can do to foster a relationship with their advisor/mentor is establishing expectations early. This can be in the form of goals, research statements, or mutually agreed upon research plans. One of my former universities had a research statement form that students and mentors were asked to fill out. It specified what the goals of the partnership would be, what types of funding would be provided, what publications (with authorship order) were foreseen, etc. The partnerships that actually took the time to fill out the form had a much lower "failure" rate in their relationship.

In my experience, many of the issues that arise between mentor and student center around differing expectations. Expectations about timeline, work load, authorship, copyright, publication rate, etc.  

Now, of course, this is easier said than done. As a student, it can be hard to tell an advisor that you want to discuss "expectations." Some advisors would feel affronted by being asked to establish goals and plans. One thing that I have seen students do in this case is present their advisor with personal goals that the student wants to establish for themselves. This communicates several things to the mentor:


A willingness to be forward thinking and take responsibility for one's own work. It shows a "communication starts with me" approach to the relationship.
An actual structure for the mentor to build upon. It is much easier to advise a student that can build a basic framework for the metrics of the partnership. 
A willingness to ask for feedback as a means of improving. 




I will add an sort of post script to my answer: Some mentors are anything but. Vetting an advisor can be very important for ensuring that your relationship with you mentor is positive. Part of having a good relationship with your advisor is selecting a good advisor in the first place. (Which is much easier said than done). Not every mentor is in academia because they love students. That is a reality that does need to realized here. Some professors are in academia because they are too combative to survive in the "real" world. Attempting to foster open communication with a potential advisor can act as a litmus test in this regard.