How to fix { "data": null, "error": { "param": "", "message": "EOF", "code": "e_internal_error" } } error

Baraka Kimambo 0 Reputation points
2024-10-07T07:58:38.02+00:00

The request is being made via a POST method with all necessary headers, including Authorization (HMAC-SHA256 signature), x-ms-date, x-ms-content-sha256, and Content-Type: application/json. The body contains a valid JSON payload, including sender address, subject, content, and recipients. Despite setting the headers and request body correctly, the server responds with an EOF error.

What I Tried: I created a POST request with the Azure Communication Services Email API URL. I included the necessary headers: Authorization: Generated using HMAC-SHA256. x-ms-date: RFC1123 formatted UTC timestamp. x-ms-content-sha256: Base64-encoded SHA-256 hash of the request body. Content-Type: Set to "application/json". I created a JSON body with the required fields: senderAddress, subject, plainText, html, and recipients. I used Go to make the HTTP request with all the required parameters. What I Expected to Happen: I expected the API to successfully send the email and return a response indicating the email was sent or queued for delivery. What Actually Happened: The API returned an error message with "EOF", indicating that something went wrong when handling the request. The response contained no additional information or details about the cause of the issue.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,234 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2024-10-17T23:57:36.3166667+00:00

    @Baraka Kimambo The "EOF" error message usually indicates that the server closed the connection unexpectedly. This can happen due to a variety of reasons such as network issues, server overload, or incorrect request format.

    Can you make sure the request body is correctly formatted? Verify that the JSON payload is valid and contains all the required fields. You can use a JSON validator to check the syntax of the JSON payload. Also verify that the headers are correctly formatted. Ensure that the Authorization header is generated using the correct HMAC-SHA256 signature, the x-ms-date header is formatted correctly and in UTC time zone.

    Lastly, if you encounter an EOF error, it could be due to network issues. Try making the request again after some time to see if the issue persists. You can also try making the request from a different network to see if the issue is with your current network.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.