ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.04k stars 3k forks source link

IPFS Add With Directory+OnlyHash Through Reverse Proxy Gives Timeout Errors #6724

Open bonedaddy opened 4 years ago

bonedaddy commented 4 years ago

Version information:

go-ipfs version: 0.4.22-
Repo version: 7
System version: amd64/linux
Golang version: go1.12.7

Description:

A user of one of my services has routinely had propblems with go-ipfs nodes timing out when running the js-ipfs-http-client equivalent of go-ipfs ipfs add with a very particular set of options. They have to be:

When this kind of request is happening I can see logs like the following on my go-ipfs node:

Oct 22 23:57:35 delta-node-2 ipfs_manager_script.sh[20924]: 23:57:35.234 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 04:05:18 delta-node-2 ipfs_manager_script.sh[20924]: 04:05:18.128 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 04:30:20 delta-node-2 ipfs_manager_script.sh[20924]: 04:30:20.757 ERROR  basichost: resetting stream deadline:  stream closed basic_host.go:267
Oct 23 05:00:30 delta-node-2 ipfs_manager_script.sh[20924]: 05:00:30.294 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:01:42 delta-node-2 ipfs_manager_script.sh[20924]: 05:01:42.075 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:03:11 delta-node-2 ipfs_manager_script.sh[20924]: 05:03:11.903 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:04:46 delta-node-2 ipfs_manager_script.sh[20924]: 05:04:46.363 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:13:40 delta-node-2 ipfs_manager_script.sh[20924]: 05:13:40.364 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:21:39 delta-node-2 ipfs_manager_script.sh[20924]: 05:21:39.093 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:23:41 delta-node-2 ipfs_manager_script.sh[20924]: 05:23:41.214 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47
Oct 23 05:59:38 delta-node-2 ipfs_manager_script.sh[20924]: 05:59:38.902 ERROR       core: failure on stop:  context canceled; TODO: mock repo builder.go:47

It doesn't appear that this option combination will always cause the issue, but more often than not it will. I'm using a custom proxy server I wrote using https://golang.org/pkg/net/http/httputil/ however I highly doubt this is the probelm, as the service is extremely stable under all other conditions, except when this particular option combination is being invoked.

Stebalien commented 4 years ago

Those errors need to be fixed but they're unrelated. To hash only, we create an ephemeral IPFS node, add the file, then shut down the node. That error shows up on shutdown.


After this hangs for a while, could you past the output of:

  1. ipfs diag cmds
  2. running the collect-profiles.sh script from bin (in this repo).
bonedaddy commented 4 years ago

Yea I'll try and grab that :ok_hand:

lordcirth commented 4 years ago

@postables Have you been able to reproduce the issue?

bonedaddy commented 4 years ago

Not at the moment, I haven't had time and the user that was reporting this issue is doing a work-around by computing the hash locally.