# Grafana Unable to connect with Loki. Please check the server logs for more details

**URL:** <https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757>\
**Category:** Grafana Loki\
**Tags:** datasource, loki, grafana\
**Created:** [April 18, 2024, 4:24pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757 "2024-04-18T16:24:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikaelboto](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mikaelboto](https://community.grafana.com/u/mikaelboto)\
**Post date:** [April 18, 2024, 4:24pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/1 "2024-04-18T16:24:20Z")

</div>

Hello, I’m having a problem trying to add my Loki as a datasource in my Grafana, both located in the same EKS cluster. I even did a kubectl exec -it grafana- -n monitoring – curl [http://loki:3100](http://loki:3100) test and the test shows that both communicate normally.

 ![Screenshot from 2024-04-18 13-20-17](https://us1.discourse-cdn.com/grafana/original/3X/4/4/440caa376feefb81361f72d40dc76da34e5592f4.png)  
 ![Screenshot from 2024-04-18 13-20-14](https://us1.discourse-cdn.com/grafana/original/3X/7/e/7e98ab91829c4ba9b94bb3794e96f56ec7d09bbf.png)

---

<div class="post-metadata">

**Author:** ![davidallen5](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/davidallen5/32/32092_2.png) [@davidallen5](https://community.grafana.com/u/davidallen5)\
**Post date:** [April 22, 2024, 7:22pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/2 "2024-04-22T19:22:14Z")

</div>

This probably isn’t answerable without many more details of your setup - but you’re not trying to connect to `http://loki:3100` you’re connecting to `http://loki.monitoring:3100`.

In these kinds of scenarios, 9 times out of 10, the issue isn’t anything to do with Grafana or Loki, but it has to do with DNS resolution and how it might be different on the grafana machine vs. where you’re testing it.

So the solution tends to involve diving into the EKS configuration to figure out what’s what. But the first step would be to try `kubectl exec -it grafana- -n monitoring – curl http://loki.monitoring:3100`

---

<div class="post-metadata">

**Author:** ![mikaelboto](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mikaelboto](https://community.grafana.com/u/mikaelboto)\
**Post date:** [April 22, 2024, 7:43pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/3 "2024-04-22T19:43:43Z")

</div>

Hello Davi. All good? Thanks for answering! Below is an image of the log I obtained after running the command.

 ![Screenshot from 2024-04-22 16-42-45](https://us1.discourse-cdn.com/grafana/original/3X/7/7/777cab589c8f45646ed8bff1084f3df82df3532d.png)

---

<div class="post-metadata">

**Author:** ![davidallen5](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/davidallen5/32/32092_2.png) [@davidallen5](https://community.grafana.com/u/davidallen5)\
**Post date:** [April 22, 2024, 7:47pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/4 "2024-04-22T19:47:43Z")

</div>

So now it makes sense why your loki connection is failing, because there’s no page there.

I can’t help with _why_ that URL isn’t resolving, it depends too much on how your EKS deployment is setup. But you previously checked that `http://loki:3100` worked, so try that. If that doesn’t work in your config, then I’m afraid you’ve got an EKS configuration issue, and you should post a different question with much more info about how loki & grafana are deployed.

---

<div class="post-metadata">

**Author:** ![dayanitajimenez13](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@dayanitajimenez13](https://community.grafana.com/u/dayanitajimenez13)\
**Post date:** [May 24, 2024, 4:16pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/5 "2024-05-24T16:16:04Z")

</div>

Hi Davi, I got the same error.  
I`m deploying the loki-distributed mode in a Openshif cluster

 ![errr1](https://us1.discourse-cdn.com/grafana/original/3X/a/1/a1236cfba3f7a17d60a010e532cf4e3479f1ce4b.png)  
 ![errr2](https://us1.discourse-cdn.com/grafana/original/3X/5/b/5b1f4816d18c634691e08c6aab1bf340c367e646.png)  
The component loki-loki-distributed-distributor is displaying this on the logs  
 ![errr3](https://us1.discourse-cdn.com/grafana/original/3X/9/6/96c02932296c51fb7ab8c454a9f9515005086420.png)

What can I do?

---

<div class="post-metadata">

**Author:** ![phamthanhalv](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@phamthanhalv](https://community.grafana.com/u/phamthanhalv)\
**Post date:** [September 7, 2024, 4:26pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/6 "2024-09-07T16:26:32Z")

</div>

For whoever stumble upon this issue, updating loki image to version 2.9.3 resolves mine.  
Thank to [romosa](https://github.com/grafana/loki/issues/11557#issuecomment-2014825845)

---

<div class="post-metadata">

**Author:** ![rajithbhargav036](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rajithbhargav036](https://community.grafana.com/u/rajithbhargav036)\
**Post date:** [November 4, 2024, 11:27am UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/7 "2024-11-04T11:27:10Z")

</div>

Hey Davi, I am facing the same error in on-prem helm deployment could you please help me.

---

<div class="post-metadata">

**Author:** ![davidallen5](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/davidallen5/32/32092_2.png) [@davidallen5](https://community.grafana.com/u/davidallen5)\
**Post date:** [January 5, 2025, 10:21pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/8 "2025-01-05T22:21:19Z")

</div>

Hiya folks – this error is rather generic and be caused by a lot of different factors. I’m going to close this thread as a result, but with a summary of what we’re discussing here, and some pointers on what to check out.

You can open an additional question **but please provide more information** and **please try these items first**.

**Summary** : The thread discusses issues with connecting Grafana to Loki as a data source, primarily focusing on DNS resolution and service accessibility within Kubernetes and OpenShift environments. People face issues due to incorrect service URL configuration, and it’s really important to check component logs for errors and report what they say so others can help. @phamthanhalv suggested updating the Loki image to version 2.9.3, which resolved their issue.

## Recommendations if you’re having this problem

- Ensure correct DNS resolution for Loki’s service URL in your Grafana configuration.
- Verify that the Loki service is accessible from the Grafana pod using the correct namespace and service name.
- Consider updating the Loki image to the latest stable version if encountering persistent issues.
- Check the logs of Loki components for any errors or misconfigurations.
- If using multi-tenant mode, ensure the `X-Scope-OrgID` header is correctly configured in Grafana.
- For OpenShift users, ensure that the Loki distributed mode is correctly set up and all components are functioning.

Other resources which might help:

- [Quickstart to run Loki locally](https://grafana.com/docs/loki/latest/get-started/quick-start/#loki-data-source-in-grafana)
- [Running Loki on Different On-Prem Environments](https://github.com/grafana/developer-advocacy/blob/main/transcripts/2024-04-25T22:58:44Z-operations-report-running-loki-on-different-on-prem-environments-grafanacon-2024-grafana.md)
- [Troubleshooting Loki](https://grafana.com/docs/enterprise-logs/latest/manage/troubleshooting/#troubleshooting-loki)

---

<div class="post-metadata">

**Author:** ![davidallen5](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/davidallen5/32/32092_2.png) [@davidallen5](https://community.grafana.com/u/davidallen5)\
**Post date:** [January 5, 2025, 10:21pm UTC](https://community.grafana.com/t/grafana-unable-to-connect-with-loki-please-check-the-server-logs-for-more-details/119757/9 "2025-01-05T22:21:35Z")

</div>

Closed on January 5, 2025, 10:21pm UTC


