Control Freak seems to be causing Bitbucket internal server errors

Issue #547 resolved
Kent Rogers created an issue

I believe this is being opened in the correct location. I’m not sure because the Submit a support request link on the Control Freak Marketplace page goes to a dead link. I also sent an email to support@bit-booster.com on 6/18, but never received a reply.

Anyway, we have a Control Freak version 2024.06.10 installed in our Bitbucket Data Center instance (v8.9.12), and it appears to be causing an issue when trying to browse (and sometimes look at the Pull Requests) in the repositories for a particular project. We see errors like this in the Bitbucket application log:

2024-06-18 12:11:05,991 INFO [http-nio-8080-exec-8] Kent.Rogers *15CSN6Qx731x260360x1 1hfdgjw 172.30.41.110,10.153.47.253 "GET /plugins/servlet/bb_cf_activity/projects/BT/repos/vpr-carta/browse HTTP/1.1" o.e.g.b.s.e.s.OsgiServiceFactoryBean Publishing service under classes [{com.atlassian.sal.api.lifecycle.LifecycleAware, com.bitbooster.hook.ControlFreakRepoActivityServlet}]
2024-06-18 12:11:05,992 DEBUG [http-nio-8080-exec-8] Kent.Rogers *15CSN6Qx731x260360x1 1hfdgjw 172.30.41.110,10.153.47.253 "GET /plugins/servlet/bb_cf_activity/projects/BT/repos/vpr-carta/browse HTTP/1.1" c.a.s.s.a.l.PatchedLifecycleManager Calling LifecycleAware.onStart() 'com.bitbooster.hook.ControlFreakRepoActivityServlet@50f1929a' from plugin 'com.bit-booster.bb.hooks'
2024-06-18 12:11:06,031 ERROR [http-nio-8080-exec-8] o.a.c.c.C.[.[.[/].[plugins] Servlet.service() for servlet [plugins] in context with path [] threw exception
java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 20
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at com.bitbooster.hook.ControlFreakRepoActivityServlet.parseRawActivity(ControlFreakRepoActivityServlet.java:472)
at com.bitbooster.hook.ControlFreakRepoActivityServlet.probeRepo(ControlFreakRepoActivityServlet.java:430)
at com.bitbooster.hook.ControlFreakRepoActivityServlet.doGet(ControlFreakRepoActivityServlet.java:231)
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
at com.atlassian.analytics.client.filter.UniversalAnalyticsFilter.doFilter(UniversalAnalyticsFilter.java:75)
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:33)
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
at com.atlassian.bitbucket.internal.ratelimit.servlet.filter.RateLimitFilter.doFilter(RateLimitFilter.java:75)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:181)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:85)
at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81)
at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39)
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85)
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112)
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)
at com.atlassian.oauth2.provider.core.web.AccessTokenFilter.doFilter(AccessTokenFilter.java:82)
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69)
at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)
at com.atlassian.plugins.authentication.sso.web.filter.loginform.DisableNativeLoginAuthFilter.doFilter(DisableNativeLoginAuthFilter.java:55)
at com.atlassian.plugins.authentication.basicauth.filter.DisableBasicAuthFilter.doFilter(DisableBasicAuthFilter.java:70)
at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:26)
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:33)
at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90)
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84)
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)
at java.base/java.lang.Thread.run(Thread.java:829)
... 261 frames trimmed

Are there known issues with version 2024.06.10?

Some combination of stopping/starting Control Freak and/or disabling & re-enabling it for the project seems to work around the error, but it is pretty solid before trying all those things, and it continues to come back. The project/repos in question don’t have any non-standard Control Freak settings other that what is configured for the system.

The developer in the project has dug into it more and his theory is that the issue is somehow caused by Bitbucket accounts that do not have email addresses associated with them. We have a few such accounts which are service accounts used to facilitate automation, and the developer thinks they’ve noticed the issue when one of these users authors a Pull Request. Is it possible the ‘java.lang.StringIndexOutOfBoundsException’ error in the logs is attributable to the non-existent email address?

Please let me know what you think.

Thanks!

-Kent Rogers

Comments (3)

  1. Julius Davies [bit-booster.com] repo owner

    Thanks, we’re currently working on this and should have an update out soon (Monday or Tuesday next week).

    Rolling back to Control Freak version “v2024.04.01” or older will also make this issue go away since it’s caused by a new feature we introduced in version “v2024.05.28”.

  2. Julius Davies [bit-booster.com] repo owner

    Fixed in v2024.07.10 ! Thank you so much for this fantastic bug report !

  3. Log in to comment