Error generating rig with Rigify addon Background  

With Unity, I downloaded this asset (Unity Asset Store link) for a game I am doing. I decided to use the "Army1" soldier for my game, but I needed some animations.
After searching a bit on Google, I found that I needed Blender for doing them and to load the .fbx file on it for adding the rig necessary for models parts to move.  

Blender work 

When I loaded the model, it already had some bones on it, but those were for moving on a specific way, and did not allowed the model to move on more ways than that one pre-established.
Then, I deleted that rig and followed this (YouTube Rigify tutorial) to learn how to rig from scratch.  

Problem 

However, when I generated the rig (This is the .blend file), this error appeared:


Question  

I have to say that I am very new to Blender, and a bit to Unity too. Any way I can solve this? Thanks in advance.
Somehow, your metarig had become corrupted in some way. By deleting the rig and just starting again and being careful with positioning the bones, it should work as expected from the video tutorial that you were following.

***I believe the mistakes you made that could have corrupted were extruding the bones from the foot bone to make extra bones there which swapped the parenting around in a way that conflicted with the python scripting that comes with the Rigify addon.

There was also an elbow bone called Bone that had been created by mistake along the left arm. After trying to generate the rig and coming up with errors, the original metarig, even after undoing it, had become corrupted after that. It's always just better to start again with the rigging process if you suspect any corruption in an object. It saves time in the long run.***