Error 215 is a sign that the image is not in a proper format fot the given color conversion.
scn == 3 || scn == 4 suggests that img is not a 3-channel or a 4-channel image, as required for BGR2GRAY.
Please add
print img.shapeprint img.shape and see if the 3rd value is 1, instead of 3. This could be the reason for the error.