Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

cq:tags property for pages is not saved correctly in the JCR in AEM 6.2

Avatar

Level 2

Hello! guys

In the project that I am working on, I noticed that the property of "cq:tags" (OOTB in AEM) in pages is not working as expected.  After save the dialog (page properties) it seems that a POST request is sent to the jcr:content node of the page with the value selected but then seems that a listener or something in the core of AEM is trying to delete the value on this property.  I figured out in the log and found this: *INFO* [sling-oak-observation-552] com.day.cq.tagging.impl.TagValidatingEventListener invalid/duplicated tags detected at /content/project/relative_path/page/jcr:content/cq:tags modified by user8923: 'namespace:name/23235' => ''

But I really do not know why is trying to delete the value, because first, the tag exist because is selected from the wizard dialog for tags and is not duplicated.

So, it seems that the property value is deleted after and for this reason the cq:tags in the JCR is saved as empty string.

Could anybody help me to have an initial possible solution or maybe identify if this is an issue in AEM 6.2  ?

Thank you very much!

15 Replies

Avatar

Employee

Looks like you are using invalid tags, anyway we can reproduce this?

Avatar

Level 2

Can you give me what is needed to have a valid tag in AEM 6.2 (I attached an image with all the properties that we have for tags)

And my concern is that I think the tags are valid because in the Tags/Keywords field (page properties) I can see all the tags with the correct structure, maybe is something with the TagValidatingEventListener. Is good idea deactivate this component ? 

Thanks!

Avatar

Level 2

I figured out that if I deactivate this service Day CQ Tagging Service. The cq:tags property are correctly saved in JCR and works fine, maybe this service is called in TagValidatingEventListener and what is the propouse of this service? is good idea inactivate it ?  

I am wondering if maybe we have built the tags in the wrong way, however I tried with the geometrixx tags and are not persisted.

Please let me know  any thoughts on this.

Regards

Avatar

Former Community Member

Any updates on this issue? facing something similar on my system.

Avatar

Level 2

See, I could not find the issue with the tags.  I examined all tags and they were correctly persisted in AEM. So, my workaround was to disable the Tag Validation through the OSGi configuration manager.

1223281_pastedImage_0.png

Just uncheck the Enable Validation field.  The name of the service is Day CQ Tagging Service.  It seems that the observation listener attached to tags is deleting the tags after is persisted. But, I could not find the issue with my tags so I disable the listener.

That's all I do.

Julian

Avatar

Level 9

Hi,

If there is a already existing invalid tag at the cq:tags property under jcr content and trying to append another valid tag. this might be the issue.

i would recommend to clean up cq tags at the page level manually through crxde and then try it.

Avatar

Former Community Member

We cleaned up our tags and made sure everything is valid. Still seeing this issue though.

Avatar

Community Advisor

Can you be specific on what exact issue you are facing. A sample and error log would help to guide you

Thanks

Veena

Avatar

Former Community Member

Hi,

What seems to be happening is the TagReplicatingEventListerner is wiping away valid tags. We confirmed these tags are valid and they are still being wiped out.

We are on AEM 6.3

Here is what I see in the logs:

*INFO* [sling-oak-observation-2260] com.day.cq.tagging.impl.TagValidatingEventListener invalid/duplicated tags detected at /content/<path-to-page>/jcr:content/cq:tags modified by shkhan: 'products:SG_ACCESS, topic_tags:3d' => ''

Avatar

Community Advisor

Hi Julian/ Shahbaz

    My next question would have been to provide the tag values to validate if it is valid . Guess Shahbaz answered before even I threw that at you . But still will it be possible to provide a sample tag you guys are adding? I will try to reproduce it locally.

      If this is 6.3 issue, we may need Adobe help to see if this is a bug. May be Feike Visser​ , smacdonald2008Sham HCkautuksahni​ could help

Thanks

Veena

Avatar

Level 2

Hi Veena,

Actually in AEM 6.2 the issue is reproducible.  On the tags that we have, I can not send to you for business restrictions, but the all the tags follows this pattern:

TagID:

project:id/id/id ...

e.g:

-aem:34513/12345

We do not have repeated tagIDs persisted, so I really do not know why this issue ocurred.

Any help will be appreciated.  That's why I disable the Tag Validation Listener in order to not loss the tags persisted like page properties.

Thanks,

Julian

Is it when you add tags to the pages or even to the assets ??

Avatar

Community Advisor

Hi Julian

     Just to debug if this is your tag issue or anything else, can you do the below after enabling the Tag Validation Listener

1. Can you tag your page with OOTB tags , and see if this issue occurs again ?

          - If the issue occurs , tag the same to a geometrixx page

          - If both throws issue, then it could be some valid issue

2. Can you tag the geometrixx page with YOUR tag and see if this issue occurs ?

          - If yes, then your tag could be invalid

     I did tag my pages in 6.3 and 6.2 with tags which I use for my project and couldn't find any issue as such. My Tags where saved and reflecting in the JCR content node .  I am not sure how to replicate this issue. But the error log clearly says some duplicate or invalid tags and it is what confusing me ....

Avatar

Level 2

I found this same issue on an environment that had been updated from 6.0 to 6.2.  They had their own ACL permission package that was overriding several OOTB rep:policy including the one for /etc/tags.

If the user tag-validation-service user does not have read access to /etc/tags, we get the same error about a duplicate tag.  Putting back the user tag-validation-service permissions fixed it.

Below is the full default ACL list for /etc/tag.

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:crx="http://www.day.com/crx/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"

    jcr:primaryType="rep:ACL">

    <allow

        jcr:primaryType="rep:GrantACE"

        rep:principalName="tag-administrators"

        rep:privileges="{Name}[jcr:versionManagement,jcr:modifyAccessControl,jcr:read,jcr:readAccessControl,crx:replicate,rep:write,jcr:lockManagement]"/>

    <allow0

        jcr:primaryType="rep:GrantACE"

        rep:principalName="everyone"

        rep:privileges="{Name}[jcr:read]">

        <rep:restrictions

            jcr:primaryType="rep:Restrictions"

            rep:glob=""/>

    </allow0>

    <allow1

        jcr:primaryType="rep:GrantACE"

        rep:principalName="tag-garbage-collection-service"

        rep:privileges="{Name}[jcr:read,crx:replicate,rep:write]"/>

    <allow2

        jcr:primaryType="rep:GrantACE"

        rep:principalName="tag-validation-service"

        rep:privileges="{Name}[jcr:read]"/>

    <allow3

        jcr:primaryType="rep:GrantACE"

        rep:principalName="translation-job-service"

        rep:privileges="{Name}[jcr:modifyProperties,jcr:read]"/>

    <allow4

        jcr:primaryType="rep:GrantACE"

        rep:principalName="dam-replication-service"

        rep:privileges="{Name}[jcr:modifyAccessControl,jcr:modifyProperties,jcr:read,crx:replicate,jcr:readAccessControl]"/>

</jcr:root>