Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request failed: socket hang up error #23

Open
gjr-qm opened this issue Nov 14, 2018 · 5 comments
Open

request failed: socket hang up error #23

gjr-qm opened this issue Nov 14, 2018 · 5 comments

Comments

@gjr-qm
Copy link

gjr-qm commented Nov 14, 2018

The last days we get (a lot of) errors while using the client in our production system. Before that everything was working fine.

We're using client version 2.13 and the source of the error is line 93, position 19 in messagebird.js

Anyone else experiencing the same error?

@kozmoz
Copy link

kozmoz commented May 24, 2020

Similar issue here right now. 30% of the time "request failed: socket hang up" when loading a list of SMS messages. Was this issue ever resolved? How?

Version: messagebird@3.5.0

@juergengunz
Copy link

same issue for me, any idea what is the cause?

@kozmoz
Copy link

kozmoz commented Aug 23, 2020

Similar issue here right now. 30% of the time "request failed: socket hang up" when loading a list of SMS messages. Was this issue ever resolved? How?

Replaced the MessageBird library by Axios and got rid of the MessageBird library completely. This solved my issue. The REST endpoints are really simple ( https://developers.messagebird.com/api/sms-messaging/#list-messages ). To receive the list of messages e.g.:

const axios = require('axios').default;
const MESSAGES_URL = 'https://rest.messagebird.com/messages';

axios.get(MESSAGES_URL, {
            params: {
                // The status of the message.
                // Status scheduled, sent, buffered, delivered, expired, or delivery_failed.
                status: '',
                // The limit of messages to retrieve.
                limit: MAX_NUMBER_OF_MESSAGES,
                // The number of messages to skip before selecting.
                offset: 0
            },
            headers: {'Authorization': `AccessKey ${messageBirdAPIKey}`}
        })
            .then(response => {
                processMessages(response.data.items);
            })
            .catch(function (error) {
                logger.error(`Accessing url "${MESSAGES_URL}" to get sms messages failed: `, error);
            });

@schampilomatis
Copy link

This is caused by the 5 seconds timeout that is set in the client. Requests that take longer than 5sec will show this message when timing out, if the default settings are left there.

How to set timeout to 10s:

var messagebird = require('messagebird')('<YOUR_ACCESS_KEY>', 10000); //(value is in milliseconds).

@Talha089
Copy link

so how can we resolved that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants