Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP node doesn't seem to create directories #9296

Open
evok01 opened this issue May 2, 2024 · 11 comments
Open

FTP node doesn't seem to create directories #9296

evok01 opened this issue May 2, 2024 · 11 comments

Comments

@evok01
Copy link

evok01 commented May 2, 2024

Bug Description

Any workflow I make that uses a FTP node using a rename operation, when I check to recursively create directories, I always get the error "The system cannot find the path specified."

If I create the destination tree of directories manually beforehand, then the rename is successful.

I had first thought it would be a permission issue within IIS (this is a IIS hosted FTP site), so I have also setup another site using a directory that has full control for everyone and still the same problem. All of the other FTP operations seem to work though.

To Reproduce

  1. Add FTP node
  2. Set operation to "Rename"
  3. Set old path
  4. set new path
  5. check "Create Directories"
  6. Run workflow
  7. Observe error output
  8. Notice on the file system that the file was not renamed, nor any new directories created

Expected behavior

File in old path gets moved to the new destination with all previously non-existent parent directories now present.

Operating System

Photon OS

n8n Version

1.38.1

Node.js Version

18.19.1

Database

PostgreSQL

Execution mode

main (default)

@igortsev
Copy link

igortsev commented May 4, 2024

I think you have issue with premissions for FTP folder

@evok01
Copy link
Author

evok01 commented May 6, 2024

I had first thought it would be a permission issue within IIS (this is a IIS hosted FTP site), so I have also setup another site using a directory that has full control for everyone and still the same problem. All of the other FTP operations seem to work though.

@Joffcom
Copy link
Member

Joffcom commented May 8, 2024

Hey @evok01,

Thanks for the report, It looks like we never actually tried to use the create option so I have popped in a PR to test it. I don't have an IIS FTP site available for testing but the change works against pure-ftpd, If I create a test docker image from the PR would you be able to test it to see if it works for IIS?

@Joffcom Joffcom added the waiting for input Waiting for further input or clarification. label May 8, 2024
@evok01
Copy link
Author

evok01 commented May 9, 2024

@Joffcom Sure thing

@Joffcom Joffcom removed the waiting for input Waiting for further input or clarification. label May 10, 2024
@Joffcom
Copy link
Member

Joffcom commented May 10, 2024

@evok01 perfect thanks, In a test environment if you can use n8nio/n8n:PR-9340-gh-9296 as the image it will contain the fix I have put in.

@Joffcom
Copy link
Member

Joffcom commented May 14, 2024

Hey @evok01,

Have you had a chance to test yet?

@evok01
Copy link
Author

evok01 commented May 15, 2024

@Joffcom I have tested just now and I am seeing an error:

image

The FTP site that it is connecting to is using a root directory that has full permissions for everyone, and those open permissions are cascaded to all folders and files. It may be some weird config setting that I need to tweak in IIS but this is a new site for the purpose of testing.

Here is the most from the logs that I can see when the rename node is run:

runner-n8n-1  | 2024-05-15T15:46:51.150Z | debug    | Running node "Move installer to Runtime directory" finished successfully "{\n  node: 'Move installer to Runtime directory',\n  workflowId: 'oPOcro84HbvKmlvE',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
runner-n8n-1  | 2024-05-15T15:46:51.150Z | debug    | Executing hook on node "Move installer to Runtime directory" (hookFunctionsPush) "{\n  executionId: '109097578',\n  pushRef: 'lq6e0rmb5h9',\n  workflowId: 'oPOcro84HbvKmlvE',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"

I'll enable any additional logs that I can.

@Joffcom
Copy link
Member

Joffcom commented May 15, 2024

Hey @evok01,

Would you be able to try a workflow that just has the FTP node in it and try to rename a file in there so we can rule out anything else. Can you also make sure the node isn't set to continue on error under the settings.

@evok01
Copy link
Author

evok01 commented May 15, 2024

So I just tried another test using an empty workflow that just has the one FTP node. Now I get a 550 error. If I create the parent directories beforehand, then the rename works.

image

@evok01
Copy link
Author

evok01 commented May 15, 2024

Just to again rule out dumb permission problems, I tried just now using an FTP client to upload a file to non-existent directories and it was successful in creating them, so unfortunately it does appear to be n8n not being able to make directories.

@Joffcom
Copy link
Member

Joffcom commented May 16, 2024

@evok01 that is perfect, I can fix that. The PR makes the folder if the server returns a 451 error or attempts to which is what my ftp server used as the error code. I will add 550 to it as well and update the image which should solve it for IIS as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants