<?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>question Re: sftp donot fetch files in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401049#M251053</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123592"&gt;@ose_gold&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;The SFTP issues appear to stem from incorrect permissions and ownership in your Docker setup. Here's the analysis and solution:&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;Key Issues:&lt;/P&gt;&lt;OL class=""&gt;&lt;LI&gt;Root ownership instead of user 'foo' for /home/foo&lt;/LI&gt;&lt;LI&gt;Incorrect chroot directory permissions&lt;/LI&gt;&lt;LI&gt;Docker volume mount permissions&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;You have a volume &lt;STRONG&gt;nifi-conf:/opt/nifi/nifi-current/conf &lt;/STRONG&gt;for the NiFi container, but it's not declared in the volumes section at the bottom check the addition below&lt;BR /&gt;Docker Compose has newer versions 3.8 It might be a good idea to update to a more recent version depending on the features you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;version: '3'  #Docker Compose has newer versions 3.8
services:
  nifi:
    image: apache/nifi:latest   # Consider specifying a version
    container_name: nifi
    ports:
      - "8089:8443"
      - "5656:5656"
    volumes:
      - nifi-conf:/opt/nifi/nifi-current/conf
    environment:
      NIFI_WEB_PROXY_HOST: localhost:8089
      SINGLE_USER_CREDENTIALS_USERNAME: admin
      SINGLE_USER_CREDENTIALS_PASSWORD: {xxyourpasswdxx}

  sftp:
    image: atmoz/sftp
    volumes:
      - ./sftp/upload:/home/foo/upload
    ports:
      - "2222:22"
    command: foo:pass:1001
    # Add these permissions
    user: "1001:1001"
    environment:
      - CHOWN_USERS=foo
      - CHOWN_DIRS=/home/foo
   volumes:
     nifi-conf:&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before starting containers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Set correct permissions on host
mkdir -p ./sftp/upload
chown -R 1001:1001 ./sftp/upload
chmod 755 ./sftp/upload&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;This configuration:&lt;/P&gt;&lt;UL class=""&gt;&lt;LI&gt;Sets proper user/group ownership&lt;/LI&gt;&lt;LI&gt;Maintains correct chroot permissions&lt;/LI&gt;&lt;LI&gt;Ensures volume mount permissions are preserved&lt;/LI&gt;&lt;LI&gt;Prevents permission conflicts between host and container&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Happy Hadooping&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2025 09:18:47 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2025-01-27T09:18:47Z</dc:date>
    <item>
      <title>sftp donot fetch files</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401027#M251045</link>
      <description>&lt;P&gt;Hello , i am trying to use sftp with nifi .&lt;/P&gt;
&lt;P&gt;this is my docker image :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;volumes:&lt;BR /&gt;nifi-conf:&lt;/P&gt;
&lt;P&gt;services:&lt;BR /&gt;nifi:&lt;BR /&gt;image: apache/nifi:latest&lt;BR /&gt;container_name: nifi&lt;BR /&gt;ports:&lt;BR /&gt;- "8089:8443"&lt;BR /&gt;- "5656:5656"&lt;BR /&gt;volumes:&lt;BR /&gt;- nifi-conf:/opt/nifi/nifi-current/conf&lt;BR /&gt;environment:&lt;BR /&gt;NIFI_WEB_PROXY_HOST: localhost:8089&lt;BR /&gt;SINGLE_USER_CREDENTIALS_USERNAME: admin&lt;BR /&gt;SINGLE_USER_CREDENTIALS_PASSWORD:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sftp:&lt;BR /&gt;image: atmoz/sftp&lt;BR /&gt;volumes:&lt;BR /&gt;- ./sftp/upload:/home/foo/&lt;BR /&gt;ports:&lt;BR /&gt;- "2222:22"&lt;BR /&gt;command: foo:pass:1001&lt;/P&gt;
&lt;P&gt;at first the found the sftplist running with no output and when i stop it i get 2 active threads and canot stop or start it just terminal&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when the docker image load and debug it i founds that the owner of /home/foo not foo it is root and when i change it manually i get bad ownership error of chroot directory&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ose_gold_0-1737814389746.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43684i2318C0A8E2A7AC0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ose_gold_0-1737814389746.png" alt="ose_gold_0-1737814389746.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 04:50:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401027#M251045</guid>
      <dc:creator>ose_gold</dc:creator>
      <dc:date>2025-01-27T04:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: sftp donot fetch files</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401040#M251049</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123592"&gt;@ose_gold&lt;/a&gt;,&amp;nbsp;welcome to our community! To help you get the best possible answer, I have tagged our NiFi experts,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;, and&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;, who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 04:52:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401040#M251049</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2025-01-27T04:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: sftp donot fetch files</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401049#M251053</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123592"&gt;@ose_gold&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;The SFTP issues appear to stem from incorrect permissions and ownership in your Docker setup. Here's the analysis and solution:&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;Key Issues:&lt;/P&gt;&lt;OL class=""&gt;&lt;LI&gt;Root ownership instead of user 'foo' for /home/foo&lt;/LI&gt;&lt;LI&gt;Incorrect chroot directory permissions&lt;/LI&gt;&lt;LI&gt;Docker volume mount permissions&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;You have a volume &lt;STRONG&gt;nifi-conf:/opt/nifi/nifi-current/conf &lt;/STRONG&gt;for the NiFi container, but it's not declared in the volumes section at the bottom check the addition below&lt;BR /&gt;Docker Compose has newer versions 3.8 It might be a good idea to update to a more recent version depending on the features you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;version: '3'  #Docker Compose has newer versions 3.8
services:
  nifi:
    image: apache/nifi:latest   # Consider specifying a version
    container_name: nifi
    ports:
      - "8089:8443"
      - "5656:5656"
    volumes:
      - nifi-conf:/opt/nifi/nifi-current/conf
    environment:
      NIFI_WEB_PROXY_HOST: localhost:8089
      SINGLE_USER_CREDENTIALS_USERNAME: admin
      SINGLE_USER_CREDENTIALS_PASSWORD: {xxyourpasswdxx}

  sftp:
    image: atmoz/sftp
    volumes:
      - ./sftp/upload:/home/foo/upload
    ports:
      - "2222:22"
    command: foo:pass:1001
    # Add these permissions
    user: "1001:1001"
    environment:
      - CHOWN_USERS=foo
      - CHOWN_DIRS=/home/foo
   volumes:
     nifi-conf:&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before starting containers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Set correct permissions on host
mkdir -p ./sftp/upload
chown -R 1001:1001 ./sftp/upload
chmod 755 ./sftp/upload&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;This configuration:&lt;/P&gt;&lt;UL class=""&gt;&lt;LI&gt;Sets proper user/group ownership&lt;/LI&gt;&lt;LI&gt;Maintains correct chroot permissions&lt;/LI&gt;&lt;LI&gt;Ensures volume mount permissions are preserved&lt;/LI&gt;&lt;LI&gt;Prevents permission conflicts between host and container&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Happy Hadooping&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 09:18:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sftp-donot-fetch-files/m-p/401049#M251053</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2025-01-27T09:18:47Z</dc:date>
    </item>
  </channel>
</rss>

