Looks like a copy and paste mistake - view_sample should take sample_id as an argument, not task_id