In the article, Managing the Direct Marketing Agent, we discussed common issues that you might encounter with the Direct Marketing agent and explored some helpful log messages that occur in the onprem_direct log file. However, what happens when the methods mentioned in that article fail to resolve the issue? You might encounter more advanced and complex issues when using the Direct Marketing agent that require advanced troubleshooting techniques.
In this follow-up article, we explore next-level troubleshooting techniques that can help you identify and resolve complex Direct Marketing agent problems. From checking your on-premises environment to analyzing system logs, we provide insights into methods that will help you identify the possible root cause of these issues and explain how to get your Direct Marketing agent to run smoothly.
Java Errors
When the platform receives updates to the Java environment, but the Java locations are not updated, the Direct Marketing agent might be unable to run.
A daemon (also known as background processes) is a Linux program that runs continuously in the background until you stop it.
Use the following commands to start the Direct Marketing agent:
To start the Direct Marketing agent as a service: systemctl or upstart
or
Run the run.sh command
JAVA_HOME is typically set in the direct-agent-service.env file. You can issue a cat command to see the contents of the file. This command enables you to see whether that location is still good, as shown in the following example:
cd /opt/sas/onprem/systemd
Note: Your onprem directory might be different.
cat direct-agent-service.env
After issuing the command, the following is displayed:
#set JAVA_HOME to root of the Java 1.8 installation on this machine
JAVA_HOME=/opt/sas/SASHome/SASPrivateJavaRuntimeEnvironment/9.4/jre
Verify that the Java location is still valid and modify the path if it has changed.
You might see the following errors after operating system patching, software upgrades or when software changes are made, especially to Java, when trying to start the OnPrem Agent (for example using the ./run.sh command):
Unable to start SAS_CI_360_OnpremAgent agent from xxxxxx server.
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64
For more information, see the Direct Access Points documentation.
For example: you might see "ERROR_TENANT_MISSING". With this hint you could go and check the cionprem.properties file to verify the tenant information.
The .bashrc file is a script file that executes when a user logs in.
env
java -version
cd /usr/lib/jvm
ls -latr
Note: We do not recommend that you put JAVA_HOME in the run.sh file. The JAVA_HOME setting can get removed when you upgrade the agent because it is not carried over into the new run.sh file.
The Direct Marketing agent might be affected when you make system changes or issues. For example: If patching performed on the system and the SAS services were not stopped before-hand, you might see one of the following in the onprem-direct.log:
ERROR [localhost-startStop-1] SID[] USER[] CC[] [] pringframework.web.context.ContextLoader - Context initialization failed
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environmentProperties'
Caused by: com.atomikos.jdbc.AtomikosSQLException: Failed to grow the connection pool
Caused by: com.atomikos.datasource.pool.CreateConnectionException: Could not create JDBC connection
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Caused by: java.net.ConnectException: Connection refused (Connection refused)
WARN [localhost-startStop-1] SID[] USER[] CC[] [] rt.AnnotationConfigWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environment' defined in ServletContext resource [/WEB-INF/spring-config/webapp-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public java.lang.String com.sas.analytics.crm.spring.client.SASEnvironmentFactory.getServiceRegistry() throws com.sas.analytics.crm.error.client.UserException] threw exception; nested exception is com.sas.analytics.crm.error.client.UserException: Bad Configuration
At this point you would want to check the SAS services and if necessary, restart all of the SAS Services:
For more information, see the Direct Access Points documentation.
If there are issues with the SAS® 9.4 environment (such as with the SAS Pooled Workspace Server and the SAS Object Spawner), you might encounter ConnectionResources errors in the Direct Marketing agent log.
In this scenario, the following error occurs when you restart the Direct Marketing agent:
INFO [pool-18-thread-3] SID[] USER[sasci360] CC[] [] ics.crm.custdata.datapattern.MAIQService - Retrieved logical server: SASApp_CI360 - Logical Pooled Workspace Server
ERROR [pool-18-thread-3] SID[] USER[] CC[] [] sas.iquery.execution.ConnectionResources - ConnectionResources unthreaded getConnection() failed.
Check the onprem_direct.log file to see whether it is trying to make a connection to the SAS Pooled Workspace Server - SASApp_CI360, as shown in the following example:
INFO [pool-18-thread-3] SID[] USER[sasci360] CC[] [] ics.crm.custdata.datapattern.MAIQService - Retrieved logical server: SASApp_CI360 - Logical Pooled Workspace Server
ERROR [pool-18-thread-3] SID[] USER[] CC[] [] sas.iquery.execution.ConnectionResources - ConnectionResources unthreaded getConnection() failed.
com.sas.services.connection.FatalConnectionFactoryException: Unable to create class instance.
at com.sas.services.connection.ClusterEnvelope.getConnection(ClusterEnvelope.java:240)
at com.sas.services.connection.AggregationKernel.doGetConnection(AggregationKernel.java:242)
at com.sas.services.connection.ConnectionFactoryKernel.getConnection(ConnectionFactoryKernel.java:325)
at com.sas.services.connection.ConnectionFactoryShell.getConnection(ConnectionFactoryShell.java:75)
at com.sas.services.connection.platform.PlatformConnectionFactory.getConnectionMetadata(PlatformConnectionFactory.java:533)
To circumvent this issue, complete the following steps:
In SAS® Customer Intelligence 360, the Tenant Access is a new feature in release 23.02. However, if you use the feature incorrectly, issues with the Direct Marketing agent can occur
When these issues occur, the Direct Marketing agent is unable to connect after making changes to the Tenant Access, as shown in the following image:
You might encounter the following errors in the onprem_direct.log:
WARN [WebSocketClient@xxxxxxxx] SID[] USER[] CC[] [] as.analytics.crm.agent.impl.CI360MAAgent - streamClosed - errorCode: GATEWAY_CONNECTION_FAILED, message: 1007: CIException:MKTCMN74284:[MKTCMN74284] ERROR_INVALID_SOURCE_IP_ADDRESS
ERROR [AgentRestart-xxxxxx] SID[] USER[] CC[] [] as.analytics.crm.agent.impl.CI360MAAgent - processAgentConfig - Cannot retrieve direct marketing configuration. exception message:org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
To resolve this issue, check and correct the IP Addresses that you recently added to the Tenant Access interface
For more information, see the Add Tenant Access documentation.
If SAS 9.4 is not working correctly, you can encounter failed to decrypt error messages.
When you run the run.sh command in the Direct Marketing agent, you might encounter the following errors:
[sas@sas94mtier CI360DirectAgent]$ ./run.sh
0 [main] ERROR com.sas.vfabrictcsvr.decoder.EncryptDecrypt - Failed to decrypt the data
2 [main] ERROR com.sas.vfabrictcsvr.decoder.PropertyDecoder - The value could not be decrypted
WARN [rtStop-1] SID[ ] USER[] CC[] [] ebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cachedConfigurer' defined in ServletContext resource [/WEB-INF/spring-config/infrastructure-config.xml]: Cannot resolve reference to bean 'environmentProperties' while setting bean property 'properties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environmentProperties': FactoryBean threw exception on object creation; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.atomikos.jdbc.AtomikosSQLException: Failed to grow the connection pool
To circumvent this issue, first make sure that you can log on to any of the SAS 9.4 middle-tier applications. (For example, http://midtier:port:SASStudio.)
If you are not able to log on, then you need to investigate why the middle-tier is not working. SAS Note 55426, “Locating the log files for the SAS 9.4 middle tier”, provides the location of the SAS 9.4 middle-tier logs to help with your troubleshooting. Once you resolve the middle-tier issue, starting the Direct Marketing agent again.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.