listObjects for bucket with "folders" results in TypeError: xmlobj.CommonPrefixes.forEach is not a function
See original GitHub issueWhen we call client.listObjects("someBucketName")
for a bucket that contains a “folder” (i.e. an object with a trailing slash), the callback actually hangs! When we hack xml-parsers.parseListObjectsQuery to wrap the body with a try/catch, we see:
TypeError: xmlobj.CommonPrefixes.forEach is not a function
at parseListObjects (xml-parsers.js:382)
further modifying that function to print out xmlobj.CommonPrefixes
gives:
{Prefix: "f1/"}
We see this in 7.0.17.
With 7.0.18, the client still hangs, but now the hanging exception is:
TypeError: xmlobj.Contents.forEach is not a function
at parseListObjects (xml-parsers.js:388)
I suspect that 7.0.18 just has more bugs, because CommonPrefixes is still not forEach-able, in 7.0.18; it’s still not an array:
{Prefix: "f1/"}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
listObjects for bucket with "folders" results in TypeError: xmlobj ...
listObjects for bucket with "folders " results in TypeError: xmlobj.CommonPrefixes.forEach is not a function.
Read more >aws s3 sdk list objects by multiple prefixes - node.js
I have this same issue and couldn't change the key prefixes. It's pretty easy to do multiple calls, just create a prefixes array...
Read more >Amazon S3 and PHP | How to list only top level folders in a ...
This will list only the top level folder. If we do not use delimiter with listObject function then it will give list of...
Read more >List files and folders of AWS S3 bucket using prefix & delimiter
Every file that is stored in s3 is considered as an object. Each Amazon S3 object has file content, key (file name with...
Read more >Viewing online file analysis results for 'mongodumpxp.exe'
Name Ordinal Address
??0Arg@pcrecpp@@QAE@PAD@Z #1 0x479fc0
??0Arg@pcrecpp@@QAE@PADP6A_NPBDHPAX@Z@Z #2 0x47a0e0
??0Arg@pcrecpp@@QAE@PAE@Z #3 0x479fc0
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just checked, and this seems to be fixed on master. Can we expect a release on npm sometime soon? Thanks.
I had the same problem and i solved it using listObjectsV2().