<?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 Downloads API fails in multi node environment in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/downloads-api-fails-in-multi-node-environment/m-p/133021#M35837</link>
    <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;We have alfresco repository [1] running in three diferent instances. From a front-end application (react) we want to donwload compressed in a zip multiple files. This works well but we are having an issue due alfresco repository deployed in multiple nodes. The sequence of requests looks like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;front-end sends a POST with the nodeId of the folder that contains the files we want to download to &lt;SPAN&gt;&lt;SPAN class=""&gt;/alfresco/api/-default-/public/alfresco/versions/1/downloads&lt;/SPAN&gt;&lt;/SPAN&gt; Alfresco responds with the nodeId of the zip&lt;/LI&gt;&lt;LI&gt;We start to make requests against &lt;SPAN&gt;/alfresco/api/-default-/public/alfresco/versions/1/downloads/nodeIdOfTheZip Alfresco responds with status PENDING until the zip file is ready, at that moment the status changes to DONE&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Finally we make a request against /alfresco/api/-default-/public/alfresco/versions/1/nodes/nodeIdOfTheZip/content and the zip is downloaded&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;The trouble is that from time to time, in the last request, we get a 404 error like this one:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;{"error":{"errorKey":"framework.exception.ApiDefault","statusCode":404,"briefSummary":"06011072 Unable to locate content for node ref workspace://SpacesStore/nodeIdOfTheZip (property: {http://www.alfresco.org/model/content/1.0}content)","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com"}}&lt;/PRE&gt;&lt;P&gt;We are thinking in a couple of possible workarounds:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Stick the front-end requests to one node, our proxy setup uses a cookie for this purpose, but inject a cookie in react seems not so obvious &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/LI&gt;&lt;LI&gt;Set that cookie in the middleware (traefik)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;None of the above convinced us 100% so we were wondering if there is something that could be done at alfresco repository level, so as always all ideas are welcome!!!&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;P&gt;[1] alfresco/alfresco-governance-repository-community:7.2.0&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jul 2022 09:54:49 GMT</pubDate>
    <dc:creator>uo67113</dc:creator>
    <dc:date>2022-07-04T09:54:49Z</dc:date>
    <item>
      <title>Downloads API fails in multi node environment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/downloads-api-fails-in-multi-node-environment/m-p/133021#M35837</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;We have alfresco repository [1] running in three diferent instances. From a front-end application (react) we want to donwload compressed in a zip multiple files. This works well but we are having an issue due alfresco repository deployed in multiple nodes. The sequence of requests looks like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;front-end sends a POST with the nodeId of the folder that contains the files we want to download to &lt;SPAN&gt;&lt;SPAN class=""&gt;/alfresco/api/-default-/public/alfresco/versions/1/downloads&lt;/SPAN&gt;&lt;/SPAN&gt; Alfresco responds with the nodeId of the zip&lt;/LI&gt;&lt;LI&gt;We start to make requests against &lt;SPAN&gt;/alfresco/api/-default-/public/alfresco/versions/1/downloads/nodeIdOfTheZip Alfresco responds with status PENDING until the zip file is ready, at that moment the status changes to DONE&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Finally we make a request against /alfresco/api/-default-/public/alfresco/versions/1/nodes/nodeIdOfTheZip/content and the zip is downloaded&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;The trouble is that from time to time, in the last request, we get a 404 error like this one:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;{"error":{"errorKey":"framework.exception.ApiDefault","statusCode":404,"briefSummary":"06011072 Unable to locate content for node ref workspace://SpacesStore/nodeIdOfTheZip (property: {http://www.alfresco.org/model/content/1.0}content)","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com"}}&lt;/PRE&gt;&lt;P&gt;We are thinking in a couple of possible workarounds:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Stick the front-end requests to one node, our proxy setup uses a cookie for this purpose, but inject a cookie in react seems not so obvious &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/LI&gt;&lt;LI&gt;Set that cookie in the middleware (traefik)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;None of the above convinced us 100% so we were wondering if there is something that could be done at alfresco repository level, so as always all ideas are welcome!!!&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;P&gt;[1] alfresco/alfresco-governance-repository-community:7.2.0&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 09:54:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/downloads-api-fails-in-multi-node-environment/m-p/133021#M35837</guid>
      <dc:creator>uo67113</dc:creator>
      <dc:date>2022-07-04T09:54:49Z</dc:date>
    </item>
  </channel>
</rss>

