The ECS service's network access security group did not have permission to access EFS.
Add an inbound rule for type NFS in the security group as described in this tutorial: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/tutorial-efs-volumes.html#efs-security-group
It doesn't tell the exact error message, however in my case,
I was using firelens log driver with S3 configuration type. Since Fargate only supports local file at this point, I got the same error message. Once I changed it to local file in the task definition json, it proceeded further.