When I try to access Custom Fields, I get an Internal server error (attached screenshot), and custom fields are not displayed.
This started after trying to add a new custom field.
Trying to figure this out for more than a week but with no luck so far.
Tried the resolution suggested on https://community.atlassian.com/t5/Jira-questions/Internal-server-error-when-open-Custom-Fields/qaq-p/936744 but the query failed.
Any ideas would be appreciated.
Issue resolved!
Duplicate fields were found and deleted directly from the database.
Xray View Test Execution Screen
Xray View Test Execution Screen This is the view operation screen for Test Execution issue type General NULL 0 customfield_11926 Xray View Test Execution Screen This is the view operation screen for Test Execution issue type General NULL 0 customfield_11926
Xray Default Test Execution Screen
Xray Default Test Execution Screen This is the default screen for the create/edit operations on Test Execution issues Test Execution Details NULL 1 customfield_11926 Xray Default Test Execution Screen This is the default screen for the create/edit operations on Test Execution issues Test Execution Details NULL 1 customfield_11926
My assumption is that something added the same field to the screen which is messing it up as there should never be duplicate fields in the same screen. From here we'll want to remove one. I'm opting that we remove the second entry as that looks to be the newer addition. From here you'll need to remove that entry. Instructions below as reference.
select * from fieldscreenlayoutitem where id = 13361; select * from fieldscreenlayoutitem where id = 13360;
delete from fieldscreenlayoutitem where id = 13361; delete from fieldscreenlayoutitem where id = 13360;
select * from fieldscreen fs JOIN fieldscreentab fst ON fst.fieldscreen = fs.id JOIN fieldscreenlayoutitem fsl ON fsl.fieldscreentab = fst.id WHERE fs.name = 'Xray Default Test Execution Screen' select * from fieldscreen fs JOIN fieldscreentab fst ON fst.fieldscreen = fs.id JOIN fieldscreenlayoutitem fsl ON fsl.fieldscreentab = fst.id WHERE fs.name = 'Xray View Test Execution Screen';
This should help to return the Screen and Custom Field config back to normal operation.
Additionally, I want to note we have a Suggestion to remove the ability for Java API to creation this condition at JRASERVER-64998: Prevent the same custom field from being added to multiple screen tabs in JIRA's Java API.
Sagi,
We'll need to know exactly what error is causing the problem on your instance, but I don't see that you included any logs.
Could you have a look at your Jira server logs and tell us what errors occur when you visit the Custom Fields page?
I'd also like to know what version of Jira you are using. Thank you!
Regards,
Shannon
Hi Shannon, thank you for your reply.
I'm using Jira 7.13.0.
Here is the relevant log from the attlasian-jira.log:
2019-02-22 15:08:42,600 https-jsse-nio-443-exec-7 WARN sagi 908x904x3 uc8v73 192.168.4.5 /plugins/servlet/streams [c.a.streams.internal.StreamsCompletionService] Registering failure for stream provider Confluence due to error other2019-02-22 15:09:13,528 https-jsse-nio-443-exec-1 ERROR sagi 909x942x2 445r6h 192.168.4.5 /rest/api/2/customFields [c.a.j.rest.exception.ExceptionInterceptor] Returning internal server error in responsejava.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:192)... 4 filteredat com.atlassian.jira.rest.exception.ExceptionInterceptor.intercept(ExceptionInterceptor.java:55)... 1 filteredat com.atlassian.jira.rest.v2.issue.scope.RequestScopeInterceptor.intercept(RequestScopeInterceptor.java:39)... 14 filteredat com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)... 1 filteredat com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)... 32 filteredat com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:56)... 13 filteredat com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)... 53 filteredat com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)... 1 filteredat com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)... 16 filteredat com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)... 19 filteredat com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)... 5 filteredat com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:181)at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:137)at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:90)at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:174)at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:130)at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:121)... 4 filteredat com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)... 8 filteredat com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)... 4 filteredat com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)... 26 filteredat com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)... 24 filteredat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Unknown Source)Caused by: java.lang.IllegalStateException: Duplicate key com.atlassian.jira.issue.fields.screen.FieldScreenLayoutItemImpl@cc51c983at java.util.stream.Collectors.lambda$throwingMerger$0(Unknown Source)at java.util.HashMap.merge(Unknown Source)at java.util.stream.Collectors.lambda$toMap$58(Unknown Source)at java.util.stream.ReduceOps$3ReducingSink.accept(Unknown Source)at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)at java.util.stream.AbstractPipeline.evaluate(Unknown Source)at java.util.stream.ReferencePipeline.collect(Unknown Source)at com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl$LayoutItems.<init>(FieldScreenTabImpl.java:217)at com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl$LayoutItems.<init>(FieldScreenTabImpl.java:208)at com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl.getLayoutItems(FieldScreenTabImpl.java:34)at com.atlassian.jira.issue.fields.screen.FieldScreenTabImpl.getFieldScreenLayoutItem(FieldScreenTabImpl.java:172)at com.atlassian.jira.issue.fields.screen.DefaultFieldScreenManager.getFieldScreenTabs(DefaultFieldScreenManager.java:43)... 3 filteredat java.lang.reflect.Method.invoke(Unknown Source)at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)at com.sun.proxy.$Proxy145.getFieldScreenTabs(Unknown Source)... 3 filteredat java.lang.reflect.Method.invoke(Unknown Source)at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)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.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)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.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)at com.sun.proxy.$Proxy2797.getFieldScreenTabs(Unknown Source)at com.atlassian.jira.rest.v2.issue.customfield.CustomFieldBeanFactory.from(CustomFieldBeanFactory.java:46)at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)at java.util.Iterator.forEachRemaining(Unknown Source)at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)at java.util.stream.AbstractPipeline.copyInto(Unknown Source)at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)at java.util.stream.AbstractPipeline.evaluate(Unknown Source)at java.util.stream.ReferencePipeline.collect(Unknown Source)at com.atlassian.jira.rest.api.pagination.PageBean$Builder.build(PageBean.java:92)at com.atlassian.jira.rest.v2.issue.customfield.CustomFieldResource.getCustomFields(CustomFieldResource.java:90)... 255 more
Thank you!
In that case, the correct article is indeed CreateIssueMeta returns Duplicate Key error.
Can you show me the query that you ran and the results?
I would also recommend running the Database Integrity Checker and completing any fixes the page recommends.
This is the query I ran:
select f.name, i.fieldidentifier, count(*)from fieldscreen f, fieldscreenlayoutitem i, fieldscreentab twhere f.id = t.fieldscreenand i.fieldscreentab = t.idgroup by f.name, i.fieldidentifier having count(*) > 1;
And the result:
Msg 208, Level 16, State 1, Line 1Invalid object name 'fieldscreen'.
Also, ran the Integrity Checker, no errors were found.
That's great, Sagi! I was following along on the thread.
Happy to hear that you were able to resolve it in the end.
Take care, and have a pleasant rest of your week.
It looks like you're new here. Sign in or register to get started.