✓ Solved

Using object storage bucket with node.js

In the documentation it says that linode object storage is compatible with AWS S3 node.js package. So I tried to use the package in my backend development. However, I encountered an error that says:

TypeError: Converting circular structure to JSON --> starting at object with constructor 'Object' --- property 'issuerCertificate' closes the circle

Is there a solution to this?
When I searched for answers, I didn't find a solution.

If you want to have a look at my code, it's in the following stackoverflow link:

https://stackoverflow.com/questions/78424370/converting-circular-structure-to-json-error-while-using-aws-sdk-client-s3-packa

P.S: my bucket doesn't have a dot (.) in the name.

Thanks in advance…

3 Replies

✓ Best Answer

I'm not too familiar with using AWS S3 Node.js package, but I was able to locate a discussion that specified that you need will need to pass an “endpoint” into the client constructor specifying “https://[location].linodeobjects.com”; where [location] is one of the object storage cluster names. In case you need assistance with locating your cluster's region, you can refer to our list of endpoints.

When I reviewed your code, I noticed that the endpoint was different from this example code's endpoint. I'm not entirely confident that this could be the issue, but it wouldn't hurt to compare the two.

I was also able to locate this other StackOverflow post where a fellow user provided their example code on how they were able to successfully upload a file from Node.js to Linode Object Storage:

Lastly, you could also reach out to Node.js's community forums, as there may be experienced members who may be able to weigh in and provide guidance:

Thanks for pointing out that my endpoint is different.

The error you're encountering typically happens when you try to stringify an object with circular references, like in your case with the AWS SDK for S3 in Node.js. To resolve this, ensure you're not trying to stringify the entire S3 object when logging or returning JSON responses. Instead, focus on extracting and handling specific properties or data from the S3 response that you need. I was in a tight spot with my dissertation and needed help quickly. https://lastminutewriting.com/dissertation provided the assistance I needed. Their service was fast and efficient, delivering a high-quality dissertation that met all my requirements. The writer was very knowledgeable, and the customer support team was very helpful. I highly recommend their services for urgent academic needs.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct