# APM Agent Status states "No data has been received from agents yet"

**URL:** <https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295>\
**Category:** APM\
**Created:** [March 25, 2021, 6:45am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295 "2021-03-25T06:45:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [March 25, 2021, 6:45am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/1 "2021-03-25T06:45:45Z")

</div>

Hi,  
I have deployed and configured APM which on clicking APM server status states as "You have correctly setup APM Server"

I am successfully running a Petclinic application using the below script:  
sudo java   
-javaagent:elastic-apm-agent.jar   
-Delastic.apm.service\_name=petclinic-java   
-Delastic.apm.secret\_token=   
-Delastic.apm.application\_packages=co.elastic.apm   
-Delastic.apm.server\_urls=https://:8200   
-jar ./target/spring-petclinic-2.4.2.jar

However, it errors out with following connection refused:  
2021-03-25 17:22:49.862 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
2021-03-25 17:23:26.633 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type SPAN with this error: Connection refused (Connection refused)  
2021-03-25 17:23:26.634 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
2021-03-25 17:23:59.075 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type SPAN with this error: Connection refused (Connection refused)  
2021-03-25 17:23:59.075 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
2021-03-25 17:24:33.093 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type SPAN with this error: Connection refused (Connection refused)  
2021-03-25 17:24:33.094 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)  
2021-03-25 17:25:03.908 [apm-remote-config-poller] ERROR co.elastic.apm.agent.report.HttpUtils - Exception when closing input stream of HttpURLConnection.  
2021-03-25 17:25:03.909 [apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Connection refused (Connection refused)  
2021-03-25 17:25:10.838 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type SPAN with this error: Connection refused (Connection refused)

My apm-server.yml file (v 7.10.1) on RHEL7.0 has no changes except updates to the section, output.elasticsearch: in the file.

What do I need to setup or verify to find what may causing the error.  
Is it required that the secret\_token be provided in the config file and in the java script above,?

Please help

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [March 26, 2021, 8:06am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/2 "2021-03-26T08:06:22Z")

</div>

Hi @Stud21 ,

it seems that the both properties have invalid values, make sure that `server_urls` and `secret_token` are properly set.

`server_urls` should be a valid URL, here it seems that the host/ip part is missing.

> [@Stud21](#):
>
> -Delastic.apm.secret\_token=  
> -Delastic.apm.server\_urls=https://:8200

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [March 28, 2021, 5:29am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/3 "2021-03-28T05:29:59Z")

</div>

I have entered entered the domain name in the apm.server.url as under:  
-Delastic.apm.server\_urls=https://stud21.com.au:8200 \

However, I am not sure how and what to entered as secret token.

Please advise

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [March 28, 2021, 10:58pm UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/4 "2021-03-28T22:58:47Z")

</div>

I have tried to enter in apm-server.yml as under:

# Configure authorization via a common `secret_token`. By default it is disabled.

# Agents include the token in the following format: Authorization: Bearer .

# It is recommended to use an authorization token in combination with SSL enabled,

# and save the token in the apm-server keystore.

secret\_token: secret

The same was provided as in the java script as under:  
-Delastic.apm.secret\_token=secret

It still returns the same error.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [March 29, 2021, 7:17am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/5 "2021-03-29T07:17:22Z")

</div>

In Kibana, go to Observability \> APM, then click on the top-right `Add Data` button

Or just go to `https://<host:port>/app/home#/tutorial/apm` path where `<host:port>` is the hostname and port of your Kibana instance.

Then you'll have a secret token with setup instructions for each platform, while the instructions differ on every platform the token remains the same here.

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 2, 2021, 1:18pm UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/6 "2021-04-02T13:18:54Z")

</div>

I am not able to find any token as seen from the setup instructions below:  
java -javaagent:/path/to/elastic-apm-agent-.jar   
-Delastic.apm.service\_name=my-application   
-Delastic.apm.server\_urls=http://localhost:8200   
-Delastic.apm.secret\_token=   
-Delastic.apm.application\_packages=org.example   
-jar my-application.jar

Does it mean that I leave it blank?

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 2, 2021, 2:08pm UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/7 "2021-04-02T14:08:45Z")

</div>

The below command runs fine in linux as:  
sudo java -javaagent:elastic-apm-agent-1.22.0.jar   
-Delastic.apm.service\_name=petclinic-java   
-Delastic.apm.server\_urls=https://localhost:8200   
-Delastic.apm.secret\_token=   
-Delastic.apm.application\_packages=co.elastic.apm.petclient   
-jar spring-petclinic-2.4.2.jar

The petclinic application runs fine too and I can access it as normal.

However, clicking on Agent Status in APM still states as, No data has been received from agents yet.

Any clues?

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [April 2, 2021, 2:45pm UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/8 "2021-04-02T14:45:51Z")

</div>

Few things to check:

- do you see anything captured in Kibana for this application ?
- do you see anything in the apm agent logs ? By default it's included in the application standard output.
- if you don't have any token, then you should just skip the property (not use an empty value)

The [minimal configuration](https://www.elastic.co/guide/en/apm/agent/java/current/configuration.html#configuration-minimal) does not include `secret_token`, and it is not mandatory, however it's quite important as it allows to secure communication between apm agent and server. Depending on your apm-server setup it might be required or not. For example default apm-server configuration on Elastic Cloud instances require it, which might not be the case if you are using a local deployment.

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 3, 2021, 10:54am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/9 "2021-04-03T10:54:03Z")

</div>

Hi Sylvan,  
in reply to your queries, see below:

- do you see anything captured in Kibana for this application ?  
Response: None, In Discover for index pattern apm-\* says " No results match your search criteria"
- do you see anything in the apm agent logs ? By default it's included in the application standard output.  
Response: it says" There are no log messages to display." My logs is not working now.
- if you don't have any token, then you should just skip the property (not use an empty value)  
Response: I've removed that condition line an it runs fine still and the Petclinic application is running.

In the end, Agent Status in APM still states as, No data has been received from agents yet.

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 5, 2021, 10:25am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/10 "2021-04-05T10:25:19Z")

</div>

When running the agent using, sudo java -javaagent:elastic-apm-agent-1.22.0.jar... I get the below error:  
[elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON\_WRITER with this error: Unrecognized SSL message, plaintext connection?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 26, 2021, 6:26am UTC](https://discuss.elastic.co/t/apm-agent-status-states-no-data-has-been-received-from-agents-yet/268295/11 "2021-04-26T06:26:03Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
