-
Notifications
You must be signed in to change notification settings - Fork 95
queryApi.QueryAsync returns GZipped request #310
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi @sunserg, thanks for using our client. I am not able to simulate your using System;
using System.Threading.Tasks;
using InfluxDB.Client;
namespace Examples
{
public static class GZIPQueryWriteExample
{
private const string Host = "http://localhost:9999";
private const string Token = "my-token";
private const string Bucket = "my-bucket";
private const string Organization = "my-org";
public static async Task Main(string[] args)
{
//
// Initialize Client
//
var options = new InfluxDBClientOptions.Builder()
.Url(Host)
.AuthenticateToken(Token.ToCharArray())
.Org(Organization)
.Bucket(Bucket)
.Build();
var client = InfluxDBClientFactory.Create(options).EnableGzip();
//
// Prepare data
//
await client.GetWriteApiAsync().WriteRecordAsync("mem,tag=a value=1i");
//
// Query Data
//
var query = $"from(bucket:\"{Bucket}\") |> range(start: 0) |> last()";
var list = await client.GetQueryApi().QueryAsync(query);
list.ForEach(it =>
{
foreach (var record in it.Records)
{
Console.WriteLine($"{record.GetValueByKey("_time")} {record.GetMeasurement()}: {record.GetField()} {record.GetValue()}");
}
});
client.Dispose();
}
}
} Can you share debug output from the client? You can enable debug mode by: client.SetLogLevel(LogLevel.Body); Specifications:
Regards |
Hi Jakub, Thank you for looking into it. This is relevant portion of the log:
Regards, Serge |
Thanks for your information, it looks like encoding problem. Does |
yes |
What is your system encoding for the Windows? |
Windows PowerShell Try the new cross-platform PowerShell https://aka.ms/pscore6 Loading personal and system profiles took 1252ms. IsSingleByte : True |
@sunserg I've used same configuration and Which version of |
@bednar I'm using .net6.0.4 and .net5.0.16. GZIPQueryWriteExample does work with only one point returned. However: if I change (to add more data) in the line:
to
It does not work anymore. Error is the same:
In my code it is also working with small amount of data returned. But starting from some number of points it fails to unzip. Regards, Serge |
@bednar Thanks! I hope it will be accepted soon. |
It seems that when Gzip compression is enabled, the responce is not unzipped.
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
Expected behavior:
List<FluxTables?> returned.
Actual behavior:
Exception:
Specifications:
The text was updated successfully, but these errors were encountered: