Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

how to delete a file in sftp server

srajapandian
8 - Asteroid

Having issues to delete a file in sftp server, if I use python script - erroring with hostkey.

If we use winscp  - fails if the file doesnt exist. 

 

 

Appreciate any help on this. 

 

Thank you 

5 REPLIES 5
apathetichell
19 - Altair

Not really seeing this an Alteryx  issue. Are you using Paramiko with Python? What kind of error are you getting? Are you running Python locally? This can be an encoding issue where a private key generated on windows has issues on linux and vice versa.

srajapandian
8 - Asteroid

Thans for your response. 

I tried pysftp, giving error as Info: Python (1): Error: No hostkey for host sftp://st1.aetna.com found.

Any solution for the hostkey, some reason, I am not finding the hostkey on the machine .. not sure why. 

Appericate any assistance with this.

 

Using Paramiko was not successful either, let me try again and get back. 

 

srajapandian
8 - Asteroid

I am basically wanting to delete the file whether it exists or not but getting error if the file doesn't exist . Not sure how to proceed 

Tried 2 >dev/null, 

exit 0 and nothing seem to work.  

srajapandian
8 - Asteroid

I tried using Paramiko as well, getting the error 'Info: Python (1): An error occurred: [Errno 11001] getaddrinfo failed' ,

but I am able to use bat file and winscp to connect and remove the file, Only issue is, the bat command fails if the file doesn't exist maing the workflow fail - any way to proceed with this. 

apathetichell
19 - Altair

tbh --- this sounds like your paramiko script is wrong. I'd use paramiko. I'd look into why it wasn't working in vscode. I'd develop there. I'd then transfer to alteryx. I'd focus on things like encoding of the RSA key ---> and reading in files in python.

Labels
Top Solution Authors