There are several requirements for this to work.
(i) There should be a texture node in the material that is baked to
(ii) That texture node should not be used as input anywhere else(not even in a different material), it should not be attached to anything until you are comfortable with all of this.
(iii) The texture node that is being baked to must be selected. An active node is highlighted with yellow.
(iv) When baking several objects that are joined and where each has it's own material: each material must have the same texture node that is being baked to. As before, that node must be active(yellow) for all materials.
Here is a screen-capture that shows a node setup that will likely result in the error you describe.
As mentioned in the comments above, there won't always be an error with Cycles Baking as of the current date.
It should fail because even though the bakeTo texture node is selected for output, it is also being used as input. This can cause a circular reference error.
Simultaneously reading and writing to the same area of memory can cause the program to crash so Blender tries to prevent this with a warning.