viaacode / borndigital

Borndigital (pre-)ingests digitally born items into MediaHaven
0 stars 0 forks source link

Borndigital, as well, should be able to make non-existent destination-paths. #45

Closed maartends closed 4 years ago

maartends commented 5 years ago

When BD transfers a sidecar to the destination host (tra-server), it requires the destination path to exist. If not, it fails (Failed to change working directory to <destination_path>. Ftp error: 550. Type: class java.io.IOException).

The risk for this happening is currently being mitigated by the fact that the FXP service is capable of creating the required destination paths. However, this can only work if FXP is not busy.

As an illustration: BD couldn't create the dir //atv/TAPE-SHARE-EVENTS and keeps retrying. First retry on 2019-08-13 14:26, last retry (nr. 34705!!) on 2019-08-14 09:55 (after manual shutdown), aka, retrying for over 19 hours!.

The current "solution" is sub-optimal, to say the least.

An ticket for this issue exists: https://www.mulesoft.org/jira/browse/MULE-5192. As per that ticket, it would seem that the latest version of Mule's FTP connector should be able to create directories on the fly: http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/sftp/SftpClient.html#createSftpDirIfNotExists(org.mule.api.endpoint.ImmutableEndpoint,%20java.lang.String)

Other solutions exist as well: http://www.javaroots.com/2014/09/mule-ftp-create-directory-if-not-exist.html.

Relevant code:

https://github.com/viaacode/borndigital/blob/9decb66b286e3fe4d74c3fb1b26f2fbdb83cd5a4/src/main/app/deliveries.xml#L197-L203

maartends commented 5 years ago

Borndigital, as well, should be able to make non-existent destination-paths

dietervanhoof commented 5 years ago

The referenced ticket seems to only be resolved in Mule 4 and above. This means that the fix is most likely not present in the latest connector for Mule 3.

The custom connector is already used in this project for reading in file so in my opinion it's worth a shot trying it with this connector since it should create the destination directory if it doesn't exist.

maartends commented 5 years ago

Apparently, it does not. :-/

dietervanhoof commented 5 years ago

Issue: https://github.com/viaacode/sftp-lite-connector/issues/1 can be used to track the new feature.

maartends commented 4 years ago

Solved.