Incorrect Groovy Configuration

Last modified by Erik Bakker on 2024/09/03 10:17

In this document, we will use the actual root cause analysis information to make a generic view that can be used if you run into the same or similar problem. Finally, the document will describe the situation, the problem, the analysis, and the result.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Situation

A report showed that a previously working Groovy script was not functioning anymore. The goal of the Groovy script was to remove messages from an SFTP to ensure that the amount of data on the SFTP would not grow out of control.

2. Problem

A seemingly broken Groovy script that was not executing as it should.

3. Analysis

3.1 Reproduction

The first thing we did was compare the Groovy script to the Groovy script that is available in the eMagiz Store and was before accessible by members of the eMagiz Competence Center. During this comparison, we noted several discrepancies between both of them. Some of them could be explained because the Groovy script in the store assumes the archive location is a local folder, and in this case, the archive folder is located on the SFTP. Some of them, however, differed without such a clear explanation.

3.2 Analysis

To adhere to the best practice, we rewrote the part (outside the SFTP connection) to mimic the Groovy script in the store. With those changes, we reran the script and got a working solution that removes the folder in question, which is the intended behavior of the script.

4. Result

Once the Groovy script was changed to reflect best practices, it fulfilled its function again.

5. Suggested Additional Readings