Net::SFTP::StatusException (3, "permission denied") error

Knowledge Drop

Last tested: Dec 1, 2020
 

When you see the error Net::SFTP::StatusException (3, "permission denied") when setting up a sftp schedule it's usually caused by one of four things:

  1. A missing trailing slash at the end of the sftp connect url. This URL, for instance will not work:
    sftp://sftp.dev.looker.com/home/testaccount
    It will error with permission denied because sftp is trying to open a directory for writing. Adding a trailing slash opens a file for writing iside the target directory, which is what we want. So you should write:

sftp://sftp.dev.looker.com/home/testaccount/

  1. The sftp user does not have write permissions to the destination directory. Test by creating a small text file in your local directory. Use command line sftp to connect to the destination server, e.g. sftp sftpuser@sftp.host.url. Once logged in try put filename. Type ls to verify that the file was transferred. If this errors or does not results in a file on the destination the sftp user doesn't have write permission.
  2. The destination directory does not exist. If the absolute path points to a directory that doesn't exist or isn't the true working directory for that user you will receive a permission denied error.
  3. Per this documentation page, looker's IPs should be allow-listed for Looker hosted instances.
  4. The user hasn't specified the path to where they want the file to go, correctly.
    1. SFTP into your server. sftp sftpuser@sftp.host.url
    2. Fo to the directory of where you want to drop your files, and do pwd .
    3. Make sure this file path, ex, /Home/test_folder/ is the exact path you're using in your schedule modal file path.

This content is subject to limited support.                

Version history
Last update:
‎05-07-2021 09:08 AM
Updated by: