Cannot apply modifier via script despite object being active? I can't apply the modifier programmatically via Python, but clicking the GUI button works.

Some answers on this site say bpy.ops commands usually demand the current active object be proper.

&gt;&gt;&gt; bpy.context.scene.objects.active
bpy.data.objects['Icosphere']


tells me my active object is proper.

But still, I get 

&gt;&gt;&gt; bpy.ops.object.modifier_apply(apply_as='DATA')
{'CANCELLED'}


Again, clicking the GUI button works without problems. How may I do it via script?
bpy.ops.object.modifier_apply(modifier='Mirror')


This command requires you to give it a modifier name.

bpy.ops.object.apply_all_modifiers()


This will apply all modifiers.  Note, this is a operator from addon 'Modifier Tools'.  You have to have this addon enabled to be able to use that command.