# LABs 5.4. petclinic-react does not show up, CORS policy error on PetClinic page

**URL:** <https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907>\
**Category:** Elastic Training\
**Created:** [August 2, 2023, 8:45am UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907 "2023-08-02T08:45:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Renata](https://discuss.elastic.co/u/Renata)\
**Post date:** [August 2, 2023, 8:45am UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/1 "2023-08-02T08:45:02Z")

</div>

Course: Elastic Observability Engineer  
Version: 7.9

Hello,

I cannot figure out how to solve this. I all the steps in 5.4. seem to be successful but at the end petclinic-react does not show up on Elastic APM. Chrome DevTools suggests that RUM event traffic is blocked by CORS policy:

![image](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c086b0bfb55092152e253393b372450c4fa68a2c.png)

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [August 2, 2023, 7:51pm UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/2 "2023-08-02T19:51:57Z")

</div>

Hi @Renata ,

are you accessing Petclinic through HTTP? If you are using HTTPS there might be an issue between the connection of the agent running in the browser and the APM server running on your lab environment.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Renata](https://discuss.elastic.co/u/Renata)\
**Post date:** [August 3, 2023, 7:30am UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/3 "2023-08-03T07:30:06Z")

</div>

Hello Andre,

the hyperlink is provided in LABs document. It is http, as browser complains that it is not secure. I tried different browsers, different internet connections, different PCs. Same error.

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [August 3, 2023, 4:02pm UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/4 "2023-08-03T16:02:54Z")

</div>

Hi @Renata ,

can you please share the content of the `config.js` file you have for `petclinic-client`?

Please also send us the result of running `sudo docker logs petclinic-client`.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Renata](https://discuss.elastic.co/u/Renata)\
**Post date:** [August 4, 2023, 9:46am UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/5 "2023-08-04T09:46:20Z")

</div>

Hello Andre,

for config.js ELASTIC\_APM\_SERVER\_JS\_URL I would obviously copy the current IP given on the terminal Machine Info. But overall the file content as follows:

```auto
> var config = {
> apm_server: process.env.ELASTIC_APM_SERVER_URL || 'http://apm-server:8200',
> apm_server_js: process.env.ELASTIC_APM_SERVER_JS_URL ||'ec2-52-51-136-26.eu-west-1.compute.amazonaws.com:8200',
> apm_service_name: process.env.ELASTIC_APM_SERVICE_NAME || 'petclinic-node',
> apm_client_service_name: process.env.ELASTIC_APM_CLIENT_SERVICE_NAME || 'petclinic-react',
> apm_service_version: process.env.ELASTIC_APM_SERVICE_VERSION || '1.0.0',
> api_server: process.env.API_SERVER || 'http://petclinic-server:8000',
> api_prefix: process.env.API_PREFIX || '/petclinic/api',
> address_server: process.env.ADDRESS_SERVER || 'http://address-finder:5000',
> distributedTracingOrigins: process.env.DISTRIBUTED_TRACINGS_ORIGINS || 'http://petclinic-client:4000,http://petclinic-server:8000,http://localhost:4000,http://localhost:8080,http://localhost:8081'
> }

```

As for running `sudo docker logs petclinic-client` - it asks for a password for 'elastic' and well I did not manage to guess it...

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [August 4, 2023, 7:58pm UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/6 "2023-08-04T19:58:48Z")

</div>

Hi @Renata ,

please try adding `http://` prefix to your Public IP and port set in `apm_server_js`.

Also, have you enabled RUM in your APM Server and restarted it?

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Renata](https://discuss.elastic.co/u/Renata)\
**Post date:** [August 7, 2023, 9:05am UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/7 "2023-08-07T09:05:43Z")

</div>

Hello Andre,

ok, so though I spent over 3 hours trying to make it work, never thought about adding http. And now it works! It was that simple. Thank you for support 🙂

/Renata

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [August 8, 2023, 2:31pm UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/8 "2023-08-08T14:31:37Z")

</div>

Hi @Renata ,

I'm sorry to hear you lost time, but I'm glad it worked out.

Best,  
Andre

---

<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:** [September 7, 2023, 2:32pm UTC](https://discuss.elastic.co/t/labs-5-4-petclinic-react-does-not-show-up-cors-policy-error-on-petclinic-page/339907/9 "2023-09-07T14:32:11Z")

</div>

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