question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Eufy API is returning 204 errors causing the library to fail

See original GitHub issue

Describe the bug
Calls seem to be randomly failing and returning 204 errors

To Reproduce
Steps to reproduce the behavior:

  1. Use code:
     const eufy: EufySecurity = new EufySecurity(config, logger);
     if (!await eufy.connect()) {
         console.log("Couldn't connect");
     }
    
     await eufy.refreshCloudData();
    
  2. View logs

Expected behavior
Calls to not fail.

Screenshots & Logfiles
If applicable, add screenshots and logfiles to help explain your problem. Without debug logging:

> tsc -p .

2021-11-18 23:15:33.860  ERROR Status return code not 200
{
  status: 204,
  statusText: 'No Content'
}
2021-11-18 23:15:34.391  ERROR Station <REDACTED> - Status return code not 200
{
  status: 204,
  statusText: 'No Content'
}

With debug logging:

2021-11-18 23:31:17.342  DEBUG [HTTPApi.request] Request:
{
  method: 'post',
  endpoint: 'app/get_hub_list',
  baseUrl: 'https://security-app-eu.eufylife.com/v1',
  token: '<REDACTED>',
  data: undefined,
  headers: {
    app_version: 'v2.8.0_887',
    os_type: 'android',
    os_version: '30',
    phone_model: 'EUFYCLIENT',
    country: 'GB',
    language: 'en',
    openudid: '<REDACTED>',
    uid: '',
    net_type: 'wifi',
    mnc: '02',
    mcc: '262',
    sn: '<REDACTED>',
    Model_type: 'PHONE',
    timezone: 'GMT+00:00'
  }
}
2021-11-18 23:31:17.498  DEBUG [HTTPApi.updateDeviceInfo] Stations - Response:
2021-11-18 23:31:17.498  ERROR [HTTPApi.updateDeviceInfo] Status return code not 200
{
  status: 204,
  statusText: 'No Content'
}

Versions:

  • Client version: 1.2.4
  • Node version: v14.18.1
  • Operating system: OSX 10.15.7

Additional context
The calls don’t always fail. For example, two calls right after each other:

2021-11-18 21:11:52.841  DEBUG [HTTPApi.request] Request:
{
  method: 'post',
  endpoint: 'app/cipher/get_ciphers',
  baseUrl: 'https://security-app-eu.eufylife.com/v1',
  token: '<REDACTED>',
  data: {
    cipher_ids: [
      16
    ],
    user_id: '<REDACTED>',
    transaction: '1637269912840'
  },
  headers: {
    app_version: 'v2.8.0_887',
    os_type: 'android',
    os_version: '30',
    phone_model: 'EUFYCLIENT',
    country: 'GB',
    language: 'en',
    openudid: '<REDACTED>',
    uid: '',
    net_type: 'wifi',
    mnc: '02',
    mcc: '262',
    sn: '<REDACTED>',
    Model_type: 'PHONE',
    timezone: 'GMT+00:00'
  }
}
2021-11-18 21:11:52.986  DEBUG [HTTPApi.getCiphers] Response:
{
  code: 0,
  msg: 'Succeed.',
  data: [
    {
      cipher_id: 16,
      user_id: '<REDACTED>',
      private_key: '-----BEGIN RSA PRIVATE KEY-----\n' +
        '<REDACTED>' +
        '-----END RSA PRIVATE KEY-----\n'
    }
  ]
}
2021-11-18 21:11:52.987  DEBUG [HTTPApi.request] Request:
{
  method: 'post',
  endpoint: 'app/cipher/get_ciphers',
  baseUrl: 'https://security-app-eu.eufylife.com/v1',
  token: '<REDACTED>',
  data: {
    cipher_ids: [
      16
    ],
    user_id: '<REDACTED>',
    transaction: '1637269912987'
  },
  headers: {
    app_version: 'v2.8.0_887',
    os_type: 'android',
    os_version: '30',
    phone_model: 'EUFYCLIENT',
    country: 'GB',
    language: 'en',
    openudid: '<REDACTED>',
    uid: '',
    net_type: 'wifi',
    mnc: '02',
    mcc: '262',
    sn: '<REDACTED>',
    Model_type: 'PHONE',
    timezone: 'GMT+00:00'
  }
}
2021-11-18 21:11:53.106  DEBUG [HTTPApi.getCiphers] Response:
2021-11-18 21:11:53.106  ERROR [HTTPApi.getCiphers] Status return code not 200
{
  status: 204,
  statusText: 'No Content'
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bropatcommented, Nov 20, 2021

@danstreeter Thank you for the offer, but I think I have solved the problem. I am currently testing the solution. It looks like Eufy is now using HTTP/2 and the library I used does not support it yet.

1reaction
bropatcommented, Nov 20, 2021

Eufy has made some changes to its site, which now often results in HTTP errors (204). I have seen that the entry endpoint in the Eufy app has changed. I am trying to understand what has changed and how to get everything working again.

That is the disadvantage of no open API… 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I receiving a 204 error message response when ...
A 204 message indicates that the user has a successful connection, but there is no data to be returned. Most common cause is...
Read more >
Faield to request (-204) error and connection problems - Queries
Hi. I have two Eufy cameras and a spotlight camera with the homebase. My cameras have been working fine for many months and...
Read more >
Eufy Security Integration - Third party ...
Dear Eufy Security, I would like to petition for open source API's, a Dev share program, and local direct app communication or mini...
Read more >
The complete error codes list for iVMS-4200
The device is off-line, or connection timeout caused by network. NET_DVR_NETWORK_SEND_ERROR, 8, Failed to send data to the device.
Read more >
Issues with eufycam 2c installed today.
I also got an error message once stating failed to request -204. I recorded the footage also, but image of error is posted....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found