EDI orders are place in /files directory regardless of directory defined

Description

Edifact FTP attempts to put files into a /files directory.  This can cause it to fail - depending on the ftp permissions.  Log example:

19:36:04 [] [] [] [] INFO SimpleStepHandler Executing step: [mapToEdifactStep]
19:36:04 [] [] [] [] INFO MapToEdifactTasklet Execute MapToEdifactTasklet
19:36:04 [] [] [] [] INFO MapToEdifactTasklet GET purchase orders query: (workflowStatus==Open and vendor==redacted and poLine.automaticExport==true and cql.allRecords=1 NOT manualPo==true)
19:36:05 [] [] [] [] INFO AbstractStep Step: [mapToEdifactStep] executed in 324ms
19:36:05 [] [] [] [] INFO SimpleStepHandler Executing step: [saveToMinIOStep]
19:36:05 [] [] [] [] INFO BaseFilesStorage Writing with using AWS SDK client
19:36:05 [] [] [] [] INFO AbstractStep Step: [saveToMinIOStep] executed in 163ms
19:36:05 [] [] [] [] INFO SimpleStepHandler Executing step: [saveToFTPStep]
19:36:05 [] [] [] [] INFO ectStorageRepository Connected to redacted
19:36:05 [] [] [] [] INFO ectStorageRepository Success login to FTP
19:36:05 [] [] [] [] INFO ectStorageRepository A directory has been created: /files
19:36:05 [] [] [] [] ERROR ectStorageRepository Error uploading file
2023-09-06T15:36:05.811-04:00
    org.folio.dew.exceptions.FtpException: File upload failed. Please check if user has write permissions
    
    
    
The Order directory is set to  /drop-off
The Invoice directory is set to /pick-up

Slack conversation: https://folio-project.slack.com/archives/C217N937A/p1693213284590499

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

1) Change application.properties and restart mod-data-export-worker if using FTP upload I see in code that for FTP we are using workingDirectory from application config file, so just need to change this '/files' path to any one and restart mod-data-export-worker module Link 2) Use SFTP upload SFTP upload logic already using 'orders' path that user specified during creating Organization Integration details Link{} 3) Manually upload the file to FTP Users are able to download the generated edit file from the export manager application in the FOLIO UI. So the user could grab the file and add it to FTP manually after it is generated.

Attachments

5
  • 25 Sep 2023, 11:10 AM
  • 21 Sep 2023, 09:05 AM
  • 21 Sep 2023, 09:03 AM
  • 18 Sep 2023, 03:00 PM
  • 18 Sep 2023, 02:59 PM

defines

relates to

Checklist

hide

TestRail: Results

Activity

Show:

Susanne Gill September 26, 2023 at 4:08 AM

Thanks.

Joseph Reimers September 25, 2023 at 3:49 PM

Thanks, . I am satisfied with this.

Serhii_Nosko September 25, 2023 at 3:35 PM
Edited

We have tested this functionality, please see previous comment from where we use ftp and uploaded files to files/test/inner.

So on our ftp server for folio user only the /files/... directory is open, for other ones we will have an ftp upload error.

Sysadmins can open any directory, user can specify this directory in Organization Integration Details and this directory can be used to store exported files.

Also we have logs, after successful upload the key phrase is: "File uploaded to ftp path: {}", if directory is forbidden or other failure - "Error uploading to ftp path: {}"

PR to get any directory from Organization Integration details here and was merged: https://github.com/folio-org/mod-data-export-worker/pull/480 

Going to close this story, please feel free to reopen if some other clarification details are needed or have some additional questions.

Joseph Reimers September 25, 2023 at 3:01 PM

Is there any way to check logs or otherwise do an audit to ensure that the URL FOLIO attempts to FTP to exactly matches the URL configured in EDI settings? I think it's OK if the export fails if we can verify that the URL configured matches the URL actually used.

Dennis Bridges September 25, 2023 at 2:31 PM

Thank you , this fix does aim to allow the user to specify any path for FTP file transfer. I believe there is some confusion of language in the comments above. We will verify once again that when user is creating an "EDI Integration" the resulting file will be uploaded to the path specified in the input field.

Eg. When user inputs a server address of ftp://ftp.ci.folio.org and an order directory of /test. FOLIO will generate di files and attempt to upload them to sftp://ftp.ci.folio.org/test user the specified username and password.

Done

Details

Assignee

Reporter

Labels

Priority

Story Points

Sprint

Development Team

Thunderjet

Fix versions

Release

Poppy (R2 2023)

RCA Group

Implementation coding issue

Affected Institution

!!!ALL!!!

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created September 7, 2023 at 6:33 PM
Updated September 26, 2023 at 10:49 AM
Resolved September 25, 2023 at 3:35 PM
TestRail: Cases
TestRail: Runs

Flag notifications