JanssenProject / jans

An open source enterprise digital identity platform for CIAM or workforce... Janssen is a distribution of standards-based, developer friendly, components that are engineered to work together in any cloud. #OAuth #OpenID #FIDO
https://docs.jans.io
Apache License 2.0
479 stars 75 forks source link

fix(jans-auth-server): duo script getting error when enabled #4710

Open manojs1978 opened 1 year ago

manojs1978 commented 1 year ago

Describe the bug duo script getting error when enabled

To Reproduce Steps to reproduce the behavior: install jans launch tui login to admin enable duo script See error

2023-04-25 05:45:33,148 ERROR [Jans AuthScheduler_Worker-5]  [io.jans.service.PythonService] (PythonService.java:187) - Failed to load python fileSyntaxError: mismatched input '' expecting DEDENT (duo.py, line 105)
org.python.core.PySyntaxError: SyntaxError: mismatched input '' expecting DEDENT (duo.py, line 105)
        at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95) ~[jython-standalone-2.7.3.jar:2.7.3b1-SNAPSHOT]
        at org.python.core.ParserFacade.parse(ParserFacade.java:190) ~[jython-standalone-2.7.3.jar:2.7.3b1-SNAPSHOT]
        at org.python.core.Py.compile_flags(Py.java:2249) ~[jython-standalone-2.7.3.jar:2.7.3b1-SNAPSHOT]
        at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:297) ~[jython-standalone-2.7.3.jar:2.7.3b1-SNAPSHOT]
        at io.jans.service.PythonService.loadPythonScript(PythonService.java:185) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.PythonService$Proxy$_$$_WeldClientProxy.loadPythonScript(Unknown Source) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.ExternalTypeCreator.createExternalTypeFromStringWithPythonException(ExternalTypeCreator.java:141) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.ExternalTypeCreator.createExternalType(ExternalTypeCreator.java:77) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.ExternalTypeCreator$Proxy$_$$_WeldClientProxy.createExternalType(Unknown Source) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.CustomScriptManager.reloadCustomScriptConfigurations(CustomScriptManager.java:276) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.CustomScriptManager.reloadImpl(CustomScriptManager.java:173) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.CustomScriptManager.reload(CustomScriptManager.java:143) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.CustomScriptManager.reloadTimerEvent(CustomScriptManager.java:118) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at io.jans.service.custom.script.CustomScriptManager$Proxy$_$$_WeldSubclass.reloadTimerEvent(Unknown Source) ~[jans-core-script-1.0.13-SNAPSHOT.jar:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
        at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
        at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:168) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308) ~[weld-core-impl-4.0.3.Final.jar:4.0.3.Final]
"jans-auth_script.log" 271L, 23273B                                                                                          19,1-8 

Expected behavior should able to enable duo script without any error.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here. jans-auth.log jans-auth_persistence.log jans-auth_persistence_ldap_statistics.log

manojs1978 commented 9 months ago

still i can see below error in log, please find attached log

2024-02-28 06:12:19,370 ERROR [Thread-10] [io.jans.service.PythonService] (PythonService.java:186) - Failed to load python fileSyntaxError: mismatched input '' expecting DEDENT (duo.py, line 105) org.python.core.PySyntaxError: SyntaxError: mismatched input '' expecting DEDENT (duo.py, line 105) at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95) ~[jython-standalone-2.7.3.jar:2.7.4a1-SNAPSHOT] at org.python.core.ParserFacade.parse(ParserFacade.java:190) ~[jython-standalone-2.7.3.jar:2.7.4a1-SNAPSHOT] at org.python.core.Py.compileflags(Py.java:2249) ~[jython-standalone-2.7.3.jar:2.7.4a1-SNAPSHOT] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:297) ~[jython-standalone-2.7.3.jar:2.7.4a1-SNAPSHOT] at io.jans.service.PythonService.loadPythonScript(PythonService.java:184) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.PythonService$Proxy$$$WeldClientProxy.loadPythonScript(Unknown Source) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.ExternalTypeCreator.createExternalTypeFromStringWithPythonException(ExternalTypeCreator.java:127) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.ExternalTypeCreator.createExternalType(ExternalTypeCreator.java:54) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.ExternalTypeCreator$Proxy$$$_WeldClientProxy.createExternalType(Unknown Source) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.CustomScriptManager.reloadCustomScriptConfigurations(CustomScriptManager.java:276) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.CustomScriptManager.reloadImpl(CustomScriptManager.java:173) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?] at io.jans.service.custom.script.CustomScriptManager.reload(CustomScriptManager.java:143) ~[jans-core-script-1.1.0-SNAPSHOT.jar:?]

log.zip

manojs1978 commented 9 months ago

@jgomer2001 could you please check logs , it is still reproduced for me

jgomer2001 commented 9 months ago

I'm not the author of the script