# IPFS cluster add file error

**URL:** <https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050>\
**Category:** Uncategorized\
**Tags:** go-ipfs\
**Created:** [April 22, 2022, 3:20pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050 "2022-04-22T15:20:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 22, 2022, 3:20pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/1 "2022-04-22T15:20:16Z")

</div>

Hi guys,

I recently encounter this error after operating IPFS for a few weeks. It just occurred recently (we do not have any updates recently). Everything was working fine from the beginning.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/7/70ff879f473d6fc1aa1327f492db294fb0889491.jpeg)  
Besides, there were error `ERROR	core/commands/cmdenv	pin/pin.go:133	context canceled` occurs in the IPFS node as well.

FYI, the screenshot logs is from an IPFS cluster instance. The IPFS cluster runs in the same container with the IPFS node.

Appreciate any advice.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [April 22, 2022, 11:44pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/2 "2022-04-22T23:44:38Z")

</div>

This error means that block/put hangs and timeouts out on IPFS. Perhaps ipfs is in the middle of a long GC round, or it is so busy that it cannot write blocks to disk. An ipfs error in any case.

Cluster timeouts for ipfs operations are adjustable in the cluster config (`ipfshttp` section), but I think defaults are more than enough.

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 23, 2022, 12:07am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/3 "2022-04-23T00:07:42Z")

</div>

This is happening for days and for all of the incoming requests. Wondering what task is taking place that make IPFS so busy.

Also tried restarting the container as well but no luck.

Do you have any advice on debugging this?

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 23, 2022, 8:02am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/4 "2022-04-23T08:02:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/c/cc7fb1610b2da0a4ebb388a4a7e73ca9fd8b9176.jpeg)

Encounter new error today @hector. Really confused what is happing!  
Please advice if you know the cause. Many thanks!

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [April 23, 2022, 1:53pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/5 "2022-04-23T13:53:32Z")

</div>

That error is probably unrelated. I’m thinking perhaps the request is being aborted and that causes the context.Cancelled. Do you have nginx in front of the cluster API or something like that?

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 23, 2022, 3:38pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/6 "2022-04-23T15:38:09Z")

</div>

We have an API gateway for our backend APIs. The backend internally makes requests to the cluster API. The cluster API here is just exposed internally (only the backend can make requests to it).

Thanks for the hint. Let me test it further. But personally I do not think this is the reason.

If you come up with any idea, please let me know. Many thanks Hector.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [April 23, 2022, 9:36pm UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/7 "2022-04-23T21:36:59Z")

</div>

Your log excerpts are very short.

Do all requests fail? Just some?

Do they fail immediately? Do they hang and fail later? Do they fail when block/putting the first block, a random block, the last block? Is it always when “finalizing”?

I have trouble that your log says “error when finalizing”, but that is just doing the pin and I believe the context is already cancelled, and that can only happen if the request died.

You can run `ipfs-cluster-service --log-level ipfshttp:debug,adder:debug daemon` and get more info in the logs.

Also, make sure your application calling the /add endpoint is prepare to both write the request and read responses at the same time. Nginx breaks the moment the server emits a response, aborting requests that have not fully sent the multiparts.

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 24, 2022, 1:21am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/8 "2022-04-24T01:21:49Z")

</div>

Many thanks Hector. I will check it further.

In the mean time, here are some info for you

**Do all requests fail? Just some?**

Yes, all the requests fail.

**Do they fail immediately? Do they hang and fail later? Do they fail when block/putting the first block, a random block, the last block? Is it always when “finalizing”?**

It fails immediately (right after the /add request), and the error messages are always the ones I screenshot. The errors are the same for all request failures.

======

Some new info: We got some unpinned CIDs and the cluster keeps retrying pinning them without any success (this also happened recently, at the same time with all the errors in this posts. Everything was fine at the beginning). Only have logs **ERROR core/commands/cmdenv pin/pin.go:133 context canceled** on the IPFS side. No error logs on the cluster side

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/6/6bdfe6d591945fb26fa5eafc64c3f661734a8e09.jpeg)

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 26, 2022, 3:23am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/9 "2022-04-26T03:23:54Z")

</div>

Hi @hector,

The error seems to come from the DNS setup. We are checking it further. Really thanks for the hint.

====

I have a new question. Currently we receive different API response for the same API call (`/add` request). Wonder what config/setup that results in the following differences.

Response 1:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/5/5079a88ce34bb7f48e8c51b85ddb36890af8a786.png)

Response 2:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/5/56a832c87a18917c6558ed1dc68923342cea3e04.png)

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 26, 2022, 7:29am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/10 "2022-04-26T07:29:18Z")

</div>

The above difference seems coming from the recent update of ipfs-cluster from v0.14 → v1.0.0.  
Is it correct @hector?

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [April 26, 2022, 8:38am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/11 "2022-04-26T08:38:27Z")

</div>

> [@khoanguyen](#):
>
> The above difference seems coming from the recent update of ipfs-cluster from v0.14 → v1.0.0.  
> Is it correct @hector?

Yes: [https://github.com/ipfs/ipfs-cluster/blob/master/CHANGELOG.md#add-endpoint-changes](https://github.com/ipfs/ipfs-cluster/blob/master/CHANGELOG.md#add-endpoint-changes)

> [@khoanguyen](#):
>
> The error seems to come from the DNS setup.

Can you ellaborate?

---

<div class="post-metadata">

**Author:** ![khoanguyen](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@khoanguyen](https://discuss.ipfs.tech/u/khoanguyen)\
**Post date:** [April 26, 2022, 8:49am UTC](https://discuss.ipfs.tech/t/ipfs-cluster-add-file-error/14050/12 "2022-04-26T08:49:18Z")

</div>

> [@hector](#):
>
> Can you ellaborate?

We are checking it further. Something related to our load balancer, I think. Really thanks for your help Hector!

> [@hector](#):
>
> Yes: [ipfs-cluster/CHANGELOG.md at master · ipfs/ipfs-cluster · GitHub](https://github.com/ipfs/ipfs-cluster/blob/master/CHANGELOG.md#add-endpoint-changes)

Thanks for the update. We will upgrade the cluster to latest version soon. Great project btw.
