Tabs within tabs are OK - as long as you use them within the right context. In your case, you seem to have a lot of tabs going on, probably way too many. I don't know what your design is for, but I highly recommend clustering if possible.
So, for your issue, I think you should use sidebar navigation. Set up your primary navigation in tabs as you currently have, and place your secondary navigation to the left of it. It will not physically resemble tabs, but it will function the same. Once your user selects a primary tab, they will get options to choose a secondary option and can freely alternate between these.
This thread here contains a lot of good discussions regarding tab within a tab use. Particularly this part:
Each level of tabs should visually differentiate themselves so its clear what level of organization you are working on.
Limit number of tabs. Infinite is bad. 5 is the max.
"ON" states should be extremely clear. Use a hot color to make sure
its obvious. The user should know where they are at all times without
any thinking. - Glen Lipka
Tabs within tabs are widely discouraged because it's heavily cluttering. If you're not dealing with a super complex information system, I'd suggest you look for alternatives and decrease (unnecessary) content.