The encryption key for <APPIAN_USER> was not populated during login" error thrown when executing a process that requires access to the Secure Credentials Store

Certified Lead Developer

@

Getting an error while trying to use third party credentials, even the KB - 1216 mentioned below is not helping:

com.appiancorp.suiteapi.common.exceptions.AppianException: An error occurred while accessing the per-user credentials from the Secure Credentials Store. 
The encryption key for <USER NAME> was not populated during login. See the documentation for proper configuration when using a custom authentication provider. (APNX-1-4221-001)

https://community.appian.com/support/w/kb/431/kb-1216-the-encryption-key-for-appian_5f00_user-was-not-populated-during-login-error-thrown-when-executing-a-process-that-requires-access-to-the-secure-credentials-store

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    More detailed logs are as follows:

    00:15:57,826 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException.<init>(AppianRuntimeException.java:45)

    00:15:57,826 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException.<init>(AppianRuntimeException.java:33)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.CryptographerProviderUserImpl.getUserScsSessionKey(CryptographerProviderUserImpl.java:38)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.CryptographerProviderUserImpl.getUserKey(CryptographerProviderUserImpl.java:45)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.CryptographerProviderUserImpl.get(CryptographerProviderUserImpl.java:31)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.service.impl.ExternalSystemServiceImpl.retrieveUserSecuredValueByAttributeId(ExternalSystemServiceImpl.java:389)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.GeneratedMethodAccessor35650.invoke(Unknown Source)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at java.lang.reflect.Method.invoke(Method.java:498)

    00:15:57,827 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

    00:15:57,828 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.sun.proxy.$Proxy144.retrieveUserSecuredValueByAttributeId(Unknown Source)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.service.impl.SecureCredentialsStoreImpl.getUserSecuredValues(SecureCredentialsStoreImpl.java:50)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.GeneratedMethodAccessor36131.invoke(Unknown Source)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at java.lang.reflect.Method.invoke(Method.java:498)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.util.MethodInvocationReflectionImpl.proceed(MethodInvocationReflectionImpl.java:23)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.external.PluginAuthorizationMethodInterceptor.invoke(PluginAuthorizationMethodInterceptor.java:36)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.runtime.framework.DynamicProxyInvokationHandler.invoke(DynamicProxyInvokationHandler.java:24)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.sun.proxy.$Proxy610.getUserSecuredValues(Unknown Source)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appian.social.helper.AppianTokenFinder.getToken(AppianTokenFinder.java:24)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appian.social.twitter.TwitterAppAuthenticator.initiate(TwitterAppAuthenticator.java:84)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appian.social.twitter.TwitterAppAuthenticator.getTwitterAppAuthenticationUrl(TwitterAppAuthenticator.java:36)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    00:15:57,829 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at java.lang.reflect.Method.invoke(Method.java:498)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction$1.call(CustomFunction.java:809)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction.evaluate(CustomFunction.java:803)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction.evalDynamic0(CustomFunction.java:242)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction.lambda$evalDynamic$0(CustomFunction.java:234)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.plugins.PluginUsageLogger.callWithPluginInformation(PluginUsageLogger.java:39)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction.evalDynamic(CustomFunction.java:233)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.CustomFunction.eval0(CustomFunction.java:202)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.DefaultEvaluable.eval(DefaultEvaluable.java:179)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.expression.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:306)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.eval(FunctionCallDelegate.java:305)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.FunctionCallDelegate.evalCacheableFunctionCall(FunctionCallDelegate.java:126)

    00:15:57,830 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.FunctionCallDelegate.evalFunctionCall(FunctionCallDelegate.java:92)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.AppianScriptContextTop.evalExternalFunction(AppianScriptContextTop.java:387)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.tree.FunctionCall$ExternalEvaluable.eval0(FunctionCall.java:621)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.DefaultEvaluable.eval(DefaultEvaluable.java:179)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.FunctionCallDelegate$InternalFunctionCallWithContext.eval(FunctionCallDelegate.java:262)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.FunctionCallDelegate.evalFunctionCall(FunctionCallDelegate.java:94)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.AppianScriptContextTop.evalInternalFunction(AppianScriptContextTop.java:371)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.tree.FunctionCall.evalImmediate(FunctionCall.java:429)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.tree.FunctionCall.evalEvaluable(FunctionCall.java:395)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.tree.FunctionCall.evalWrapped(FunctionCall.java:469)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Tree.eval(Tree.java:286)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Tree.eval0(Tree.java:279)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Tree.eval(Tree.java:258)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Parse.evalInner(Parse.java:302)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Parse.eval(Parse.java:260)

    00:15:57,831 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.Parse.eval(Parse.java:245)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.core.expr.AppianScriptEngine.eval(AppianScriptEngine.java:70)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:260)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:312)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ExpressionGroupRequest.execute0(ExpressionGroupRequest.java:71)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:84)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ExpressionGroupRequest.process(ExpressionGroupRequest.java:59)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ProcessEngineServiceImpl.processUnattendedRequest(ProcessEngineServiceImpl.java:158)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.engine.ProcessEngineServiceImpl.processToNextAttended(ProcessEngineServiceImpl.java:207)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.GeneratedMethodAccessor4668.invoke(Unknown Source)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at java.lang.reflect.Method.invoke(Method.java:498)

    00:15:57,832 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.util.MethodInvocationReflectionImpl.proceed(MethodInvocationReflectionImpl.java:23)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.security.authz.AuthorizationMethodInterceptor.invoke(AuthorizationMethodInterceptor.java:54)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.services.ServiceManager$ServiceInvocationHandler.invoke(ServiceManager.java:635)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.sun.proxy.$Proxy266.processToNextAttended(Unknown Source)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.design.service.ProcessDesignServiceXmlImpl.initiateProcess(ProcessDesignServiceXmlImpl.java:1014)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.process.design.service.ProcessDesignServiceXmlImpl.startProcessVersion(ProcessDesignServiceXmlImpl.java:981)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at java.lang.reflect.Method.invoke(Method.java:498)

    00:15:57,833 ERROR [stderr] (ajp-/0.0.0.0:8009-13) at com.appiancorp.kougar.services.KougarServiceInvocationHandler$JavaInvocationHandler.invoke(KougarServiceInvoca

  • 0
    Certified Lead Developer
    in reply to Ketan Patel
    Checked the third party credentials - everything is set up correctly. The smart service is enabled for the third party credentials and activity chaining is also present between the nodes in process model where smart service is called.
  • 0
    Certified Lead Developer
    in reply to Ketan Patel
    Hello Community Members - Any pointers on how to resolve this issue. Appreciate your help.
  • 0
    Certified Lead Developer
    in reply to Ketan Patel
    Hi @ketanpatel did you add this smart Service under plugins section of Third party credentials which you are passing as an input to this smart Service to access the details?

    If no, the you have to do this, and what about usePerUser, did you set it to false.


    If all good, then I suspect, there might be something wrong in java code, which is responsible to fetch the details from Third party credentials.

    Can you try inspecting above mentioned points, it might help you
  • 0
    Certified Lead Developer
    in reply to Ketan Patel
    If a plugin is not OOTB, it must be registered against a third party credential in order to access it's details
  • 0
    Certified Lead Developer
    in reply to aloks0189
    @aloks176 Its registered in third party credential.
  • 0
    Certified Lead Developer
    in reply to Ketan Patel
    Can you attach the java code snippet which you have written to access the third party credential as part of your plugin development.

    I believe there might be something missing in that.
  • 0
    Certified Lead Developer
    in reply to aloks0189
    Its not my custom code - I am using Shared component "Social Content Crawler". I checked the Java code - it is using it correctly. The issue is it is not passed. My configuration in Third Party Credential is good too. The issue is its not being passed to the plugin and hence it is failing.
  • Hi Ketan,

    Did you take a look at the documentation attached to the shared component? It looks like it requires some fields set to "NA" for it to properly work. Can you ascertain these fields are set up as required?

    Thanks,
    Jussi
  • 0
    Certified Lead Developer
    in reply to Jussi Lundstedt

    Yes the fields are set correctly - I have verified everything. Please note I have tried both per user and system wide - but none of them is working. I have also enabled activity chaining. 

    See below the screenshots: