# SharePoint online connector fails with Microsoft Graph 404 error

**URL:** <https://discuss.elastic.co/t/sharepoint-online-connector-fails-with-microsoft-graph-404-error/330739>\
**Category:** Elastic Search\
**Tags:** docker, elastic-workplace-search\
**Created:** [April 25, 2023, 12:50pm UTC](https://discuss.elastic.co/t/sharepoint-online-connector-fails-with-microsoft-graph-404-error/330739 "2023-04-25T12:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClemensW](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ClemensW](https://discuss.elastic.co/u/ClemensW)\
**Post date:** [April 25, 2023, 12:50pm UTC](https://discuss.elastic.co/t/sharepoint-online-connector-fails-with-microsoft-graph-404-error/330739/1 "2023-04-25T12:50:31Z")

</div>

I have been trying to set up Elasticsearch with a SharePoint integration.

I am hosting elasticsearch, kibana and enterprise-search all version 8.7 in docker container. I added Sharepoint Online as a Source for the enterprise-workplace-search. When I try to sync the content all sync jobs fail with the following error:  
`Error after less than a minute Updated 0 items Failure caused by: Connectors::ContentSources::Office365::CustomClient::ClientError: got a 404 from https://graph.microsoft.com/v1.0/groups/0177c34b-6360-47fc-a77b-67d69aa03c1c/sites/root with query {:$select=>"id,name"}`

The 404 makes sense since no site exists with the specified group, but I don't understand why the connector is trying to find sites with random groups or why it completely stops after not finding one random SharePoint site.

Are there any tips or tricks which might point me in the right direction for solving this problem?

---

<div class="post-metadata">

**Author:** ![Sander\_Philipse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sander_philipse/32/101890_2.png) [@Sander\_Philipse](https://discuss.elastic.co/u/Sander_Philipse)\
**Post date:** [April 25, 2023, 2:37pm UTC](https://discuss.elastic.co/t/sharepoint-online-connector-fails-with-microsoft-graph-404-error/330739/2 "2023-04-25T14:37:34Z")

</div>

Hi @ClemensW, this error usually happens when there's a group without a root site. The integration doesn't know whether a group has a root site, and then decides to query it. We have an open issue around this problem, but there are a few workarounds:

1. You could add an empty root site for this group
2. You could run our existing [Sharepoint connector package](https://github.com/elastic/connectors-ruby/tree/8.3), and modify it to return `nil` in this function: [connectors-ruby/custom\_client.rb at 8.3 · elastic/connectors-ruby · GitHub](https://github.com/elastic/connectors-ruby/blob/8.3/lib/connectors_sdk/office365/custom_client.rb#L92-L96)

We hope to have a better way for you to ingest your Sharepoint content in a future release.

---

<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:** [May 23, 2023, 2:37pm UTC](https://discuss.elastic.co/t/sharepoint-online-connector-fails-with-microsoft-graph-404-error/330739/3 "2023-05-23T14:37:36Z")

</div>

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