EDI orders are place in /files directory regardless of directory defined
Description
CSP Request Details
CSP Rejection Details
Potential Workaround
Attachments
- 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
hideTestRail: Results
Activity
Susanne Gill September 26, 2023 at 4:08 AM
@Dennis Bridges Thanks.
Joseph Reimers September 25, 2023 at 3:49 PM
Thanks, @Serhii_Nosko. I am satisfied with this.
Serhii_Nosko September 25, 2023 at 3:35 PMEdited
We have tested this functionality, please see previous comment from @Irakli Merabishvili 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
@Serhii_Nosko 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 @Susanne Gill, 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.
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