This error occurs when trying to user services in your constructor in drupal. If you want to do something like this, you'd have to make sure your container is right. 

Check out this code, make sure you use the create() method to instantiate the container object.

https://chromatichq.com/blog/dependency-injection-drupal-8-plugins