cli icon indicating copy to clipboard operation
cli copied to clipboard

cannot read body: context deadline exceeded

Open jonathan-mothership opened this issue 1 year ago • 2 comments

algolia version 1.6.11

algolia objects browse shipments > algolia-shipments.jsonl
cannot read body: context deadline exceeded

We can't seem to pull our indexes down locally with the browse function and not sure if there's a timeout setting that can used to adjust this.

Some of the index manages to come down, in some cases hundreds of megabytes, but never a successful download of the index.

jonathan-mothership avatar Jul 01 '24 20:07 jonathan-mothership

I was also not able to succeed by setting the page size to a low value:

 algolia objects browse shipments --hitsPerPage 20  > algolia-shipments.jsonl

Got ~300MB down but still ended up with the same error

cannot read body: context deadline exceeded

jonathan-mothership avatar Jul 01 '24 20:07 jonathan-mothership

Hi @jonathan-mothership and thanks for your report.

Your issue might come from the read timeout parameter, used by the Go API Client which the CLI rely on. The read timeout default value is 5 seconds.

There is currently no way to configure this timeout in the CLI, but this is definitely something we could implement in a future release. In the mean time, in order to confirm the source of your issue, will you be able to build the CLI locally?

If that's the case, you will have to add the following change in this file

clientCfg := search.Configuration{
			AppID:          appID,
			APIKey:         APIKey,
			ExtraUserAgent: fmt.Sprintf("Algolia CLI (%s)", appVersion),
			Hosts:          f.Config.Profile().GetSearchHosts(),
+                       ReadTimeout: 10 * time.Second
		}

Let me know if that helps.

clemfromspace avatar Jul 22 '24 07:07 clemfromspace