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

HttpSender sends an empty body in ACRA 5.11.1 #1252

Closed
aloz77 opened this issue Oct 19, 2023 · 6 comments
Closed

HttpSender sends an empty body in ACRA 5.11.1 #1252

aloz77 opened this issue Oct 19, 2023 · 6 comments
Labels

Comments

@aloz77
Copy link

aloz77 commented Oct 19, 2023

Describe the bug
After update to ACRA 5.11.1 the request body (HTTP POST content) sent by HttpSender is empty.

Expected behavior
The request body contains all information about the crash. No issues with ACRA 5.11.0

Code to reproduce

ACRA.init(this, new CoreConfigurationBuilder()
                   .withBuildConfigClass(BuildConfig.class)
                   .withReportFormat(StringFormat.KEY_VALUE_LIST)
                   .withPluginConfigurations(
                           new ToastConfigurationBuilder()
                                   .withText(getString(R.string.crash_toast_text))
                                   .build()
                           )
                   .withPluginConfigurations(
                           BuildConfig.DEBUG ?
                           new LimiterConfigurationBuilder()
                                   .withPeriod(1)
                                   .withPeriodUnit(TimeUnit.DAYS)
                                   .withOverallLimit(250)
                                   .withExceptionClassLimit(100)
                                   .withStacktraceLimit(50)
                                   .withFailedReportLimit(50)
                                   .withIgnoredCrashToast("App stopped working again")
                                   .build() :
                           new LimiterConfigurationBuilder()
                                   .withPeriod(7)
                                   .withPeriodUnit(TimeUnit.DAYS)
                                   .withOverallLimit(25)
                                   .withExceptionClassLimit(10)
                                   .withStacktraceLimit(5)
                                   .withFailedReportLimit(5)
                                   .withIgnoredCrashToast("App stopped working again")
                                   .build()
                   )
                   .withPluginConfigurations(
                           new HttpSenderConfigurationBuilder()
                                   .withConnectionTimeout(8000)
                                   .withDropReportsOnTimeout(true)
                                   .withUri(getCrashReportUrl())
                                   // Disable it by config in order to enable it in the custom HttpSender
                                   .withEnabled(false)
                                   .build()
                   )
                   .withReportContent(fields)
@AutoService(ReportSenderFactory.class)

public class MyCrashSenderFactory implements ReportSenderFactory {

    @NonNull
    public ReportSender create(@NonNull Context context, @NonNull CoreConfiguration config) {
        return new HttpSender(config, HttpSender.Method.POST, StringFormat.KEY_VALUE_LIST, getCrashReportUrl());
    }

    @Override
    public boolean enabled(@NonNull CoreConfiguration coreConfig) {
        return true;
    }
}

Version

  • Android: 12
  • ACRA 5.11.1 and 5.11.2
@F43nd1r
Copy link
Member

F43nd1r commented Oct 19, 2023

How did you determine that the body is empty? In my testing the body is correctly there in both ACRA logs and what the server reveices.

@aloz77
Copy link
Author

aloz77 commented Oct 19, 2023

I'm watching what the HTTP server receives.

@F43nd1r
Copy link
Member

F43nd1r commented Oct 19, 2023

Is your http server unable to handle chunked requests? That's the only relevant change in that version

@aloz77
Copy link
Author

aloz77 commented Oct 19, 2023

It's standard nginx/PHP-FPM. I will check about chunked requests.

@aloz77
Copy link
Author

aloz77 commented Oct 20, 2023

Not sure which issue we are running now exactly in. But there have been different issues with FastCGI/PHP-FPM and chunked transfer-encoding in HTTP requests with different web servers in the past. Check here and there:

Before I try to reconfigure/fix the server components, is there a way to disable chunked request by configuration of ACRA?

@F43nd1r
Copy link
Member

F43nd1r commented Oct 20, 2023

Before I try to reconfigure/fix the server components, is there a way to disable chunked request by configuration of ACRA?

Not yet, but I guess if it makes issues it should be

@F43nd1r F43nd1r added the bug label Oct 20, 2023
@F43nd1r F43nd1r closed this as completed Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants