Issue
The Contrast agent does not start up in your Java application and you see an ERROR in the contrast.log file containing a stack trace indicating Got error talking
to TeamServer fetching instructions.
Cause
If the configured API key, Service key, or other connection parameter is wrong you might see this error in the debug logs for the Java Agent for example.
com.contrastsecurity.agent.features.BadInstructionException: Got error talking to TeamServer fetching instructions (response code = 412)
at com.contrastsecurity.agent.features.PhoneHomeResolver.parseFeatureSetResponse(PhoneHomeResolver.java:74
at com.contrastsecurity.agent.features.PhoneHomeResolver.findFeatures(PhoneHomeResolver.java:42)
at com.contrastsecurity.agent.features.FeatureManager.updateFeatures(FeatureManager.java:222)
at com.contrastsecurity.agent.startup.ChooseFeaturesTask.onStartupBegin(ChooseFeaturesTask.java:26)
at com.contrastsecurity.agent.ContrastEngine.start(ContrastEngine.java:265)
at com.contrastsecurity.agent.ContrastAgent.startup(ContrastAgent.java:275)
at com.contrastsecurity.agent.ContrastAgent.setup(ContrastAgent.java:225)
at com.contrastsecurity.agent.ContrastLoaderAgent.premain(ContrastLoaderAgent.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401
Resolution
Double check that you're using the correct credentials. In the Contrast UI you can use the "Add Agent" process to download a yaml configuration file. That will have the correct API info and formatting needed for the Java Agent to talk to the Contrast server.
The steps for this are documented here:
Java Agent Installation > Contrast UI