<?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 tFileExist not waiting for tSSH to complete in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219415#M14228</link>
    <description>&lt;P&gt;Our client recently started using CloudFlare protection and it blocked the use of tFileFetch. I am able to work around this by using cURL in a tSSH component.&lt;/P&gt;
&lt;P&gt;I am iterating through a file list and passing the file names in the form of a variable to a tSSH component to do the curl to download the files from a website and then I use tFileExist to check that the file downloaded successfully to populate another variable which serves as a flag to let my job know when all required files are downloaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I get is that the tFileExist component is not waiting until the file is done downloading before executing. I have tried fix this by adding a IF condition which checks the exit code of the tSSH (&amp;nbsp;((Integer)globalMap.get("tSSH_2_EXIT_CODE")) == 0 ) but this does not help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what might be happening is that the tSSH is sending the success code before finishing the file download.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I handle this? Any help would be much appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 12:32:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-29T12:32:05Z</dc:date>
    <item>
      <title>tFileExist not waiting for tSSH to complete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219415#M14228</link>
      <description>&lt;P&gt;Our client recently started using CloudFlare protection and it blocked the use of tFileFetch. I am able to work around this by using cURL in a tSSH component.&lt;/P&gt;
&lt;P&gt;I am iterating through a file list and passing the file names in the form of a variable to a tSSH component to do the curl to download the files from a website and then I use tFileExist to check that the file downloaded successfully to populate another variable which serves as a flag to let my job know when all required files are downloaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I get is that the tFileExist component is not waiting until the file is done downloading before executing. I have tried fix this by adding a IF condition which checks the exit code of the tSSH (&amp;nbsp;((Integer)globalMap.get("tSSH_2_EXIT_CODE")) == 0 ) but this does not help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what might be happening is that the tSSH is sending the success code before finishing the file download.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I handle this? Any help would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 12:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219415#M14228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-29T12:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: tFileExist not waiting for tSSH to complete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219416#M14229</link>
      <description>&lt;P&gt;Can you post a screenshot of your job?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 16:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219416#M14229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-29T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: tFileExist not waiting for tSSH to complete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219417#M14230</link>
      <description>&lt;P&gt;Here is the relevant part of the job. If I put in a sleep component instead of the selected IF then the Check happens as expected after the file is done. But if a very large file or slow internet causes it to not finish the download then it will obviously fail.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mstsc_7GCcG7meBd.png" style="width: 964px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M6qS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152370i9AD768B2014D743E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M6qS.png" alt="0683p000009M6qS.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 08:41:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219417#M14230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-30T08:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: tFileExist not waiting for tSSH to complete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219418#M14231</link>
      <description>&lt;P&gt;Hmmmm, this looks like the terminal response is indicating the command has finished while the file is still downloading. A good way of resolving this would be to add a tLoop with your tFileExist component. Set a globalMap variable of "found" to be set to false. Set the tLoop's logic to fire while "found" is false. When the tFileExist returns true, set "found" to be true.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially the flow after the tSSH would be .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tJava (to set the boolean "found" globalMap)&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;(iterate link)&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;tLoop (with a while loop based on the "found" variable)&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;(iterate link)&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;tFileExist&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;(run if link based on the tFileExist result)&lt;/P&gt;
&lt;P&gt;|&lt;/P&gt;
&lt;P&gt;tJava (to set "found" to true)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would trigger the rest of the code from the tLoop.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 09:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219418#M14231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-30T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: tFileExist not waiting for tSSH to complete</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219419#M14232</link>
      <description>Thank you for your suggestion. I will try and see if it works!</description>
      <pubDate>Fri, 30 Aug 2019 09:15:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileExist-not-waiting-for-tSSH-to-complete/m-p/2219419#M14232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-30T09:15:06Z</dc:date>
    </item>
  </channel>
</rss>

