n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
46.32k stars 6.59k forks source link

AWS S3 repeats first item in search with prefix #10996

Open leesilverman opened 1 day ago

leesilverman commented 1 day ago

Bug Description

Looks like for whatever reason the AWS s3 module is just using the first item over and over again instead of looping through all items.

Prefix option is set to use a value from the input. Input has 3 items. The folder (prefix) for the first item has 9 objects. The output has 27 objects. It's the 9 objects from the first item, repeated 3x - once for each input item.

{ "meta": { "instanceId": "56a3b6e808c84fdadd2d80585289500a7b27625c2792fc6c214518fe7ce0a003" }, "nodes": [ { "parameters": { "resource": "bucket", "operation": "search", "bucketName": "wrd-media-archive", "returnAll": true, "additionalFields": { "prefix": "=instagram/{{ $json.id }}" } }, "id": "6db668ef-823d-4fdc-b267-e64c998e3f7d", "name": "List wrd-media-archive-directory", "type": "n8n-nodes-base.awsS3", "typeVersion": 2, "position": [ 1800, 1040 ], "credentials": { "aws": { "id": "xT7Ztjk2dBmYX3TD", "name": "Lee WRD AWS API Key access" } } } ], "connections": {}, "pinData": {} }

To Reproduce

  1. Create a dummy/test bucket
  2. Create an S3 folder named "test"
  3. Create 4 subfolders in test named a, b, c, d
  4. In each subfolder, upload a few files, but make sure they're different so you can distinguish the file contents of a vs b vs c
  5. Create an input with 4 items: id="a", "id="b", etc
  6. Set the AWS S3 module to "Search" and set the prefix option to "test/{{$json.id}}

If you reproduce the bug, you'll see the objects in subfolder a 4x in the output, instead of seeing separate results for each input row.

Expected behavior

All items in the input should be processed. Ideally there's a 1-1 correspondence, where one input row = one output row with an array of search results or empty if there are no results.

Operating System

Amazon Linux 2003

n8n Version

1.59.4

Node.js Version

22

Database

PostgreSQL

Execution mode

main (default)

Joffcom commented 1 day ago

Hey @leesilverman,

We have created an internal ticket to look into this which we will be tracking as "GHC-261"