<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Current version does not appear to be 1st version in the list in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32986#M13959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost same issue - then I save node and try to create version using JS I get the same error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Caused by: org.springframework.dao.ConcurrencyFailureException: Unexpected: current version does not appear to be 1st version in the list [workspace://version2Store/d2c78435-ef7d-45fe-8533-e353e0be04ca, workspace://SpacesStore/c109c8a7-0408-497a-ae90-4400436117ac]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In my case exception was caused by broken node versioning. Version creationg &lt;STRONG&gt;always&lt;/STRONG&gt; should be done at the end of transaction, and if you try to change node after version creating it will breake this node, and in future if you will try to create new version of the node or call getCurrentVersion() using VersionService it will return this error. To repair the node you can delete versionHistory of the node, maybe there are some other methods, but I don't know them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of the wrong code in JS:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;node.createVersion("test", false);&lt;/P&gt;&lt;P&gt;node.properties[...] = ...;&lt;/P&gt;&lt;P&gt;node.save();&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jan 2018 06:10:35 GMT</pubDate>
    <dc:creator>arioh</dc:creator>
    <dc:date>2018-01-11T06:10:35Z</dc:date>
    <item>
      <title>Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32982#M13955</link>
      <description>When I try to update node using share UI, I have seen the following error. Current version does not appear to be 1st version in the list If I update node using the javascript it does not throw any error and script calls itself multiple times. Do you know what causes this problem? I see the JIRA tic</description>
      <pubDate>Thu, 04 May 2017 22:20:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32982#M13955</guid>
      <dc:creator>sjoshee</dc:creator>
      <dc:date>2017-05-04T22:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32983#M13956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please confirm your exact Alfresco version (you can extract snippet from startup log) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, you/we can narrow down the exact repeatable steps, to ensure that recent fixes to the VersionService also resolve your specific issue (or not).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IIRC, you're running Alfresco Enterprise, so please feel free to contact Alfresco Support (if you haven't done so already) to track your issue in more detail &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 09:28:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32983#M13956</guid>
      <dc:creator>janv</dc:creator>
      <dc:date>2017-05-05T09:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32984#M13957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Jan,&lt;/P&gt;&lt;P&gt;We are running Alfresco 5.0.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will&amp;nbsp;file a ticket with Alfresco support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 15:18:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32984#M13957</guid>
      <dc:creator>sjoshee</dc:creator>
      <dc:date>2017-05-11T15:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32985#M13958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also facing same issue if try to upload.&lt;/P&gt;&lt;P&gt;Like I had doc1.pdf with 1.0 version if I try to upload minor/major version on that file I am getting error as&amp;nbsp;&lt;STRONG&gt;Caused by: org.springframework.dao.ConcurrencyFailureException: Unexpected: current version does not appear to be 1st version in the list [workspace://version2Store/d788b9aa-d6aa-44a4-b43e-6562b75d5e91, workspace://SpacesStore/d319dddd-1917-4aaf-b815-750f3ca30904]&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 10:02:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32985#M13958</guid>
      <dc:creator>kranthi</dc:creator>
      <dc:date>2017-11-22T10:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32986#M13959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost same issue - then I save node and try to create version using JS I get the same error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Caused by: org.springframework.dao.ConcurrencyFailureException: Unexpected: current version does not appear to be 1st version in the list [workspace://version2Store/d2c78435-ef7d-45fe-8533-e353e0be04ca, workspace://SpacesStore/c109c8a7-0408-497a-ae90-4400436117ac]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In my case exception was caused by broken node versioning. Version creationg &lt;STRONG&gt;always&lt;/STRONG&gt; should be done at the end of transaction, and if you try to change node after version creating it will breake this node, and in future if you will try to create new version of the node or call getCurrentVersion() using VersionService it will return this error. To repair the node you can delete versionHistory of the node, maybe there are some other methods, but I don't know them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of the wrong code in JS:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;node.createVersion("test", false);&lt;/P&gt;&lt;P&gt;node.properties[...] = ...;&lt;/P&gt;&lt;P&gt;node.save();&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 06:10:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32986#M13959</guid>
      <dc:creator>arioh</dc:creator>
      <dc:date>2018-01-11T06:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32987#M13960</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;Did anyone get any response from alfresco on this? I am also facing the same issue.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 19:04:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32987#M13960</guid>
      <dc:creator>f1mahesh</dc:creator>
      <dc:date>2022-03-02T19:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32988#M13961</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;I get the same issue and fixed it.&lt;/P&gt;&lt;P&gt;When I try to add another version to a node, I copy properties from newNode to destinationNode then I copy nodeContent.&lt;/P&gt;&lt;P&gt;On node content update Alfresco try to update node's version automatically (by default).&lt;/P&gt;&lt;P&gt;But when I copy all properties of newNode and paste it to destinationNode, I also copy version properties of the node. It get conflicted then when Alfresco update node version.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example :&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;newNode is v1.0 - destinationNode is v1.1&lt;/P&gt;&lt;P&gt;When I copy properties of newNode to destinationNode, I update version to 1.0. Then Alfresco tries to update version and raised a conflict because destinationNode version is 1.1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Solution :&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Keep destinationNode properties of version when updating with newNode properties.&lt;/P&gt;&lt;PRE&gt;public void updateNode(NodeRef newNode, NodeRef destNode){
        Map&amp;lt;QName, Serializable&amp;gt; props = mergeNodesProperties(newNode, destNode);
        serviceRegistry.getNodeService().setProperties(destNode, props);

        ContentWriter contentWriter = serviceRegistry.getContentService().getWriter(destNode, ContentModel.PROP_CONTENT, true);
        contentWriter.putContent(serviceRegistry.getContentService().getReader(newNode, ContentModel.PROP_CONTENT));

        serviceRegistry.getNodeService().deleteNode(newNode);
    }
    
    private Map&amp;lt;QName, Serializable&amp;gt; mergeNodesProperties(NodeRef newNodeRef, NodeRef destNodeRef) {
        Map&amp;lt;QName, Serializable&amp;gt; properties = serviceRegistry.getNodeService().getProperties(newNodeRef);
        Map&amp;lt;QName, Serializable&amp;gt; oldProperties = serviceRegistry.getNodeService().getProperties(destNodeRef);

        Map&amp;lt;QName, Serializable&amp;gt; newProperties = properties.entrySet()
                .stream()
                .filter(qNameSerializableEntry -&amp;gt; !qNameSerializableEntry.getKey().getLocalName().toLowerCase().contains("version"))
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

        newProperties.putAll(oldProperties.entrySet()
                .stream()
                .filter(qNameSerializableEntry -&amp;gt; qNameSerializableEntry.getKey().getLocalName().toLowerCase().contains("version"))
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));

        return newProperties;
    }&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 08:12:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/32988#M13961</guid>
      <dc:creator>Soprasteria</dc:creator>
      <dc:date>2022-08-08T08:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Current version does not appear to be 1st version in the list</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/491031#M40248</link>
      <description>&lt;P&gt;But how do you integrate this piece of code into the Alfresco flow? Do you overwrite some Spring beans?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 11:28:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/current-version-does-not-appear-to-be-1st-version-in-the-list/m-p/491031#M40248</guid>
      <dc:creator>AlfrescoZZZ</dc:creator>
      <dc:date>2025-07-02T11:28:23Z</dc:date>
    </item>
  </channel>
</rss>

