Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting H3_INTERNAL_ERROR on calling via h3 preference #33

Open
rajat-ventura opened this issue Oct 26, 2024 · 4 comments
Open

Getting H3_INTERNAL_ERROR on calling via h3 preference #33

rajat-ventura opened this issue Oct 26, 2024 · 4 comments

Comments

@rajat-ventura
Copy link

rajat-ventura commented Oct 26, 2024

I am calling NGINX with http3 enabled and cronet is working fine as well as a request client. We are doing a PoC and are trying to use rhttp instead because of its speed. Could you please check if my implementation is wrong?

`
rAuthInvest = await RhttpCompatibleClient.create(
interceptors: [TimeInterceptor()],
settings: ClientSettings(
httpVersionPref: HttpVersionPref.http3,
timeoutSettings: TimeoutSettings(
timeout: Duration(seconds: 30),
connectTimeout: Duration(seconds: 10),
keepAliveTimeout: Duration(seconds: 60),
),
throwOnStatusCode: true,
)
);

Future orderbookHeaders(
{Function(dynamic data)? onSuccess,
Function(dynamic error)? onError,
Map<String, String> headers = const {},
Map requestData = const {}}) async {

try {
  Map<String, String> h = {
  "Content-type": "application/json",
  "Access-Control-Allow-Origin": "*",
  "User-Agent": "Dart/3.4",
  // "Accept-Encoding": ['gzip', 'br'],
  "Authorization": "Bearer ${prefUtils.getAuthtoken()}",
  "session_id": prefUtils.getSsoSessionId(),
  "x-client-id": prefUtils.getclientid(),
};
  var response;
  try {
    response = await HTTP3.rAuthInvest.post(
        Uri.parse("$ordersUrl/txn/orderbook/v1/header"),
        headers: h,
        body: jsonEncode(requestData));
  } catch(e) {
    print(e.toString());
  }
  if (response.statusCode < 400 && onSuccess != null) {
    onSuccess(response.body);
  } else {
    onError!(
      response.bodyMap.containsKey("message")
          ? response.bodyMap["message"]
          : 'Something Went Wrong!',
    );
  }
} catch (error) {
  onError!(error);
}

}
`

Screenshot 2024-10-26 at 11 07 26 AM

any support would be really helpful

@rajat-ventura
Copy link
Author

rajat-ventura commented Oct 26, 2024

I just dug a bit deeper and this line is throwing the error

final rustResponse = await responseCompleter.future;
in request.dart line 160
Screenshot 2024-10-26 at 11 52 56 AM

@Tienisto
Copy link
Owner

H3_INTERNAL_ERROR seems like an error on the Rust side.

@rajat-ventura
Copy link
Author

is there any way i can look into the RCA on what was wrong from my end? and maybe try to fix it

@Tienisto
Copy link
Owner

An option would be to run write the exact request in Rust to check if Rhttp doesn't do anything wrong. If it still occurs, then maybe there is a solution in reqwest or h3 Github repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants