I had the same issue with but with “snmp” giving the error instead of “agent”. I resolved my issue on CME 2.1.0p9. WATO, prior to 2.1, let me mistakenly add a tag with snmp as the id. When that happened, it took my custom tag config and overwrote the existing snmp tag. This caused the system fail on any future attempts to add any tag. I think it was looking in both tags.mk files and would see that the existing tags in the file did not match the expected tags. Probally because the builtin tags are stored somewhere else and cause a duplicate error of some sort? I compared a fresh checkmk-free setup to my production checkmk enterprise edition. Compared the tag files and noticed that anything to do with an snmp tag was not present in those files. On the fresh checkmk, no snmp tags were defined. So, I deleted any tags associated with snmp only on my production server. You have to carefully edit the tags.mk files to mirror each other and make sure that the code ends properly in the file after editing the tags. A sample of my setup is below from one of my tags.mk files. It worked for us. After editing and a core restart, the snmp tag was set back to its default as shown in the picture below and could add a tag called test. The below code and screenshot was taken after the fix.
tag_config.update({'tag_groups': [{'id': 'criticality', 'title': 'Criticality', 'tags': [{'id': 'prod', 'title': 'Productive system', 'aux_tags': []}, {'id': 'critical', 'title': 'Business critical', 'aux_tags': []}, {'id': 'test', 'title': 'Test system', 'aux_tags': []}, {'id': 'offline', 'title': 'Do not monitor this host', 'aux_tags': []}]}, {'id': 'networking', 'title': 'Networking Segment', 'tags': [{'id': 'lan', 'title': 'Local network (low latency)', 'aux_tags': []}, {'id': 'wan', 'title': 'WAN (high latency)', 'aux_tags': []}, {'id': 'dmz', 'title': 'DMZ (low latency, secure access)', 'aux_tags': []}]}, {'id': 'slack_channel', 'title': 'Slack Channel', 'tags': [{'id': 'none', 'title': 'none', 'aux_tags': []}, {'id': 'slack_tdualerts', 'title': 'tdualerts', 'aux_tags': []}, {'id': 'slack_wirelessalerts', 'title': 'wirelessalerts', 'aux_tags': []}, {'id': 'slack_corealerts', 'title': 'corealerts', 'aux_tags': []}, {'id': 'slack_fiberalerts', 'title': 'fiberalerts', 'aux_tags': []}, {'id': 'slack_cablealerts', 'title': 'cablealerts', 'aux_tags': []}, {'id': 'slack_pbxalerts', 'title': 'pbxalerts', 'aux_tags': []}, {'id': 'slack_voicealerts', 'title': 'voicealerts', 'aux_tags': []}, {'id': 'slack_poweralerts', 'title': 'poweralerts', 'aux_tags': []}, {'id': 'slack_testalerts', 'title': 'testalerts', 'aux_tags': []}, {'id': 'slack_pathalerts', 'title': 'pathalerts', 'aux_tags': []}]}, {'id': 'call_profile', 'title': 'Call Notification Profile', 'tags': [{'id': 'none', 'title': 'none', 'aux_tags': []}, {'id': 'callprofile_3', 'title': 'TDU', 'aux_tags': []}, {'id': 'callprofile_1', 'title': 'Path', 'aux_tags': []}, {'id': 'callprofile_4', 'title': 'Voice', 'aux_tags': []}, {'id': 'callprofile_5', 'title': 'Core', 'aux_tags': []}]}, {'id': 'smf_test', 'title': 'test to see if fixed', 'tags': [{'id': 'test_1', 'title': 'Test1', 'aux_tags': []}, {'id': 'test_2', 'title': 'Test2', 'aux_tags': []}], 'topic': 'Tags'}], 'aux_tags': []})