Cannot read contents of REST API response over HTTPS on ESP32 (Arduino) - https
I am trying to invoke a GET request to an endpoint that I have implemented on the restdb.io from an ESP32 (LilyGo) over HTTPS. My REST API endpoint is working correctly as I can test from my computer using cURL and the body of the response is a very simple JSON structure as shown below:
curl -k -i -v -H "Content-Type: application/json" -H "x-apikey: MY_KEY_STRING" -H "host: MY-RESTDB.restdb.io:443" -X GET "https://MY-RESTDB.restdb.io/views/incrementTaps?card_id=abcdefg&company_id=brasstaps"
Trying 188.166.28.84:443...
Connected MY-RESTDB.restdb.io (188.166.28.84) port 443 (#0)
schannel: disabled automatic use of client certificate
schannel: ALPN, offering http/1.1
schannel: ALPN, server accepted to use http/1.1
GET /views/incrementTaps?card_id=abcdefg&company_id=brasstaps HTTP/1.1
Host: MY-RESTDB.restdb.io:443
User-Agent: curl/7.79.1
Accept: */*
Content-Type: application/json
x-apikey: MY_KEY_STRING
Mark bundle as not supporting multiuse
HTTP/1.1 200 OK
x-xss-protection: 1; mode=block
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
x-dns-prefetch-control: off
access-control-allow-origin: *
content-type: application/json; charset=utf-8
content-length: 36
etag: W/"24-Z+nbeNAzC5yvac6Rt1EIVJ5CePw"
vary: Accept-Encoding
date: Mon, 20 Jun 2022 14:24:53 GMT
connection: close
{"tap_threshold":8,"current_taps":3}
Closing connection 0
However when I implement on ESP-32(LilyGo) (Arduino) using the embedded SIM800 over GPRS connection I then see an issue.
I am using TinyGSM library to set-up GPRS connection successfully. I then use ArduinoHttpClient library to attempt to complete the GET as follows:
Declarations:
TinyGsm modem(SerialAT);
static const char host[] = "MY-RESTDB.restdb.io";
static int port=443;
char *resource="/views/incrementTaps?card_id=abcdefg&company_id=brasstaps";
Code:
TinyGsmClientSecure client(modem);
HttpClient httpClient = HttpClient(client, host, port);
Then later in the code
httpClient.beginRequest();
httpClient.connectionKeepAlive();
if (httpClient.get(requestString)==HTTP_SUCCESS )
{
httpClient.sendHeader("x-apikey","MY_KEY_STRING");
httpClient.sendHeader("host","MY-RESTDB.restdb.io");
httpClient.sendHeader("accept","*/*");
httpClient.sendHeader(HTTP_HEADER_CONNECTION,"keep-alive");
httpClient.endRequest();
int startTime=millis();
while (millis()-startTime<10000)
{
int readResult = httpClient.read();
if (readResult>=0)
{
Serial.println(readResult);
}
}
}
I am able to see using restdb.io service inspector that the API call from the ESP-32 is being received at the restdb.io server and that the expected response is sent back containing the JSON structure.
However, on my ESP-32, when I look at DEBUG of AT commands it appears to show the TCP connection being set-up to the IP address of restDB.io server (with SSL being enabled) and the GET request being invoked including the required headers (see AT command debug logs up to timestamp 15:03:13.332 below).
14:58:33.871 -> AT+CGATT?
14:58:33.918 ->
14:58:33.918 -> +CGATT: 1
14:58:33.918 ->
14:58:33.918 -> OK
14:58:33.918 -> AT+CIFSR;E0
14:58:34.011 ->
14:58:34.011 -> 10.118.42.176
14:58:34.011 ->
14:58:34.011 -> OK
14:58:34.011 -> AT+CGATT?
14:58:34.058 ->
14:58:34.058 -> +CGATT: 1
14:58:34.058 ->
14:58:34.058 -> OK
14:58:34.058 -> AT+CIFSR;E0
14:58:34.104 ->
14:58:34.104 -> 10.118.42.176
14:58:34.104 ->
14:58:34.104 -> OK
14:58:34.104 -> AT+CIPRXGET=4,0
14:58:34.151 ->
14:58:34.151 -> +CIPRXGET: 4,0,0
14:58:34.151 ->
14:58:34.151 -> OK
14:58:34.151 -> AT+CIPSTATUS=0
14:58:34.244 ->
14:58:34.244 -> +CIPSTATUS: 0,,"","","","INITIAL"
14:58:34.244 ->
14:58:34.244 -> OK
14:58:34.244 -> AT+CIPCLOSE=0,1
14:58:34.291 ->
14:58:34.291 -> +CME ERROR: operation not allowed
14:58:34.291 -> AT+CIPSSL=1
14:58:34.336 ->
14:58:34.336 -> OK
14:58:34.336 -> AT+CIPSTART=0,"TCP","MY_RESTDB.restdb.io",443
14:58:34.430 ->
14:58:34.430 -> OK
14:58:40.342 ->
14:58:40.342 -> 0, CONNECT OK
14:58:40.342 -> AT+CIPSEND=0,3
14:58:40.342 ->
14:58:40.342 -> >GET
14:58:40.389 -> DATA ACCEPT:0,3
14:58:40.389 -> AT+CIPSEND=0,1
14:58:40.436 ->
14:58:40.436 -> >
14:58:40.483 -> DATA ACCEPT:0,1
14:58:40.483 -> AT+CIPSEND=0,64
14:58:40.528 ->
14:58:40.528 -> >/views/incrementTaps?card_id=123456789&company_id=brasstaps
14:58:40.622 -> DATA ACCEPT:0,64
14:58:40.622 -> AT+CIPSEND=0,9
14:58:40.668 ->
14:58:40.668 -> > HTTP/1.1
14:58:40.715 -> DATA ACCEPT:0,9
14:58:40.715 -> AT+CIPSEND=0,2
14:58:40.763 ->
14:58:40.763 -> >
14:58:40.763 ->
14:58:40.809 -> DATA ACCEPT:0,2
14:58:40.809 -> AT+CIPSEND=0,6
14:58:40.857 ->
14:58:40.857 -> >Host:
14:58:40.904 -> DATA ACCEPT:0,6
14:58:40.904 -> AT+CIPSEND=0,24
14:58:40.951 ->
14:58:40.951 -> >MY_RESTDB.restdb.io
14:58:40.997 -> DATA ACCEPT:0,24
14:58:40.997 -> AT+CIPSEND=0,1
14:58:41.044 ->
14:58:41.044 -> >:
14:58:41.090 -> DATA ACCEPT:0,1
14:58:41.090 -> AT+CIPSEND=0,3
14:58:41.137 ->
14:58:41.137 -> >443
14:58:41.184 -> DATA ACCEPT:0,3
14:58:41.184 -> AT+CIPSEND=0,2
14:58:41.230 ->
14:58:41.230 -> >
14:58:41.230 ->
14:58:41.276 -> DATA ACCEPT:0,2
14:58:41.276 -> AT+CIPSEND=0,10
14:58:41.322 ->
14:58:41.322 -> >User-Agent
14:58:41.369 -> DATA ACCEPT:0,10
14:58:41.369 -> AT+CIPSEND=0,2
14:58:41.416 ->
14:58:41.416 -> >:
14:58:41.464 -> DATA ACCEPT:0,2
14:58:41.464 -> AT+CIPSEND=0,13
14:58:41.464 ->
14:58:41.464 -> >Arduino/2.2.0
14:58:41.559 -> DATA ACCEPT:0,13
14:58:41.559 -> AT+CIPSEND=0,2
14:58:41.559 ->
14:58:41.559 -> >
14:58:41.606 ->
14:58:41.606 -> DATA ACCEPT:0,2
14:58:41.606 -> GET completion:7532 ms
14:58:41.606 -> AT+CIPSEND=0,8
14:58:41.652 ->
14:58:41.652 -> >x-apikey
14:58:41.699 -> DATA ACCEPT:0,8
14:58:41.699 -> AT+CIPSEND=0,2
14:58:41.745 ->
14:58:41.745 -> >:
14:58:41.791 -> DATA ACCEPT:0,2
14:58:41.791 -> AT+CIPSEND=0,37
14:58:41.839 ->
14:58:41.839 -> >MY_KEY_STRING
14:58:41.932 -> DATA ACCEPT:0,37
14:58:41.932 -> AT+CIPSEND=0,2
14:58:41.979 ->
14:58:41.979 -> >
14:58:41.979 ->
14:58:42.026 -> DATA ACCEPT:0,2
14:58:42.026 -> AT+CIPSEND=0,4
14:58:42.026 ->
14:58:42.026 -> >host
14:58:42.073 -> DATA ACCEPT:0,4
14:58:42.073 -> AT+CIPSEND=0,2
14:58:42.119 ->
14:58:42.119 -> >:
14:58:42.167 -> DATA ACCEPT:0,2
14:58:42.167 -> AT+CIPSEND=0,24
14:58:42.214 ->
14:58:42.214 -> >MY-RESTDB.restdb.io
14:58:42.306 -> DATA ACCEPT:0,24
14:58:42.306 -> AT+CIPSEND=0,2
14:58:42.306 ->
14:58:42.306 -> >
14:58:42.306 ->
14:58:42.354 -> DATA ACCEPT:0,2
14:58:42.354 -> AT+CIPSEND=0,6
14:58:42.400 ->
14:58:42.400 -> >accept
14:58:42.447 -> DATA ACCEPT:0,6
14:58:42.447 -> AT+CIPSEND=0,2
14:58:42.494 ->
14:58:42.494 -> >:
14:58:42.540 -> DATA ACCEPT:0,2
14:58:42.540 -> AT+CIPSEND=0,3
14:58:42.586 ->
14:58:42.586 -> >*/*
14:58:42.634 -> DATA ACCEPT:0,3
14:58:42.634 -> AT+CIPSEND=0,2
14:58:42.681 ->
14:58:42.681 -> >
14:58:42.681 ->
14:58:42.727 -> DATA ACCEPT:0,2
14:58:42.727 -> AT+CIPSEND=0,10
14:58:42.727 ->
14:58:42.727 -> >Connection
14:58:42.819 -> DATA ACCEPT:0,10
14:58:42.819 -> AT+CIPSEND=0,2
14:58:42.819 ->
14:58:42.819 -> >:
14:58:42.866 -> DATA ACCEPT:0,2
14:58:42.866 -> AT+CIPSEND=0,10
14:58:42.912 ->
14:58:42.912 -> >keep-alive
14:58:42.960 -> DATA ACCEPT:0,10
14:58:42.960 -> AT+CIPSEND=0,2
14:58:43.007 ->
14:58:43.007 -> >
14:58:43.007 ->
14:58:43.053 -> DATA ACCEPT:0,2
14:58:43.053 -> AT+CIPSEND=0,2
14:58:43.100 ->
14:58:43.100 -> >
14:58:43.100 ->
14:58:43.147 -> DATA ACCEPT:0,2
15:03:13.332 -> End request completion:1522 ms
15:03:13.332 -> AT+CIPRXGET=4,0
15:03:13.379 ->
15:03:13.379 -> +CIPRXGET: 4,0,0
15:03:13.379 ->
15:03:13.379 -> OK
15:03:13.379 -> AT+CIPSTATUS=0
15:03:13.474 ->
15:03:13.474 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:13.474 ->
15:03:13.474 -> OK
15:03:13.801 -> AT+CIPRXGET=4,0
15:03:13.848 ->
15:03:13.895 -> +CIPRXGET: 4,0,0
15:03:13.895 ->
15:03:13.895 -> OK
15:03:13.895 -> AT+CIPSTATUS=0
15:03:13.988 ->
15:03:13.988 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:13.988 ->
15:03:13.988 -> OK
15:03:14.317 -> AT+CIPRXGET=4,0
15:03:14.364 ->
15:03:14.364 -> +CIPRXGET: 4,0,0
15:03:14.364 ->
15:03:14.364 -> OK
15:03:14.364 -> AT+CIPSTATUS=0
15:03:14.457 ->
15:03:14.457 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:14.457 ->
15:03:14.457 -> OK
15:03:14.833 -> AT+CIPRXGET=4,0
15:03:14.880 ->
15:03:14.880 -> +CIPRXGET: 4,0,0
15:03:14.880 ->
15:03:14.880 -> OK
15:03:14.880 -> AT+CIPSTATUS=0
15:03:14.974 ->
15:03:14.974 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:14.974 ->
15:03:14.974 -> OK
15:03:15.302 -> AT+CIPRXGET=4,0
15:03:15.349 ->
15:03:15.395 -> +CIPRXGET: 4,0,0
15:03:15.395 ->
15:03:15.395 -> OK
15:03:15.395 -> AT+CIPSTATUS=0
15:03:15.490 ->
15:03:15.490 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:15.490 ->
15:03:15.490 -> OK
15:03:15.818 -> AT+CIPRXGET=4,0
15:03:15.865 ->
15:03:15.865 -> +CIPRXGET: 4,0,0
15:03:15.865 ->
15:03:15.865 -> OK
15:03:15.865 -> AT+CIPSTATUS=0
15:03:15.959 ->
15:03:15.959 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:15.959 ->
15:03:15.959 -> OK
15:03:16.332 -> AT+CIPRXGET=4,0
15:03:16.380 ->
15:03:16.380 -> +CIPRXGET: 4,0,0
15:03:16.380 ->
15:03:16.380 -> OK
15:03:16.380 -> AT+CIPSTATUS=0
15:03:16.473 ->
15:03:16.473 -> +CIPSTATUS: 0,0,"TCP","188.166.28.84","443","CONNECTED"
15:03:16.473 ->
15:03:16.473 -> OK
15:03:16.706 ->
15:03:16.706 -> +CIPRXGET: 1,0
Then, after a few more seconds, it appears to show the TCP connection (I guess?) being closed (either by the restDB service or SIM800) almost immediately afte the response data is reported as being available (see AT command debug logs below -- around timestamp 15:03:16.801):
15:03:16.706 -> AT+CIPRXGET=4,0
15:03:16.801 ->
15:03:16.801 -> +CIPRXGET: 4,0,427 (THIS I BELIEVE IS INDICATION THAT REST API RESPONSE CHARACTERS HAVE BEEN RECEIVED BY EMBEDDEDSIM800)
15:03:16.801 ->
15:03:16.801 -> OK
15:03:16.801 ->
15:03:16.801 -> 0, CLOSED (.... BUT THIS IS VIRTUALLY SIMULTANEOUS INDICATION THAT CONNECTION HAS CLOSED)
15:03:16.801 -> [322990] ### Closed: 0
The ArduinoHttpClient library does keep trying to read the reported 427 characters after this but the request gets ERROR response (I guess because connection is now closed)
15:03:16.801 -> AT+CIPRXGET=2,0,427
15:03:16.894 ->
15:03:16.894 -> +CME ERROR: operation not allowed
I have tested the same ESP-32/Arduino code with another service over HTTPS i.e. https://www.postman-echo.com/get?foo1=bar1&foo2=bar2 and this works perfectly and ESP-32 code gets the full REST API response and connection is only closed when my code calls "stop" function for the httpClient (after it has read and parsed the REST API response).
Because I see absolutely no issue with invoking the www.postman-echo.com API over HTTPS then my suspicion is that there is something associated with the response from restdb.io that results in connection being closed because ESP-32 cannot read data that was in API response.
Any suggestion on what might be the core issue here or some work around it would greatly be appreciated ?
Thanks
The S for HTTPS stands for Secure. you will need to check multiple things to know if the SIM800 will ever be capable of establishing an HTTPS connection.
The first would be to check the TLS version supported on SIM800 and what TLS version the server you are trying to connect accepts.
I've no idea which TLS version restdb.io would accept, but the rule of thumb is: you are safe when using hardware that accepts up to TLS v1.3 since that's the minimum TLS version Amazon AWS requires nowadays.
And unfortunately, SIM800 will only be able to cipher TLS v1.2! So you might need to consider replacing it with something a bit more up-to-date.
The second thing you might need is a certificate and a secure client library instead of a regular one. the certificate is not a must, but I would consider uploading it to your SIM800, check the documentation on how to upload files and how to set an SSL cert using the AP commands or any third-party software they might provide you with.
Related
Grunt | Error | Mac Only | Warning: spawn E2BIG Use --force to continue
I was handed a big grunt build process, and this seems to be the error coming : Warning: spawn E2BIG Use --force to continue I found what the error is here : https://github.com/feross/standard/issues/40 and here : http://www.in-ulm.de/~mascheck/various/argmax/. My error comes after a particular set of tasks have been executed (I checked this by plugging back and forth to find out the border line task after which this happens). Following is the Error Stack where it fails (on grunt-contrib-compass task to compiles .scss files into .css files) when I run grunt serve:all --appName=whitelabel --verbose --stack Running "compass:iea" (compass) task Verifying property compass.iea exists in config...OK File: [no files] Options: sassDir="lib/sass", cssDir="app/whitelabel/js/libs/iea/core/css", imagesDir="lib/images", javascriptsDir="lib/js", fontsDir="lib/sass/themes//fonts", importPath="lib/js/libs/vendor", relativeAssets Warning: spawn E2BIG Use --force to continue. Error: spawn E2BIG at exports._errnoException (util.js:870:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:362:9) at Object.exports.execFile (child_process.js:151:15) at Object.exports.exec (child_process.js:111:18) at module.exports (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/bin-version/index.js:6:15) at module.exports (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/bin-version-check/index.js:15:2) at /Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/grunt-contrib-compass/tasks/compass.js:75:7 at configContext (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/grunt-contrib-compass/tasks/lib/compass.js:145:9) at Object.<anonymous> (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/grunt-contrib-compass/tasks/compass.js:63:5) Aborted due to warnings. It happens on a grunt-contrib-compass task, but when I remove this task from the grunt file same error is shown on imagemin task, which implies that the error is purely system based (process arguments are too many) Running "imagemin:iea" (imagemin) task Verifying property imagemin.iea exists in config...OK Files: lib/images/carousel/arrow_left.png -> app/whitelabel/js/libs/iea/core/images/carousel/arrow_left.png Files: lib/images/carousel/arrow_right.png -> app/whitelabel/js/libs/iea/core/images/carousel/arrow_right.png Files: lib/images/carousel/carousel-1.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/carousel-1.jpg Files: lib/images/carousel/hero-idea.jpg.enscale.full.high.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/hero-idea.jpg.enscale.full.high.jpg Files: lib/images/carousel/hero-idea.jpg.enscale.mobL.high.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/hero-idea.jpg.enscale.mobL.high.jpg Files: lib/images/carousel/hero-idea.jpg.enscale.mobP.high.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/hero-idea.jpg.enscale.mobP.high.jpg Files: lib/images/carousel/hero-idea.jpg.enscale.tabL.high.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/hero-idea.jpg.enscale.tabL.high.jpg Files: lib/images/carousel/hero-idea.jpg.enscale.tabP.high.jpg -> app/whitelabel/js/libs/iea/core/images/carousel/hero-idea.jpg.enscale.tabP.high.jpg Files: lib/images/carousel/pager_current.png -> app/whitelabel/js/libs/iea/core/images/carousel/pager_current.png Files: lib/images/carousel/pager_default.png -> app/whitelabel/js/libs/iea/core/images/carousel/pager_default.png Files: lib/images/common/broken.png -> app/whitelabel/js/libs/iea/core/images/common/broken.png Files: lib/images/common/loading.gif -> app/whitelabel/js/libs/iea/core/images/common/loading.gif Files: lib/images/content-result-grid/result.jpg -> app/whitelabel/js/libs/iea/core/images/content-result-grid/result.jpg Files: lib/images/content-results-grid/result.jpg -> app/whitelabel/js/libs/iea/core/images/content-results-grid/result.jpg Files: lib/images/country-selector/Argentina.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Argentina.png Files: lib/images/country-selector/Australia.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Australia.png Files: lib/images/country-selector/Brazil.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Brazil.png Files: lib/images/country-selector/Canada.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Canada.png Files: lib/images/country-selector/China.png -> app/whitelabel/js/libs/iea/core/images/country-selector/China.png Files: lib/images/country-selector/Colombia.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Colombia.png Files: lib/images/country-selector/France.png -> app/whitelabel/js/libs/iea/core/images/country-selector/France.png Files: lib/images/country-selector/Germany.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Germany.png Files: lib/images/country-selector/India.png -> app/whitelabel/js/libs/iea/core/images/country-selector/India.png Files: lib/images/country-selector/Italy.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Italy.png Files: lib/images/country-selector/Switzerland.png -> app/whitelabel/js/libs/iea/core/images/country-selector/Switzerland.png Files: lib/images/country-selector/USA.png -> app/whitelabel/js/libs/iea/core/images/country-selector/USA.png Files: lib/images/country-selector/japan.png -> app/whitelabel/js/libs/iea/core/images/country-selector/japan.png Files: lib/images/form/bg-input-focus.png -> app/whitelabel/js/libs/iea/core/images/form/bg-input-focus.png Files: lib/images/form/bg-input.png -> app/whitelabel/js/libs/iea/core/images/form/bg-input.png Files: lib/images/form/calendar.png -> app/whitelabel/js/libs/iea/core/images/form/calendar.png Files: lib/images/form/down-arrow.png -> app/whitelabel/js/libs/iea/core/images/form/down-arrow.png Files: lib/images/form/form-bg.png -> app/whitelabel/js/libs/iea/core/images/form/form-bg.png Files: lib/images/form/radio-selected.png -> app/whitelabel/js/libs/iea/core/images/form/radio-selected.png Files: lib/images/form/radio.png -> app/whitelabel/js/libs/iea/core/images/form/radio.png Files: lib/images/form/sprite.png -> app/whitelabel/js/libs/iea/core/images/form/sprite.png Files: lib/images/hotspot/baseImage.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg Files: lib/images/hotspot/baseImage.jpg.enscale.full.high.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg.enscale.full.high.jpg Files: lib/images/hotspot/baseImage.jpg.enscale.mobL.high.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg.enscale.mobL.high.jpg Files: lib/images/hotspot/baseImage.jpg.enscale.mobP.high.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg.enscale.mobP.high.jpg Files: lib/images/hotspot/baseImage.jpg.enscale.tabL.high.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg.enscale.tabL.high.jpg Files: lib/images/hotspot/baseImage.jpg.enscale.tabP.high.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/baseImage.jpg.enscale.tabP.high.jpg Files: lib/images/hotspot/hotspot-1.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/hotspot-1.jpg Files: lib/images/hotspot/hotspot-1.png -> app/whitelabel/js/libs/iea/core/images/hotspot/hotspot-1.png Files: lib/images/hotspot/hotspot-2.jpg -> app/whitelabel/js/libs/iea/core/images/hotspot/hotspot-2.jpg Files: lib/images/hotspot/hotspot-2.png -> app/whitelabel/js/libs/iea/core/images/hotspot/hotspot-2.png Files: lib/images/hotspot/pointer.png -> app/whitelabel/js/libs/iea/core/images/hotspot/pointer.png Files: lib/images/media-gallery/arrow-left.png -> app/whitelabel/js/libs/iea/core/images/media-gallery/arrow-left.png Files: lib/images/media-gallery/arrow-right.png -> app/whitelabel/js/libs/iea/core/images/media-gallery/arrow-right.png Files: lib/images/media-gallery/clip-icon.png -> app/whitelabel/js/libs/iea/core/images/media-gallery/clip-icon.png Files: lib/images/media-gallery/media-gallery-1.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-1.jpg Files: lib/images/media-gallery/media-gallery-10.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-10.jpg Files: lib/images/media-gallery/media-gallery-11.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-11.jpg Files: lib/images/media-gallery/media-gallery-12.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-12.jpg Files: lib/images/media-gallery/media-gallery-2.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-2.jpg Files: lib/images/media-gallery/media-gallery-3.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-3.jpg Files: lib/images/media-gallery/media-gallery-4.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-4.jpg Files: lib/images/media-gallery/media-gallery-5.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-5.jpg Files: lib/images/media-gallery/media-gallery-6.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-6.jpg Files: lib/images/media-gallery/media-gallery-7.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-7.jpg Files: lib/images/media-gallery/media-gallery-8.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-8.jpg Files: lib/images/media-gallery/media-gallery-9.jpg -> app/whitelabel/js/libs/iea/core/images/media-gallery/media-gallery-9.jpg Files: lib/images/media-gallery/play-icon.png -> app/whitelabel/js/libs/iea/core/images/media-gallery/play-icon.png Files: lib/images/media-gallery/slide-right-arrow.png -> app/whitelabel/js/libs/iea/core/images/media-gallery/slide-right-arrow.png Files: lib/images/plain-text-image/plain-text-image.jpg -> app/whitelabel/js/libs/iea/core/images/plain-text-image/plain-text-image.jpg Files: lib/images/related-content-list/related-content-list-1.jpg -> app/whitelabel/js/libs/iea/core/images/related-content-list/related-content-list-1.jpg Files: lib/images/related-content-list/related-content-list-2.jpg -> app/whitelabel/js/libs/iea/core/images/related-content-list/related-content-list-2.jpg Files: lib/images/related-content-list/related-content-list-3.jpg -> app/whitelabel/js/libs/iea/core/images/related-content-list/related-content-list-3.jpg Files: lib/images/related-content-list/related-content-list-4.jpg -> app/whitelabel/js/libs/iea/core/images/related-content-list/related-content-list-4.jpg Files: lib/images/rich-text-image-holder/richtext-image.jpg -> app/whitelabel/js/libs/iea/core/images/rich-text-image-holder/richtext-image.jpg Files: lib/images/rich-text-image/rich-text-image.jpg -> app/whitelabel/js/libs/iea/core/images/rich-text-image/rich-text-image.jpg Files: lib/images/search-result/truck.jpg -> app/whitelabel/js/libs/iea/core/images/search-result/truck.jpg Files: lib/images/social-share-print/print.png -> app/whitelabel/js/libs/iea/core/images/social-share-print/print.png Files: lib/images/social-share-print/share.png -> app/whitelabel/js/libs/iea/core/images/social-share-print/share.png Files: lib/images/tabbed-content/accrodion-arrow-active.png -> app/whitelabel/js/libs/iea/core/images/tabbed-content/accrodion-arrow-active.png Files: lib/images/tabbed-content/accrodion-arrow.png -> app/whitelabel/js/libs/iea/core/images/tabbed-content/accrodion-arrow.png Files: lib/images/tabbed-content/tab-arrow.png -> app/whitelabel/js/libs/iea/core/images/tabbed-content/tab-arrow.png Files: lib/images/video/youtube.jpg -> app/whitelabel/js/libs/iea/core/images/video/youtube.jpg Files: lib/images/video/youtube.jpg.enscale.full.high.jpg -> app/whitelabel/js/libs/iea/core/images/video/youtube.jpg.enscale.full.high.jpg Options: interlaced, optimizationLevel=3, progressive Fatal error: spawn E2BIG Error: spawn E2BIG at exports._errnoException (util.js:870:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:362:9) at Through2._transform (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/imagemin-pngquant/index.js:59:12) at Through2.Transform._read (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/readable-stream/lib/_stream_transform.js:159:10) at Through2.Transform._write (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/readable-stream/lib/_stream_transform.js:147:83) at doWrite (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/readable-stream/lib/_stream_writable.js:313:64) at writeOrBuffer (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/readable-stream/lib/_stream_writable.js:302:5) at Through2.Writable.write (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/readable-stream/lib/_stream_writable.js:241:11) at write (/Users/vanan7/Documents/IEA/d2-front-end-training-repo/unilever-platform/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24) In another project, that I asked a friend, the build process is much complicated (many arguments are passed), but this error isn't thrown there. This is happening only on mac machines and working fine on windows. Has anybody had this error before who could help? Or any one else you can? Thank you.
Angular2 app works in Chrome and IE, but not Firefox or Safari
App works fine in Chrome and IE(11), but not in Firefox (42.0) or Safari (5.1.7). FIREFOX: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create es6-shim.js:1338:11 Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode. angular2.dev.js:351:5 EXCEPTION: Error: Expected int32 as second argument angular2.dev.js:23524 BrowserDomAdapter</BrowserDomAdapter.prototype.logError() angular2.dev.js:23514 BrowserDomAdapter</BrowserDomAdapter.prototype.logGroup() angular2.dev.js:23525 ExceptionHandler</ExceptionHandler.prototype.call() angular2.dev.js:1145 PlatformRef_</PlatformRef_.prototype._initApp/</<() angular2.dev.js:14801 NgZone</NgZone.prototype._notifyOnError() angular2.dev.js:5796 NgZone</NgZone.prototype._createInnerZone/errorHandling<.onError() angular2.dev.js:5700 run() angular2-polyfills.js:141 map#http://localhost:53861/lib/es6-shim/es6-shim.js:1113:14 TemplateParseVisitor</TemplateParseVisitor.prototype._createDirectiveAsts#http://localhost:53861/lib/anguar2/angular2.dev.js:24301:27 TemplateParseVisitor</TemplateParseVisitor.prototype.visitElement#http://localhost:53861/lib/anguar2/angular2.dev.js:24154:24 HtmlElementAst</HtmlElementAst.prototype.visit#http://localhost:53861/lib/anguar2/angular2.dev.js:20216:14 htmlVisitAll/<#http://localhost:53861/lib/anguar2/angular2.dev.js:20227:23 forEach#http://localhost:53861/lib/es6-shim/es6-shim.js:1107:14 htmlVisitAll#http://localhost:53861/lib/anguar2/angular2.dev.js:20226:5 TemplateParser</TemplateParser.prototype.parse#http://localhost:53861/lib/anguar2/angular2.dev.js:24038:20 TemplateCompiler</TemplateCompiler.prototype._compileComponentRuntime/done<#http://localhost:53861/lib/anguar2/angular2.dev.js:24669:32 run#http://localhost:53861/lib/anguar2/angular2-polyfills.js:138:14 NgZone</NgZone.prototype._createInnerZone/<.$run/<#[…] SAFARI: EXCEPTION: Error during instantiation of BrowserDetails! (Token Promise<ComponentRef> -> DynamicComponentLoader -> Compiler -> RuntimeCompiler -> ProtoViewFactory -> Renderer -> DomRenderer -> AnimationBuilder -> BrowserDetails). angular2.dev.js:23514ORIGINAL EXCEPTION: TypeError: 'undefined' is not a function (evaluating 'window.requestAnimationFrame(callback)') Potentially unhandled rejection [2] Error: EXCEPTION: Error during instantiation of BrowserDetails! (Token Promise<ComponentRef> -> DynamicComponentLoader -> Compiler -> RuntimeCompiler -> ProtoViewFactory -> Renderer -> DomRenderer -> AnimationBuilder -> BrowserDetails). ORIGINAL EXCEPTION: TypeError: 'undefined' is not a function (evaluating 'window.requestAnimationFrame(callback)') Error loading http://localhost:53861/app/bootDesktop.js Any ideas as to what is wrong greatly appreciated. It looks like it has something to do with "BrowserDomAdapter".
issue resolved by upgrade the es6-shim.
This is how google bot see my webpage (as seen in webmaster tool - fetch as google)
I have a joomla website. In my google webmaster tools, this is how google bots fetched my the disclaimer page on my site. What does it mean? I don't see any content here. My real page is this: http://www.asklaw.in/disclaimer. (I am referring to this page as an example. Other pages also do not show any conetnt) I don't see any content on this page as fetched by google bot. Fetch as Google This is how Googlebot fetched the page. URL: http://www.asklaw.in/disclaimer Date: Friday, February 14, 2014 at 12:32:33 AM PST Googlebot Type: Web Download Time (in milliseconds): 407 HTTP/1.1 200 OK Server: nginx/1.4.5 Date: Fri, 14 Feb 2014 08:32:34 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: 226d2339faeab0a35cea40673655bfc1=ea6579466180b66de9e73781d5179047; path=/ Cache-Control: max-age=3600 Expires: Fri, 14 Feb 2014 09:32:34 GMT Content-Encoding: gzip jos-Warning: JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING JSite -> initialise() # /home4/pawanhg/public_html/asklaw.in/index.php:30 JApplication -> initialise() # /home4/pawanhg/public_html/asklaw.in/includes/application.php:116 JApplication -> triggerEvent() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/application/application.php:230 JDispatcher -> trigger() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/application/application.php:642 JEvent -> update() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/event/dispatcher.php:161 call_user_func_array() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/event/event.php:71 plgSystemAdmintoolsPro -> onAfterInitialise() plgSystemAdmintoolsPro -> IPFiltering() # /home4/pawanhg/public_html/asklaw.in/plugins/system/admintools/admintools/pro.php:136 JError :: raiseError() # /home4/pawanhg/public_html/asklaw.in/plugins/system/admintools/admintools/pro.php:676 JError :: raise() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:251 JError :: throwError() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:176 call_user_func_array() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:214 JError :: handleCallback() call_user_func() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:765 plgSystemRedirect :: handleError() JError :: customErrorPage() # /home4/pawanhg/public_html/asklaw.in/plugins/system/redirect/redirect.php:109 JDocumentError -> render() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:798 JDocumentError -> _loadTemplate() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/document/error/error.php:107 require_once() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/document/error/error.php:135 require() # /home4/pawanhg/public_html/asklaw.in/templates/yoo_nano3/error.php:19 Warp\Joomla\Helper\SystemHelper -> init() # /home4/pawanhg/public_html/asklaw.in/templates/yoo_nano3/warp.php:33 Warp\Joomla\Helper\SystemHelper -> initSite() # /home4/pawanhg/public_html/asklaw.in/templates/yoo_nano3/warp/systems/joomla/src/Warp/Joomla/Helper/SystemHelper.php:119 JSite -> getParams() # /home4/pawanhg/public_html/asklaw.in/templates/yoo_nano3/warp/systems/joomla/src/Warp/Joomla/Helper/SystemHelper.php:139 JComponentHelper :: getParams() # /home4/pawanhg/public_html/asklaw.in/includes/application.php:358 JComponentHelper :: getComponent() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/application/component/helper.php:92 JComponentHelper :: _load() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/application/component/helper.php:43 JError :: raiseWarning() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/application/component/helper.php:415 JError :: raise() # /home4/pawanhg/public_html/asklaw.in/libraries/joomla/error/error.php:276
JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING is what you need to investigate further. This Joomla Forum posts indicates the issue may be with having uninstalled a component, or perhaps not having the latest version installed, and there being a bug - http://forum.joomla.org/viewtopic.php?f=579&t=578754 Example components mentioned include Kunena forum component, Zoo Theme templates and extensions (which you have as the Warp template framework is theirs), and some others. If you had that installed, it may not have not removed everything and that is then triggering the page to look for something else. Check anything you've removed was removed entirely (components, plugins, modules).
How do I convert a curl command with output option to httparty?
I am trying to convert this: curl -k -v -X GET -H "Accept: application/pdf" https://username:password#rest.click2mail.com/v1/mailingBuilders/456/proofs/1 -o myProof for httparty. Here's my code: #auth = {:username => 'test', :password => 'test'} options = {:headers => {'Accept' => 'application/pdf'}, :basic_auth => #auth } body = HTTMultiParty.get("https://stage.rest.click2mail.com/v1/mailingBuilders/54544/proofs/1", options) File.open("myProof", "w") do |file| file.write body end p "Reponse #{body.parsed_response}" the response returns "Cannot convert urn:c2m:document:id:361 from text/plain to application/pdf" Edit (2) body.inspect with "text/plain" returns #<HTTParty::Response:0x8 #parsed_response=nil, #response=#<Net::HTTPNotAcceptable 406 Not Acceptable readbody=true>, #headers={\"date\"=>[\"Sun, 06 May 2012 11:22:12 GMT\"], \"server\"=>[\"Jetty(6.1.x)\"], \"content-length\"=>[\"0\"], \"connection\"=>[\"close\"], \"content-type\"=>[\"text/plain; charset=UTF-8\"]}> with "application/pdf" #<HTTParty::Response:0x7fce08a92260 #parsed_response=\"Cannot convert urn:c2m:document:id:361 from text/plain to application/pdf\", #response=#<Net::HTTPBadRequest 400 Bad Request readbody=true>, #headers={\"date\"=>[\"Sun, 06 May 2012 11:24:09 GMT\"], \"server\"=>[\"Jetty(6.1.x)\"], \"content-type\"=>[\"application/pdf\"], \"connection\"=>[\"close\"], \"transfer-encoding\"=>[\"chunked\"]}> Edit 3 Api : Step 8 https://developers.click2mail.com/rest-api#send-a-test-mailing Edit 4 with debug_ouput option with "application/pdf" opening connection to stage.rest.click2mail.com... opened <- "GET /v1/mailingBuilders/54544/proofs/1 HTTP/1.1\r\nAccept: application/pdf\r\nAuthorization: Basic Ym9sb2RldjptVW43Mjk0eQ==\r\nConnection: close\r\nHost: stage.rest.click2mail.com\r\n\r\n" -> "HTTP/1.1 400 Bad Request\r\n" -> "Date: Sun, 06 May 2012 14:05:30 GMT\r\n" -> "Server: Jetty(6.1.x)\r\n" -> "Content-Type: application/pdf\r\n" -> "Connection: close\r\n" -> "Transfer-Encoding: chunked\r\n" -> "\r\n" -> "49\r\n" reading 73 bytes... -> "" -> "Cannot convert urn:c2m:document:id:361 from text/plain to application/pdf" read 73 bytes reading 2 bytes... -> "" -> "\r\n" read 2 bytes -> "0\r\n" -> "\r\n" Conn close with "text/plain" opening connection to stage.rest.click2mail.com... opened <- "GET /v1/mailingBuilders/54544/proofs/1 HTTP/1.1\r\nAccept: text/plain\r\nAuthorization: Basic Ym9sb2RldjptVW43Mjk0eQ==\r\nConnection: close\r\nHost: stage.rest.click2mail.com\r\n\r\n" -> "HTTP/1.1 406 Not Acceptable\r\n" -> "Date: Sun, 06 May 2012 14:14:19 GMT\r\n" -> "Server: Jetty(6.1.x)\r\n" -> "Content-Length: 0\r\n" -> "Connection: close\r\n" -> "Content-Type: text/plain; charset=UTF-8\r\n" -> "\r\n" reading 0 bytes... -> "" read 0 bytes Conn close log from curl command Edit (4) Well i found a solution with Rest Client and I did my modest contribution with this gem. https://github.com/bolom/click2mail-ruby-gem Thanks Every body
You can also use net::http (require 'net/http') See this question for an example how to download large files.
Try this: body = Httparty.get("https://username:password#rest.click2mail.com/v1/mailingBuilders/456/proofs/1") File.open("myProof", "w") do |file| file.write body end
The problem is with the API it's self. It has nothing to do with how you are calling the API to get the proof or what Rest API library you are using. The problem is whatever you used to create this mailingBuilders is causing a problem which is resulting in the error message "Cannot convert urn:c2m:document:id:361 from text/plain to application/pdf". Please send support#click2mail.com exactly what you have done to create this mailingBuilder so we can review it and see what the problem is.
Selenium IDE 1.7.1 throwing security error when uploading a local file
This may be related to this post: Selenium IDE 1.4.1 throwing security error when uploading a local file But after a windows 7 update last night, I am getting the following error when uploading a file using selenium IDE 1.7.1: [error] Unexpected Exception: code -> 1000, INDEX_SIZE_ERR -> 1, DOMSTRING_SIZE_ERR -> 2, HIERARCHY_REQUEST_ERR -> 3, WRONG_DOCUMENT_ERR -> 4, INVALID_CHARACTER_ERR -> 5, NO_DATA_ALLOWED_ERR -> 6, NO_MODIFICATION_ALLOWED_ERR -> 7, NOT_FOUND_ERR -> 8, NOT_SUPPORTED_ERR -> 9, INUSE_ATTRIBUTE_ERR -> 10, INVALID_STATE_ERR -> 11, SYNTAX_ERR -> 12, INVALID_MODIFICATION_ERR -> 13, NAMESPACE_ERR -> 14, INVALID_ACCESS_ERR -> 15, VALIDATION_ERR -> 16, TYPE_MISMATCH_ERR -> 17, DATA_CLONE_ERR -> 25, message -> Security error, result -> 2152924136, name -> NS_ERROR_DOM_SECURITY_ERR, filename -> chrome://selenium-ide/content/selenium-core/scripts/atoms.js, lineNumber -> 8864, columnNumber -> 0, location -> JS frame :: chrome://selenium-ide/content/selenium-core/scripts/atoms.js :: <TOP_LEVEL> :: line 8864, inner -> null, data -> null Running Firefox 11.0 The selenium command is: <tr> <td>type</td> <td>id=VisioFile</td> <td>C:\Selenium\Simple_File.vdx</td> </tr> Until last night and a windows update, this was working perfectly. Could potentially be the reboot having updated firefox or selenium IDE.
This is a regression from 1.7.0. It was fixed in 1.7.2 which was released earlier today.