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

In Bitbucket 8.x, when a user without an email address edits a file through the in-browser editor, an error is shown instead of a user-friendly message

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, 8.10.0, 8.11.0, 8.12.0, 8.13.0, 8.14.0
    • Mesh

    Description

      Issue Summary

      In Bitbucket 8.x, when a user without an email address edits a file through the in-browser editor, an error is shown instead of a user-friendly message.

      Bitbucket 8.x

      In Bitbucket 8.x, the message "An error occurred while processing the request. Check the server logs for more information" is shown in a popup dialog, e.g.:

       

      Bitbucket 7.x

      In contrast, in Bitbucket 7.x, the message "When performing an edit, the author must have an e-mail address." is shown, e.g.:

       

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Configure Bitbucket to sync users from an external user dir
      2. Create a user without an email address in the external user dir
      3. Sync the external user dir
      4. Grant the user Write permissions to a test project/repo
      5. Log on as the user without an email
      6. Edit a file and try to commit the changes

      Expected Results

      A user-friendly message is displayed instead of an error, same as in Bitbucket 7.x versions

      Actual Results

      The message "An error occurred while processing the request. Check the server logs for more information" is displayed in a popup dialog, as shown in the screenshot above.

      The following error is written to the $BITBUCKET_HOME/log/atlassian-bitbucket.log  file:

      2023-10-09 13:30:40,705 ERROR [http-nio-28120-exec-1 url: /b8120/rest/api/latest/projects/PROJ1/repos/repo1/browse/HelloWorld.java; user: service.user] service.user @696A7Gx810x1085x0 1xx5jfi 127.0.0.1 "PUT /rest/api/latest/projects/PROJ1/repos/repo1/browse/HelloWorld.java HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "PUT /rest/api/latest/projects/PROJ1/repos/repo1/browse/HelloWorld.java HTTP/1.1"
      io.grpc.StatusRuntimeException: UNKNOWN
          at io.grpc.Status.asRuntimeException(Status.java:535)
          at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:479)
          at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
          at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
          at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
          at com.atlassian.stash.internal.scm.git.mesh.LastSeenClientInterceptor$LastSeenClientListener.onClose(LastSeenClientInterceptor.java:40)
          at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
          at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
          at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
          at com.atlassian.stash.internal.scm.git.mesh.StatefulClientCallListener.onClose(StatefulClientCallListener.java:34)
          at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
          at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
          at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
          at com.atlassian.stash.internal.scm.git.mesh.DeadlinePropagatingClientInterceptor$DeadlinePropagatingListener.onClose(DeadlinePropagatingClientInterceptor.java:156)
          at com.atlassian.stash.internal.scm.git.mesh.ErrorHandlingClientInterceptor$ErrorHandlingCall$1.onClose(ErrorHandlingClientInterceptor.java:149)
          at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562)
          at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
          at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743)
          at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722)
          at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
          at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.lang.Thread.run(Thread.java:829)
          ... 1 frame trimmed
      

      A warning is logged in the $BITBUCKET_HOME/mesh/log/atlassian-mesh.log file, indicating a non-blank value is required related to the commit author:

      2023-10-09 13:30:40,702 WARN  [grpc-server:thread-240] service.user 1GKGB597x810x229x2 @696A7Gx810x1085x0 127.0.0.1 "CommitService/EditFile" (>2 <0) c.a.b.m.g.LoggingServerInterceptor RPC failed with an UNKNOWN error: null
      java.lang.IllegalArgumentException: A non-blank value is required
          at com.atlassian.bitbucket.mesh.git.builder.DefaultGitProcessBuilder.notBlank(DefaultGitProcessBuilder.java:1087)
          at com.atlassian.bitbucket.mesh.git.builder.DefaultGitProcessBuilder.withEnvironment(DefaultGitProcessBuilder.java:802)
          at com.atlassian.bitbucket.mesh.git.builder.DefaultGitProcessBuilder.author(DefaultGitProcessBuilder.java:280)
          at com.atlassian.bitbucket.mesh.git.builder.DefaultGitProcessBuilder.author(DefaultGitProcessBuilder.java:133)
          at com.atlassian.bitbucket.mesh.git.builder.AbstractGitProcessBuilder.author(AbstractGitProcessBuilder.java:81)
          at com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilderSupport.author(GitProcessBuilderSupport.java:79)
          at com.atlassian.bitbucket.mesh.git.file.DefaultEditFileManager.commit(DefaultEditFileManager.java:167)
          at com.atlassian.bitbucket.mesh.git.file.DefaultEditFileManager.editFile(DefaultEditFileManager.java:107)
          at com.atlassian.bitbucket.mesh.git.file.DefaultEditFileManager$$FastClassBySpringCGLIB$$30e3f25f.invoke(<generated>)
          at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
          at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
          at com.atlassian.bitbucket.mesh.spring.ProfilingAspect.profileMethod(ProfilingAspect.java:44)
          at jdk.internal.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
          at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
          at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
          at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
          at com.atlassian.bitbucket.mesh.git.file.DefaultEditFileManager$$EnhancerBySpringCGLIB$$e6ae1ca6.editFile(<generated>)
          at com.atlassian.bitbucket.mesh.git.EditFileRequestObserver.handleContent(EditFileRequestObserver.java:155)
          at com.atlassian.bitbucket.mesh.git.EditFileRequestObserver.onNext(EditFileRequestObserver.java:77)
          at com.atlassian.bitbucket.mesh.git.EditFileRequestObserver.onNext(EditFileRequestObserver.java:27)
          at com.atlassian.bitbucket.mesh.grpc.GrpcServiceAdvice$ErrorTranslatingStreamObserver.onNext(GrpcServiceAdvice.java:133)
          at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:262)
          at io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
          at com.atlassian.bitbucket.mesh.grpc.ThrottlingServerInterceptor$1.onMessage(ThrottlingServerInterceptor.java:77)
          at io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
          at com.atlassian.bitbucket.mesh.request.RequestServerCallListener.onMessage(RequestServerCallListener.java:29)
          at io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
          at com.atlassian.bitbucket.mesh.grpc.ExecutionContextServerCallListener.lambda$onMessage$3(ExecutionContextServerCallListener.java:36)
          at io.grpc.Context.run(Context.java:536)
          at com.atlassian.bitbucket.mesh.execution.GrpcExecutionManager$GrpcExecutionContext.run(GrpcExecutionManager.java:232)
          at com.atlassian.bitbucket.mesh.grpc.ExecutionContextServerCallListener.onMessage(ExecutionContextServerCallListener.java:36)
          at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailableInternal(ServerCallImpl.java:330)
          at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:313)
          at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:834)
          at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
          at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)
      

      Workaround

      Ensure that the user account performing in-browser modifications has an associated email address.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jmariano@atlassian.com JP Mariano
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: