JSS 2.5.2 and JIRA 7.1.9 - Plugin not woking

hello,

after i updated JIRA and JSS to following script in a transition cannot be executed.

from com.atlassian.jira import ComponentManager
from com.atlassian.jira.security.roles import ProjectRoleManager
result = True
project = issue.getProjectObject()
projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager)
authenticationContext = ComponentManager.getInstance().getJiraAuthenticationContext()
userIsInRoleCustomers = projectRoleManager.isUserInProjectRole(authenticationContext.getUser(), projectRoleManager.getProjectRole("Customers"), project)
userIsInRoleDevelopers = projectRoleManager.isUserInProjectRole(authenticationContext.getUser(), projectRoleManager.getProjectRole("Developers"), project)
issueTypeIsNotSR = issue.getIssueTypeObject().getName() != "Service Request"                
if userIsInRoleCustomers:
	if not userIsInRoleDevelopers:
		if issueTypeIsNotSR:
			result = False
description = "You do not have enough permissions to create this Issue Type! Please select - Service Request -"

JSS Settings:

Global Edit Validation & Postfunction scripts enabled (QuickEdit): No

Global Edit Validation & Postfunction scripts enabled (IssueNav): No

Jython Installed: Yes

Jython Version: 2.5.2

Jython Home Path: /data/jira/home/jss/jython_2.5.2

python.home System Property: /data/jira/home/jss/jython_2.5.2

Base Scripts Installed: Yes

Base Scripts Path: /data/jira/home/jss/jython

 

Error:

2016-08-01 14:47:57,489 http-nio-9001-exec-18 ERROR ad 887x2154x1 1m98szw 172.16.177.197,10.0.0.63 /secure/QuickCreateIssue.jspa [c.q.j.plugin.workflow.JythonValidator] Unrecognized exception while executing Jyphon script: null
Traceback (most recent call last):
File "/data/jira/home/jss/jython/__init_interpreter__.py", line 6, in <module>
codecs.setDefaultEncoding('utf-8')
LookupError: no codec search functions registered: can't find encoding 'utf-8'

at org.python.core.codecs.lookup(codecs.java:82)
at org.python.core.codecs.setDefaultEncoding(codecs.java:40)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
at org.python.core.PyObject.__call__(PyObject.java:387)
at org.python.core.PyObject.__call__(PyObject.java:391)
at org.python.pycode._pyx2.f$0(/data/jira/home/jss/jython/__init_interpreter__.py:16)
at org.python.pycode._pyx2.call_function(/data/jira/home/jss/jython/__init_interpreter__.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1261)
at org.python.core.__builtin__.execfile_flags(__builtin__.java:522)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225)
at com.quisapps.jira.jss.jython.JythonUtil.getNewInterpreter(JythonUtil.java:70)
at com.quisapps.jira.jss.jython.JythonUtil.getInterpreter(JythonUtil.java:43)
at com.quisapps.jira.plugin.workflow.JythonValidator.validate(JythonValidator.java:29)
at com.atlassian.jira.workflow.SkippableValidator.validate(SkippableValidator.java:45)
at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:1512)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1203)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:615)
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:741)
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:580)
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:494)
at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:230)
at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:199)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
at com.sun.proxy.$Proxy147.create(Unknown Source)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
at com.sun.proxy.$Proxy147.create(Unknown Source)
at com.atlassian.jira.quickedit.action.QuickCreateIssue.doExecute(QuickCreateIssue.java:308)
... 1 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
... 7 filtered
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
... 50 filtered
at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:59)
... 62 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
... 89 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2016-08-01 14:47:57,493 http-nio-9001-exec-18 ERROR ad 887x2154x1 1m98szw 172.16.177.197,10.0.0.63 /secure/QuickCreateIssue.jspa [c.a.j.bc.issue.DefaultIssueService] Error creating issue:
com.atlassian.jira.exception.CreateException: root cause: Traceback (most recent call last):
File "/data/jira/home/jss/jython/__init_interpreter__.py", line 6, in <module>
codecs.setDefaultEncoding('utf-8')
LookupError: no codec search functions registered: can't find encoding 'utf-8'

at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:588)
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:494)
at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:230)
at com.atlassian.jira.bc.issue.DefaultIssueService.create(DefaultIssueService.java:199)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
at com.sun.proxy.$Proxy147.create(Unknown Source)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
at com.sun.proxy.$Proxy147.create(Unknown Source)
at com.atlassian.jira.quickedit.action.QuickCreateIssue.doExecute(QuickCreateIssue.java:308)
... 1 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
... 7 filtered
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
... 50 filtered
at com.atlassian.greenhopper.jira.filters.ClassicBoardRouter.doFilter(ClassicBoardRouter.java:59)
... 62 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
... 89 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.atlassian.jira.workflow.WorkflowException: root cause: Traceback (most recent call last):
File "/data/jira/home/jss/jython/__init_interpreter__.py", line 6, in <module>
codecs.setDefaultEncoding('utf-8')
LookupError: no codec search functions registered: can't find encoding 'utf-8'

at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:760)
... 233 more
Caused by: com.opensymphony.workflow.WorkflowException: root cause: Traceback (most recent call last):
File "/data/jira/home/jss/jython/__init_interpreter__.py", line 6, in <module>
codecs.setDefaultEncoding('utf-8')
LookupError: no codec search functions registered: can't find encoding 'utf-8'

at com.quisapps.jira.plugin.workflow.JythonValidator.validate(JythonValidator.java:89)
at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:1512)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1203)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:615)
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:741)
... 234 more
Caused by: Traceback (most recent call last):
File "/data/jira/home/jss/jython/__init_interpreter__.py", line 6, in <module>
codecs.setDefaultEncoding('utf-8')
LookupError: no codec search functions registered: can't find encoding 'utf-8'

at org.python.core.codecs.lookup(codecs.java:82)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
at org.python.core.PyObject.__call__(PyObject.java:387)
at org.python.core.PyObject.__call__(PyObject.java:391)
at org.python.pycode._pyx2.f$0(/data/jira/home/jss/jython/__init_interpreter__.py:16)
at org.python.pycode._pyx2.call_function(/data/jira/home/jss/jython/__init_interpreter__.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1261)
at org.python.core.__builtin__.execfile_flags(__builtin__.java:522)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225)
at com.quisapps.jira.jss.jython.JythonUtil.getNewInterpreter(JythonUtil.java:70)
at com.quisapps.jira.jss.jython.JythonUtil.getInterpreter(JythonUtil.java:43)
at com.quisapps.jira.plugin.workflow.JythonValidator.validate(JythonValidator.java:29)
... 239 more

 

1 answer

In your stacktrace it  points to a codec api call that sets UTF-8 in your script. There may have been a change in how that is done in the new version.

LookupError: no codec search functions registered: can't find encoding 'utf-8'  is telling here. Check if a new dependency is necessary here.

 

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

241 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot