Getting problem while installing of my extension
To debug this problem, it helps to turn on debugging and backtrace (Administer menu » System Settings » Debugging and Error Handling).  This will give more detailed errors.  You can also check the log in the ConfigAndLog folder.

It also helps if you can post your code on Github with a link so folks can see problems.  In your comments you say that you're using the API to create your records.  However, you must also remove those records on uninstall.  Using hook_civicrm_managed instead of the API will handle this for you.

To resolve this problem for now, manually delete the records your extension creates, then add an uninstall routine and you should be good.