6

Everything was fine at 8.1 but after upgrading (I copied everything from the new microservice roles and copied back the config files as per the documentation) now Update Preview consistently fails.

enter image description here

This error occurs in either the preview or session content core logs (but never in both at the same time) shortly after each attempt to run Update Preview.

2017-01-10 11:55:58,959 ERROR ExceptionMapperStandardImpl - HHH000346: Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]

I wonder if it may relate to this error when running Sync-TtmCdEnvironment:

PS C:\Users\Administrator> Sync-TtmCdEnvironment
cmdlet Sync-TtmCdEnvironment at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Id: CdEnvironment1
Synchronizing CdEnvironment 'CdEnvironment1'
Are you sure you want to perform this action?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

Sync-TtmCdEnvironment : Unable to synchronize item of type 'CdEnvironmentData' with id 'CdEnvironment1'.
One or more errors occurred.
An error occurred while communicating with CD Discovery Service 'http://localhost:8082/discovery.svc' in CD
Environment 'CdEnvironment1'.
An error occurred while processing this request.
Path 'http://localhost:8082/discovery.svc/WebCapabilities' is not allowed

I have all the capabilities loaded and readable in my Discovery Microservice. I have the cmuser registered with the TTM environment:

EnvironmentPurpose   : Staging
DiscoveryEndpointUrl : http://localhost:8082/discovery.svc
Credentials          : "AuthenticationType":"OAuth", "ClientId":"cmuser", "ClientSecret":"********"
IsOffline            : False
ScopedRepositoryKeys : {DxaSiteType, DxaExampleSite}
Id                   : CdEnvironment1
ExtensionProperties  : {}

Any idea what could be wrong here?

  • Hi Malcolm. Did you manage to resolve this issue? I'm seeing the same issue on my current project. – Jonathan Williams Feb 19 '18 at 14:32
  • Could this error message be related to this error? tridion.stackexchange.com/questions/5689/update-preview-error In both cases it sounds like this error message which occurs once in a while when the session preview mechanism wants to clean up the sessions from the db. – Jan H Feb 19 '18 at 16:37
  • Thanks for replying, Jan. We're going to change the logging levels to DEBUG on the Preview and Session-enabled Content Service microservices tomorrow morning and see what that gives us. We're not seeing any of the session content going in to the Session Preview database, so I suspect our problem is part of the fast-track publishing task at the moment, rather than the database cleanup, but I'll keep you posted! – Jonathan Williams Feb 20 '18 at 15:54
2

To Troubleshooting the XPM issue by following steps:

  1. To ensure Installation done with correct Jars and version of the preview service and session-content services and register with discovery double check the port information is correctly setup.
  2. To ensure the following config sections are present

In Preview Service side:

cd_stograge_config.xml - to ensure this following sections are present.

        <ObjectCache Enabled="false"/>

        <StorageBindings>
            <Bundle src="preview_dao_bundle.xml"/>
        </StorageBindings>
        <Wrappers>
            <Wrapper Name="SessionWrapper">
                <Storage Class="com.tridion.storage.persistence.JPADAOFactory" Id="sessionDb" Type="persistence" dialect="MSSQL">
                    <Pool CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5" Type="jdbc"/>
                    <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                        <Property Name="serverName" Value="localhost"/>
                        <Property Name="portNumber" Value="1433"/>
                        <Property Name="databaseName" Value="SessionPreview"/>
                        <Property Name="user" Value="SessionPreview_User"/>
                        <Property Name="password" Value="xxxxxx"/>
                    </DataSource>
                </Storage>
            </Wrapper>
        </Wrappers>

cd_ambient_config.xml - to ensure this following sections are present

 <WhiteList>
        <IPAddresses>
            <Ip>0.0.0.0-255.255.255.255</Ip>
        </IPAddresses>
 </WhiteList>

<Cartridges>
    <Cartridge File="cd_webservice_preview_cartridge.xml" Category="SYSTEM"/>
</Cartridges>

In Session enabled Content Service side:

cd_stograge_config.xml - to ensure this following sections are present.

        <StorageBindings>
            <Bundle src="preview_dao_bundle.xml"/>
        </StorageBindings>
        <Wrappers>
            <Wrapper Name="SessionWrapper">
                <Storage Class="com.tridion.storage.persistence.JPADAOFactory" Id="sessionDb" Type="persistence" dialect="MSSQL">
                    <Pool CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5" Type="jdbc"/>
                    <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                        <Property Name="serverName" Value="localhost"/>
                        <Property Name="portNumber" Value="1433"/>
                        <Property Name="databaseName" Value="SessionPreview"/>
                        <Property Name="user" Value="SessionPreview_User"/>
                        <Property Name="password" Value="xxxxxx"/>
                    </DataSource>
                </Storage>
            </Wrapper>
        </Wrappers>

cd_ambient_config.xml - to ensure this following sections are present

<WhiteList>
        <IPAddresses>
            <Ip>0.0.0.0-255.255.255.255</Ip>
        </IPAddresses>
    </WhiteList>
    <GloballyAcceptedClaims>
        <Claim Uri="taf:session:preview:preview_session"/>      
    </GloballyAcceptedClaims>
   <Cartridges>
    <Cartridge File="cd_webservice_preview_cartridge.xml" Category="SYSTEM"/>
    <Cartridge File="cd_webservice_preview_cartridge.xml"/>
</Cartridges>

<Cookies>
    <CookieClaim DefaultValue="true" Name="CookieClaim"/>
    <Cookie Type="ADF" Name="TAFContext" />
</Cookies>

In Web application side:

cd_client_conf.xml Cache is disabled

cd_ambient_conf.xml - to ensure this following sections are present

<ForwardedClaims CookieName="TAFContext">
    <Claim Uri="taf:session:preview:preview_session"/>
</ForwardedClaims>

<Security>     
    <GloballyAcceptedClaims>
        <Claim Uri="taf:session:preview:preview_session"/>
    </GloballyAcceptedClaims>
</Security>

In Java Web App: Enable the Ambient Data Framework by adding the following to your web.xml:

<filter>
  <filter-name>Ambient Client Filter</filter-name>
  <filter-class>com.sdl.web.ambient.client.AmbientClientFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>Ambient Client Filter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

In .NET Webapp:

Add the following inside the <modules> section inside the <system.webServer> section

<add type="Tridion.ContentDelivery.AmbientData.HttpModule" 
    name="Tridion.ContentDelivery.AmbientData.HttpModule" />

Refer to the documentation here

  1. To make sure to Add “Enable inline editing for content” TBB
  2. To ensure if CMS application is running in https then mandatory to run your web application also in https.
  3. To ensure to add the staging website URL in topology manager, in case if you are testing with your local system with source build for debugging then also ensure to add your localhost:port domain details to topology manager.
  4. To enable content service logs to debug level to see claim cookie forwards are appearing in the logs.
  5. To ensure preview service XPM Session Broker DB to have a Read and Write permissions to the session_db user.
  6. To ensure in XPM HTML Markup are correctly rendering in web app the HTML source
  7. To ensure with fiddler CMS XPM scripts are loading correctly
  8. If you press the Update Preview button then - you should be able to see the session details in the session preview DB tables.
  9. To ensure in the CMS Settings -> Inline editing -> Session Preview Settings -> Preview service is enabled.

enter image description here

I hope it helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.