You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/02 15:13:59 UTC

[GitHub] [cordova-android] skrilax91 opened a new issue #1336: ECONNABORTED when try to send external request

skrilax91 opened a new issue #1336:
URL: https://github.com/apache/cordova-android/issues/1336


   # Bug Report
   
   ## Problem
   I actually try to send request to an external API
   
   ### What is expected to happen?
   I guess the request send me an http 200 response code
   
   
   ### What does actually happen?
   Actually request send me an ECONNABORTED: "Request aborted" on android 8.1 tablet using cordova-android 10.1.0
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   This error appear on chinese android 8.1 tablet, this tablet dont have google, i don't know if it's usefull but this tablet don't have baseband version.
   the request work on samsoung android 8.1 tablet to android 10 tablet (android 11 not tested)
   
   
   ### Command or Code
   code used to send request:
   ```js
   axios.post('https://licences.#####.fr/api/subscribe').then(response => {
           this.status = (response.data.success) ? "Connected" : "Not Connected"
           this.error = ""
   }).catch( e => {
           this.status = "Error when calling api"
           this.error = JSON.stringify(e)
   })
   ```
   response:
   ```json
   {
   	"message": "Request aborted",
   	"name": "Error",
   	"stack": "Error: Request aborted\n at e.exports (https://localhost/js/chunk-vendors.93185c27.js:94961)\n at XMLHttpRequest.d.onabort (https://localhost/js/chunk-vendors.93185c27.js:92636)",
   	"config": {
   		"url": "https://licences.######.fr/api/subscribe",
   		"method": "post",
   		"headers": {
   			"Accept": "application/json, text/plain, */*",
   		},
   		"transformRequest": [null],
   		"transformResponse": [null],
   		"timeout": 0,
   		"xsrfCookieName": "XSRF-TOKEN",
   		"xsrfHeaderName": "X-XSRF-TOKEN",
   		"maxContentLength": -1,
   		"maxBodyLength": -1,
   	},
   	"code": "ECONNABORTED"
   }
   
   ```
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   This issue appear on a chanese android 8.1 tablet with vueJS or JQuery but not appear on other samsoung tablet with android 8.1
   
   
   ### Version information
   <!--
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   - cordova CLI: 10.0.0
   - cordova-android: 10.1.0
   - android: 8.1
   - package used for sending request: Axios (latest version)
   - @vue/cli: 4.5.13
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1336: ECONNABORTED when try to send external request

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1336:
URL: https://github.com/apache/cordova-android/issues/1336#issuecomment-911815438


   `ECONNABORTED` means software code has aborted the connection. This could happen either on the client or the server.
   
   I'm not familiar with `axios` library, but at the the base JS API level, if you're not calling on `.abort()` method on the `XMLHttpRequest` instance and you still see an `ECONNABORTED` error, that means the server software is aborting/killing the connection. In which case, you'll need access to the server's logging to investigate why it might be killing the connection.
   
   Cordova does not manipulate the use of `XMLHttpRequest` in anyway, so for this reason I'll be closing this ticket. I'll however will provide you with some tips that might help you isolate the issue.
   
   First I'd recommend isolating the issue away from axios. This is to prove that the fault isn't in the axios library (which perhaps could even be hiding the true error). I'd recommend attempting to recreate your API request using the raw `XMLHttpRequest` object. Based on what you provided above, this should look something like:
   
   ```javascript
   let xhr = new XMLHttpRequest();
   xhr.open('POST', 'https://licences.#####.fr/api/subscribe');
   xhr.onload = function() {
      console.log(xhr, xhr.responseText);
   };
   xhr.onerror = function(e) {
      console.error(e, xhr);
   };
   xhr.send();
   ```
   
   You could even try using the snippet above inside the dev tools console, and look at the network tab for the response.
   
   If you require further assistance, the community on our [slack](http://slack.cordova.io/) may be able to help you further.
   
   Kind regards,
   Norman


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #1336: ECONNABORTED when try to send external request

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1336:
URL: https://github.com/apache/cordova-android/issues/1336


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org