Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13948

Repositories that aren't mirrored log an entry on the mirror as "A repository with ID '<repo_id>' is not mirrored by this mirror server or the repository does not exist"

    XMLWordPrintable

Details

    Description

      Problem

      The below Debug message is logged on the mirror logs when a user hovers the mouse over the "Clone" button in the Bitbucket Upstream UI for a repository that is not mirrored.

      Bitbucket will investigate which mirrors have this repository when this activity is carried out in order to display the URLs from which the repository can be cloned.

      Those mirrors that lack the repository will still have the DEBUG log message written to them.

      It would be better if we reduced the amount of information we display in the logs, such as restricting it to simply the first entry and without displaying the stack trace, as this might be confusing as it appears with a full stack trace on the logs.

      2023-04-05 15:23:52,925 DEBUG [http-nio-7990-exec-8] upstream_881d133c-32a6-3795-9de6-52661f3708ba @1XIGGYKx923x55x0 1ipc6i7 172.29.177.5,10.9.30.4 "GET /rest/mirroring/latest/upstreamServers/881d133c-32a6-3795-9de6-52661f3708ba/repos/3 HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 404
      

      Environment

      Bitbucket 7.17, 7.21.x

      Steps to Reproduce

      • Create 2 projects in Bitbucket Upstream server
      • Mirror one of the Projects to the Mirrors
      • Enable Debug on the Mirror using the options mentioned here
      • In the Bitbucket Upstream server open the repo which isn't Mirrored and look for the available clone URLs
      • This will write the DEBUG entry on the Mirror. logs where this repo isn't mirrored

      Expected Results

      An entry on the Mirror debug log stating the repo isn't available on the Mirorr since it isn't Mirrored with no stack trace

      Actual Results

      • Mirror logs are logged with the below log entry and stack trace
        2023-04-05 15:23:52,925 DEBUG [http-nio-7990-exec-8] upstream_881d133c-32a6-3795-9de6-52661f3708ba @1XIGGYKx923x55x0 1ipc6i7 172.29.177.5,10.9.30.4 "GET /rest/mirroring/latest/upstreamServers/881d133c-32a6-3795-9de6-52661f3708ba/repos/3 HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 404
        com.atlassian.bitbucket.repository.NoSuchRepositoryException: A repository with ID '3' is not mirrored by this mirror server or the repository does not exist
        	at com.atlassian.bitbucket.internal.mirroring.mirror.DefaultMirroredRepositoryService.getRepository(DefaultMirroredRepositoryService.java:91)
        	at com.atlassian.bitbucket.internal.mirroring.mirror.rest.UpstreamServerResource.getMirroredRepository(UpstreamServerResource.java:87)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	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.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.onSuccess(StashAuthenticationFilter.java:219)
        	at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:100)
        	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.lambda$doFilter$0(AccessTokenFilter.java:74)
        	at com.atlassian.oauth2.scopes.request.DefaultScopesRequestCache.doWithScopes(DefaultScopesRequestCache.java:34)
        	at jdk.internal.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
        	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
        	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
        	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
        	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
        	at com.atlassian.oauth2.provider.core.web.AccessTokenFilter.doFilter(AccessTokenFilter.java:71)
        	at com.atlassian.bitbucket.internal.mirroring.mirror.web.MirrorInterceptorFilter.doFilter(MirrorInterceptorFilter.java:99)
        	at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
        	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.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
        	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)
        	... 243 frames trimmed
        

      Workaround

      Disable Mirror debug logging

      Notes

      Since it indicates that the repository that was looked for in the Upstream isn't Mirrored on the Mirror node, this DEBUG entry is completely safe.

      Attachments

        Issue Links

          Activity

            People

              744c7388e89a Jemma Zhang
              5338c0aa34f9 Danny Samuel
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: