# The underlying connection was closed: An unexpected error occurred on a receive / Send

**URL:** <https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875>\
**Category:** Clearance and Reporting\
**Created:** [May 6, 2025, 11:49am UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875 "2025-05-06T11:49:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![azeem.chisty](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@azeem.chisty](https://zatca1.discourse.group/u/azeem.chisty)\
**Post date:** [May 6, 2025, 11:49am UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/1 "2025-05-06T11:49:17Z")

</div>

Hello ZATCA Team,

Today we started facing issue while clearance and reporting with an error “The underlying connection was closed: An unexpected error occurred on a receive / Send”

Can someone confirm if they have similar issue?

---

<div class="post-metadata">

**Author:** ![ahmadOsama](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@ahmadOsama](https://zatca1.discourse.group/u/ahmadOsama)\
**Post date:** [May 6, 2025, 11:52am UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/2 "2025-05-06T11:52:20Z")

</div>

@idaoud please fix it

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [May 6, 2025, 11:52am UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/3 "2025-05-06T11:52:40Z")

</div>

we have the same issue, but I noticed it happens only with simplified invoices

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [May 6, 2025, 11:53am UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/4 "2025-05-06T11:53:39Z")

</div>

we have issue

```auto
Message : cURL error 56: OpenSSL SSL_read: Connection reset by peer, errno 104 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://gw-fatoora.zatca.gov.sa/e-invoicing/core/invoices/clearance/single

```

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [May 6, 2025, 12:11pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/5 "2025-05-06T12:11:50Z")

</div>

Dears @salman , @mekhlafy , @ahmadOsama , @azeem.chisty

Thanks for reaching out,

Kindly check the below announcement, and confirm if you are still facing the same response.  
[Important Breaking Change (decommissioning gw-apic-gov.gazt.gov.sa) - Announcements - Fatoora Developer Community](https://zatca1.discourse.group/t/important-breaking-change-decommissioning-gw-apic-gov-gazt-gov-sa/4487)

Thanks,  
Ibrahem Daoud.

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [May 6, 2025, 12:15pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/6 "2025-05-06T12:15:19Z")

</div>

we’re using this endpoint [https://gw-fatoora.zatca.gov.sa/e-invoicing/core](https://gw-fatoora.zatca.gov.sa/e-invoicing/core)

---

<div class="post-metadata">

**Author:** ![azeem.chisty](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@azeem.chisty](https://zatca1.discourse.group/u/azeem.chisty)\
**Post date:** [May 6, 2025, 12:15pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/7 "2025-05-06T12:15:44Z")

</div>

Dear @idaoud ,

We have been using the **gw-fatoora.zatca.gov.sa** , issue started today afternoon.

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://zatca1.discourse.group/u/salman)\
**Post date:** [May 6, 2025, 12:18pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/8 "2025-05-06T12:18:14Z")

</div>

Dear @idaoud  
we are using [https://gw-fatoora.zatca.gov.sa/](https://gw-fatoora.zatca.gov.sa/)

---

<div class="post-metadata">

**Author:** ![mekhlafy](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mekhlafy](https://zatca1.discourse.group/u/mekhlafy)\
**Post date:** [May 6, 2025, 12:18pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/9 "2025-05-06T12:18:36Z")

</div>

When the invoice is simplified only the issue is happening and we don’t get a response. but if the invoice is tax invoice is success

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [May 6, 2025, 12:25pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/10 "2025-05-06T12:25:25Z")

</div>

@All

Thanks for your reply.

Please note that our team is currently working on it, will let you know once it resolve will reach out to you, Main while Kindly re-submit your invoices .

Thanks for your understanding.

Ibrahem Daoud.

---

<div class="post-metadata">

**Author:** ![mohdzeeshan5c0](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mohdzeeshan5c0](https://zatca1.discourse.group/u/mohdzeeshan5c0)\
**Post date:** [May 6, 2025, 12:28pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/11 "2025-05-06T12:28:14Z")

</div>

Appreciate your turn around

---

<div class="post-metadata">

**Author:** ![mohdzeeshan5c0](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@mohdzeeshan5c0](https://zatca1.discourse.group/u/mohdzeeshan5c0)\
**Post date:** [May 6, 2025, 1:27pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/12 "2025-05-06T13:27:02Z")

</div>

@idaoud

Looks good now

Thanks for the support

---

<div class="post-metadata">

**Author:** ![Sanjay](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sanjay](https://zatca1.discourse.group/u/Sanjay)\
**Post date:** [May 6, 2025, 4:04pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/13 "2025-05-06T16:04:38Z")

</div>

Customers are still reporting the issue, could you please confirm.

---

<div class="post-metadata">

**Author:** ![anusv](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@anusv](https://zatca1.discourse.group/u/anusv)\
**Post date:** [May 6, 2025, 4:17pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/14 "2025-05-06T16:17:48Z")

</div>

Our clients also reporting this issue. please take actions.

---

<div class="post-metadata">

**Author:** ![sergei.shishov](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sergei.shishov](https://zatca1.discourse.group/u/sergei.shishov)\
**Post date:** [May 13, 2025, 2:19pm UTC](https://zatca1.discourse.group/t/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receive-send/6875/15 "2025-05-13T14:19:04Z")

</div>

We also have the same issue but can “assure” you guys that this issue is happening since long time. We are just marking the document as FAILED and allowing the user to re-report it. But I agree that it is causing the frustration…

Based on the network error, it seems it is happening when the underlying ZATCA service is deployed (like new version rolled), in this case the “current” requests should be processed and only then obsolete servers should be discarded. It seems that the timeout is quiet short and therefore the connection is getting dropped.

I do not know the infrastructure of ZATCA, but if it is Kubernetes or any other “containers” which are spawned and then halted - then it is the most probable reason.

Please note that we have the same error for both: invoices and simplified invoices.

Also we have a lot of “timeout” issues

```auto
Connection to gw-fatoora.zatca.gov.sa timed out. (connect timeout=10)

```

I know that timeout is quiet small (10 seconds) but we cannot afford our workers to wait for longer due to the volume.
