Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listObjects for bucket with "folders" results in TypeError: xmlobj.CommonPrefixes.forEach is not a function #904

Closed
starpit opened this issue Feb 5, 2021 · 5 comments

Comments

@starpit
Copy link

starpit commented Feb 5, 2021

When 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/"}

Related? #886

@starpit
Copy link
Author

starpit commented Feb 5, 2021

I just checked, and this seems to be fixed on master. Can we expect a release on npm sometime soon? Thanks.

@standy
Copy link

standy commented Feb 24, 2021

Same issue here, fix #887 is merged already
@prakashsvmx can you make a release please?

@ondra-m
Copy link

ondra-m commented May 17, 2021

Can you please make next release?

@gitzjp
Copy link

gitzjp commented Jun 10, 2021

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().

@prakashsvmx
Copy link
Member

Please test with latest released version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants