java.lang.IllegalStateException: You can not update a project with an invalid validation result.

Atlassian JIRA | Brenden Bain [Atlassian] | 7 years ago
  1. 0

    Hello, When trying to create a project with a custom avatar you can get the following exception: {noformat} 2009-10-23 14:34:52,727 http-8090-Processor21 ERROR admin 52472x387x1 avxhi0 /secure/admin/AddProject.jspa [500ErrorPage.jsp] Exception caught in 500 page You can not update a project with an invalid validation result. java.lang.IllegalStateException: You can not update a project with an invalid validation result. at com.atlassian.jira.bc.project.DefaultProjectService.updateProject(DefaultProjectService.java:212) at com.atlassian.jira.web.action.project.AddProject.doExecute(AddProject.java:93) at webwork.action.ActionSupport.execute(ActionSupport.java:153) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:59) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:141) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:181) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) {noformat} This happens when a user tries to create a project they don't actually have permission to browse. For example, you can simply remove the 'jira-users' group from the default project role configuration (as I have done in the attached configuration). *Work Around*: Simply give the admin user browse permission to the project. The project actually gets created, it just that the avatar cannot be changed. I would assume that an administrator of the project would be able to change the project avatar during creation. I would also assume that the avatar could be changed after, but this also does not appear to be possible. There are some other operations that also don't seem to work unless you have browse permission.

    Atlassian JIRA | 7 years ago | Brenden Bain [Atlassian]
    java.lang.IllegalStateException: You can not update a project with an invalid validation result.
  2. 0

    Hello, When trying to create a project with a custom avatar you can get the following exception: {noformat} 2009-10-23 14:34:52,727 http-8090-Processor21 ERROR admin 52472x387x1 avxhi0 /secure/admin/AddProject.jspa [500ErrorPage.jsp] Exception caught in 500 page You can not update a project with an invalid validation result. java.lang.IllegalStateException: You can not update a project with an invalid validation result. at com.atlassian.jira.bc.project.DefaultProjectService.updateProject(DefaultProjectService.java:212) at com.atlassian.jira.web.action.project.AddProject.doExecute(AddProject.java:93) at webwork.action.ActionSupport.execute(ActionSupport.java:153) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:59) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:141) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:181) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) {noformat} This happens when a user tries to create a project they don't actually have permission to browse. For example, you can simply remove the 'jira-users' group from the default project role configuration (as I have done in the attached configuration). *Work Around*: Simply give the admin user browse permission to the project. The project actually gets created, it just that the avatar cannot be changed. I would assume that an administrator of the project would be able to change the project avatar during creation. I would also assume that the avatar could be changed after, but this also does not appear to be possible. There are some other operations that also don't seem to work unless you have browse permission.

    Atlassian JIRA | 7 years ago | Brenden Bain [Atlassian]
    java.lang.IllegalStateException: You can not update a project with an invalid validation result.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    In the {{doValidation()}} method of the {{AddProject}} action, it validates the creating of the project and the updating of the project schemes, but does not validate the updating of the project to update the avatar id. When it goes to the execute method, the following code is called: {code:java} final ProjectService.UpdateProjectValidationResult updateProjectValidationResult = projectService.validateUpdateProject(getRemoteUser(), getName(), getKey(), getDescription(), getLead(), getUrl(), getAssigneeType(), getAvatarId()); projectService.updateProject(updateProjectValidationResult); {code} But that validation result, which was not checked in the {{doValidation()}} method (obviously because its a project update, you can't validate the project update before the project has been created), is never checked. If validation failed, the {{projectService.updateProject()}} call will throw an exception. I don't know what would cause the validation to fail, what I do know is that two months ago a Studio customer had just that happen to them, according to the logs: {noformat} @400000004b97c4ad087c9d74 java.lang.IllegalStateException: You can not update a project with an invalid validation result. @400000004b97c4ad087ca15c at com.atlassian.jira.bc.project.DefaultProjectService.updateProject(DefaultProjectService.java:212) @400000004b97c4ad087ca544 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) @400000004b97c4ad087cf364 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) @400000004b97c4ad087cf74c at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) @400000004b97c4ad087cfb34 at java.lang.reflect.Method.invoke(Method.java:592) @400000004b97c4ad087cff1c at com.atlassian.jira.ProxyAdapter$ProxiedComponentInvocationHandler.invoke(ProxyAdapter.java:167) @400000004b97c4ad087d1a74 at $Proxy263.updateProject(Unknown Source) @400000004b97c4ad087d1e5c at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) @400000004b97c4ad087d2244 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) @400000004b97c4ad087d262c at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) @400000004b97c4ad087d4d3c at java.lang.reflect.Method.invoke(Method.java:592) @400000004b97c4ad087d4d3c at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129) @400000004b97c4ad087d550c at $Proxy263.updateProject(Unknown Source) @400000004b97c4ad087d58f4 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) @400000004b97c4ad087d7064 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) @400000004b97c4ad087d744c at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) @400000004b97c4ad087d7834 at java.lang.reflect.Method.invoke(Method.java:592) @400000004b97c4ad087d7c1c at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:150) @400000004b97c4ad087d938c at $Proxy263.updateProject(Unknown Source) @400000004b97c4ad087d9774 at com.atlassian.jira.web.action.project.AddProject.doExecute(AddProject.java:93) {noformat} It would appear to me that validation of the {{avatarId}} parameter is not being done when it should.

    Atlassian JIRA | 6 years ago | James Roper [Atlassian]
    java.lang.IllegalStateException: You can not update a project with an invalid validation result. @400000004b97c4ad087ca15c at com.atlassian.jira.bc.project.DefaultProjectService.updateProject(DefaultProjectService.java:212) @400000004b97c4ad087ca544 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) @400000004b97c4ad087cf364 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) @400000004b97c4ad087cf74c at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) @400000004b97c4ad087cfb34 at java.lang.reflect.Method.invoke(Method.java:592) @400000004b97c4ad087cff1c at com.atlassian.jira.ProxyAdapter$ProxiedComponentInvocationHandler.invoke(ProxyAdapter.java:167) @400000004b97c4ad087d1a74 at $Proxy263.updateProject(Unknown Source) @400000004b97c4ad087d1e5c at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) @400000004b97c4ad087d2244 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) @400000004b97c4ad087d262c at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      You can not update a project with an invalid validation result.

      at com.atlassian.jira.bc.project.DefaultProjectService.updateProject()
    2. com.atlassian.jira
      AddProject.doExecute
      1. com.atlassian.jira.bc.project.DefaultProjectService.updateProject(DefaultProjectService.java:212)
      2. com.atlassian.jira.web.action.project.AddProject.doExecute(AddProject.java:93)
      2 frames
    3. webwork.action
      ActionSupport.execute
      1. webwork.action.ActionSupport.execute(ActionSupport.java:153)
      1 frame
    4. com.atlassian.jira
      JiraActionSupport.execute
      1. com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:59)
      1 frame
    5. webwork.dispatcher
      GenericDispatcher.executeAction
      1. webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:141)
      1 frame
    6. com.atlassian.jira
      JiraServletDispatcher.service
      1. com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:181)
      1 frame
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      1 frame
    8. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      2 frames
    9. com.atlassian.core
      HeaderSanitisingFilter.doFilter
      1. com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
      1 frame
    10. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      2 frames