'Tag is Invalid' - likely due to an unspecified plugin

It works fine with one tag, but with more sometimes it won’t allow users to post and gives that error message.

You can edit the post afterwards with as many tags as you want, and sometimes it just lets you post.

Is there a setting in the backend that i need to change? Maybe the sporadic nature means users can’t create more than one tag at a time, or create a new tag when existing ones are also present.

Anyone else encountered this?

1 Like

Are you using the tickets plugin, or tag groups? I think this happens to me when I try to use a ticket tag elsewhere.

Have you got any category settings dealing with tags? Finding any commonalities with the tags that are throwing errors? If you are able to replicate it, have you tried looking in the logs or developer console? Does it happen in safe mode?

4 Likes

Thanks for your reply. I’m not using either of those plugins.

I have a few identical, repeated tags in the site which seems to be causing the issue, but only when they are combined with other tags. Both ‘web-dev’ tags are identical.

image

Here’s the error code in console:

POST https://publichappinessmovement.com/posts 422

How did you create two “web-dev” tags? :thinking:

7 Likes

I’d like to know that too Neil :upside_down_face:

Generally i create them when creating a post.

I have a few plugins which use tags, none of them are defining ‘web-dev’ as a tag… although it is possible that they did in the past. Our menu links component uses ‘web-developers’.

Hi Andy! Man, sorry this is such a struggle. The link to your site The Public Happiness Movement tags page helps a bit, methinks - you have alot of weird issues there as you can see… no tag groups which is good to know. If you sort by name (alphabetically) you will see there are blank tags that appear to be after D… pretty weird and points to some larger issue.

Can you confirm that you are seeing the same issue in safe mode, with only official plugins and no theme customizations enabled?

Have you rebuilt your instance having removed/commented out in app.yml the unofficial tags plugins you don’t want? Maybe they are still having some influence.

I am suspecting all the blanks are occurring each time you run into trouble saving with multiple tags, including the ones that are obviously weird because they are showing up multiple times on the tags page. You could test this by loading the tags page, trying to replicate it again, and then see if a new one is added.

Beyond the above… if I were you, I’d start by doing some tag gardening. :slight_smile: Generally you don’t want to have so many tags, and definitely no tags that will likely only appear once. You can delete and merge tags via the tags pages. I would go ahead and delete the ones that are appearing in duplicate, or merge them with a new temporary tag, make sure the originals are deleted, and then rename it back to the tag name you want.

2 Likes

I expect any UI that uses tag names is going to do unexpected things while you’re in this situation. You’re going to need to use the rails console to delete all duplicate tag records, and all tags with a blank name. After that, you need to look at the plugins you’re using for bugs that are causing these problems. Also, the tags table must be missing its indexes that would prevent duplicate tag names.

3 Likes

@syl does this look like it could be coming from a Docuss bug as it is working in unconventional ways with tags? I have an option to delete unused tags and about half of those were docuss tags. The others look to be from deleted posts. (it doesn’t include the blank tags).

3 Likes

@Andy02:

  1. The blank tags in the /tags page are caused by Docuss. I’ve just added a section in the doc to explain why. As an administrator, you can use Alt+a to unhide the blank tags and troubleshoot your issue more easily.

  2. I don’t believe Docuss has anything to do with duplicate tags or the “Tag is Invalid” message. Please disable Docuss and see if the “Tag is Invalid” message disappears. If it does, don’t hesitate to file an issue in the Docuss repo.

4 Likes

That clears up the hidden/blank tags. the behaviour still occurs so something else must be causing it. I’m still investigating

1 Like

Ok, i can’t be sure what caused it but here’s what i’ve found so far.

the error occurs in safe mode with all plugins, and also with the theme turned off. that doesn’t mean its a bug in stock/our install of stock as its probably more likely one of the plugins put the duplicate tag(s) into the database and they are still there causing problems when the plugin is turned off.

to correct it i’ve been searching for duplicate tags and changing them to something else. (‘web-dev’ into ‘webdev’)

i’ve noticed that some tags are set as posts on the tags, but aren’t listed. so the site will tell me i have 12 remaining web-dev tags, but the search function can’t find them.

many posts have both identical tags in the tag entry box, and deleting one removes the other.

my best guess so far is that the tags causing problems are also put as links in the post itself, so when someone puts #web-dev in the text body of the post it is creating a tag, and if that tag is already in the title of the post it is creating a duplicate.

I’m going to try and force that to occur and so i can observe it.

Something else is going on though as if you look at this search result, the top post does not contain ‘web-dev’ as i’ve already changed it, yet the search function is still seeing it there somewhere.

Edit: ignore the last part, the search was just being intuitive. the same search for this " web-dev " removes the false positives.

…but ‘suggested topics’ is still finding tags which ‘search’ can’t see:

Update: still acting screwy. the only repeat tag i can find is web-dev. i removed all that i or the search bar can find. now if i make a post using that tag it will post rather than give the ‘invalid’ error message. clicking on the web-dev tag to try and locate the other three which the system tells me are somewhere in the forum brings up a 404 error. i’m unsure if they are in posts, or some kind of shadow in the database.

here’s the test post i made with the web-dev tag that i have painstakingly removed from our forum. At this point do i need to wipe this tag directly on the database somehow? (i can’t see any other tags causing an issue).

Ok, seems to be fixed now just by trawling our site and removing that ‘web-dev’ tag, then using the ‘delete unused tags’ tool.

Afraid I can’t say what caused it for sure to help others more in the future. I’ll keep an eye out to see if it happens again.

2 Likes

I edited the title you guys had edited. I’m not sure which plugin caused it. Infact the only one I can likely rule out is Docuss as the author dropped by and examined whether their code was at fault, and didn’t think it was.