首页 > 解决方案 > Node axios script fails with 414 error in only one of three environments

问题描述

When querying an on-prem server's REST API using the same node.js script, 2 of 3 clients have a 100% success rate (Status 200). The third client has a 100% failure rate, with 414 errors.

Client Status Code OS Node Version Axios Version
Client 1 200 MacOS 10.15.7 Node 14.18.1 Axios 0.21.4
Client 2 200 Ubuntu 18.04.5 Node 14.10 Axios 0.21.1
Client 3 414 MacOS 11.4 Node 14.18.1 Axios 0.21.4

You can see client 1 and 3 are virtually identical, yet client 3 fails every time and client 1 succeeds every time. Client 2 uses a different os and package versions, yet succeeds as well.

The problematic request is the third in a chain. The first two requests succeed on all three clients. The third request is large, a POST with a body size of 266k.

We have inspected the headers, request objects, etc and have found no discrepancies (though may have overlooked something.) Where lies the gremlin?

标签: node.jsaxios

解决方案


推荐阅读