Request execution interrupts with no error output message

Hello, Forum!

A strange behavior of the SH - ProcessingAPI, by execution of particular request that ran via another account successfully.
After sending the request, the execution is terminated, without any error message to be output at the UI!

Herewith is the request that I’m trying to execute:

curl -X POST https://services.sentinel-hub.com/api/v1/process 
 -H 'Content-Type: application/json'
 -H 'Authorization: Bearer <YourAccessToken>' 
 -d '{
  "input": {
    "bounds": {
      "bbox": [
        2571918.724798,
        5330792.24621,
        2581426.967785,
        5341025.201693
      ],
      "properties": {
        "crs": "http://www.opengis.net/def/crs/EPSG/0/3857"
      }
    },
    "data": [
      {
        "dataFilter": {
          "timeRange": {
            "from": "2020-06-07T00:00:00Z",
            "to": "2020-08-31T23:59:59Z"
          },
          "orbitDirection": "DESCENDING"
        },
        "processing": {
          "orthorectify": "true",
          "backCoeff": "GAMMA0_TERRAIN",
          "demInstance": "COPERNICUS_30"
        },
        "type": "sentinel-1-grd"
      }
    ]
  },
  "output": {
    "resx": 10,
    "resy": 10,
    "responses": [
      {
        "identifier": "s1_sarddi",
        "format": {
          "type": "image/tiff"
        }
      }
    ]
  },
  "evalscript": "//VERSION=3.3 (auto-converted from 1)\n//\n// SENTINEL-1 SAR Deforestation Detection Index\n// ---------------------------------------------\n// 2019 - Antonio Carlon Paredes.\n// 2022 - Updated by:  Zlatomir Dimitrov, SRTI-BAS.\n// License: CC BY 4.0\n// https://creativecommons.org/licenses/by/4.0/\n//\nfunction setup() {\n  /*return {\n    input: [{\n      bands: [\n          \"VV\",\n          \"VH\"\n      ]\n    }],\n    output: { id: \"s1_sardd\", bands: 3 }\n  }*/\n  return {\n    input: [\"VH\", \"VV\", \"dataMask\"],\n    output:  { id: \"s1_sarddi\", bands: 3, sampleType: SampleType.FLOAT32 },\n    mosaicking: Mosaicking.ORBIT\n  }\n}\n\n// VH:\nfunction calculateAverage_VH(samples) {\n  var sum = 0\n  var nValid = 0\n  for (let sample of samples) {\n    if (sample.dataMask != 0) {\n      nValid++\n      sum += sample.VH\n    }\n  }\n  return sum/nValid\n}\n// VV:\nfunction calculateAverage_VV(samples) {\n  var sum = 0\n  var nValid = 0\n  for (let sample of samples) {\n    if (sample.dataMask != 0) {\n      nValid++\n      sum += sample.VV\n    }\n  }\n  return sum/nValid\n}\n\n\nconst GAIN = 2.5;\nconst WATER_LIMIT = 0.0005;  //0.1\nconst FOREST_LIMIT = 0.19; //0.2\nconst INVERSE_FACTOR = 25;\n\nconst GREEN_GRADIENT = [\n    [1.000, 0x80F300],\n    [0.500, 0x406600],\n    [0.000, 0x003300]\n]\n\nconst RED_GRADIENT = [\n    [1.000, 0xFFFFFF],\n    [0.525, 0xFF8600],\n    [0.300, 0xFF6E00],\n    [0.250, 0xAE0000],\n    [0.000, 0x000000]\n];\n\nconst GREEN_VIZ = new ColorGradientVisualizer(GREEN_GRADIENT, 0, 1);\nconst RED_VIZ = new ColorGradientVisualizer(RED_GRADIENT, 0, 1);\n\nconst evaluatePixel = function (samples, scenes) {\n\t//let vv = samples.VV;\n\t//let vh = samples.VH;\n  let vv = calculateAverage_VV(samples);\n  let vh = calculateAverage_VH(samples);\n\n  let v_area = vv * vh;\n\tlet v_len = Math.sqrt(vv * vv + vh * vh);\n  let v_angle_weighted = 0;\n\tif (vv > 0) {\n\t\tv_angle_weighted = Math.atan(vh/vv) / (Math.PI / 2);\n\t}\n\n  return [v_len, v_angle_weighted, v_area]\n/*\n\tlet v_len_inverse = 0;\n  \tif (v_len > 0) {\n\t\tv_len_inverse = 1 / (INVERSE_FACTOR * v_len);\n    }\n\n  \tif (area < WATER_LIMIT ) {\n    \treturn [0];\n    } else if (v_len > FOREST_LIMIT || v_angle_weighted > 0.2 ) {\n      \tlet index = GAIN * v_len - v_angle_weighted;\n        return GREEN_VIZ.process(index);\n    } else {\n        let index = GAIN * v_len_inverse + v_angle_weighted;\n        return RED_VIZ.process(index);\n    }\n*/ \n};"
}'

Will try it out via PostMan and will report with headers provided.

Thanks for the suggestions in advance!
Zlatomir.

Via Postman, the message is:

Cloud Agent Error: Request is taking longer than 30 seconds to fulfill. Use another agent to send a request without time limitations

.

Hi @zlatomir.d.dimitrov ,

I tested your request using Requests Builder and PostMan, and both of them responded correctly.

According to the error message from your Postman, it seems to be the time limitation set in your agent is too short as this request takes about 2 minutes to be processed. In the UI, the execution terminated without any error message seems like a timeout issue to me. Requests Builder has the exact same behalf when a request takes longer than 5 minutes, which is the time limitation we set for it.

Could you maybe try to set a longer time to wait for the response?

1 Like

Hi, thank You for your reply!

Interesting suggestion!
But, I didn’t find any settings at the UI (SH) related to “request timeout” …!?

So, herewith my recent tests results:

  curl --connection-timeout 600  -X POST https://services.sentinel-hub.com/api/v1/process ...

but the UI’s Parser removes it.

The interesting is that the same request runs successfully, via our second SH-account, which confirms Your test.

Does this relates to the PU somehow ?
The Dashboard says that I have far enough - remaining 68K + 500 requests !?
OR, Maybe server is overloaded and cut off connection !?

Best Regards!
Zlatomir.

Dear Chung,
Something in addition,
this icon:
image
sometimes (sporadically) disappears (and, obviously the request is terminated with no message output to the UI), after I scroll up with the mouse!?! Or, also (sporadically) If I just change tabs in browser.

Nonetheless, the PU are charged!

Best Regards,
Zlatomir.

Hi @zlatomir.d.dimitrov ,

Could you try to open the development tool (If using Chrome in macOS, go to view → developer → developer tools) and run the send the request with Requests Builder? This should show some messages which can help us narrow down the issue.

Okay,
Herewith some outputs:

and after refresh (F5) run it again:

[Violation] Added non-passive event listener to a scroll-blocking event. Consider marking event handler as ‘passive’ to make the page more responsive. See
codemirror.js:536 [Violation] Added non-passive event listener to a scroll-blocking ‘touchstart’ event. Consider marking event handler as ‘passive’ to make the page more responsive.
pe @ codemirror.js:536
Ns @ codemirror.js:7970
Rs @ codemirror.js:7895
Rs @ codemirror.js:7854
t.componentDidMount @ index.js:495
ls @ react-dom.production.min.js:212
wu @ react-dom.production.min.js:255
t.unstable_runWithPriority @ scheduler.production.min.js:19
Vi @ react-dom.production.min.js:122
_u @ react-dom.production.min.js:248
su @ react-dom.production.min.js:239
nu @ react-dom.production.min.js:230
Hu @ react-dom.production.min.js:281
(anonymous) @ react-dom.production.min.js:284
lu @ react-dom.production.min.js:240
$u @ react-dom.production.min.js:284
t.render @ react-dom.production.min.js:290
561 @ index.jsx:10
a @ (index):1
r @ (index):1
t @ (index):1
(anonymous) @ main.abae7b1b.chunk.js:1
codemirror.js:536 [Violation] Added non-passive event listener to a scroll-blocking ‘touchmove’ event. Consider marking event handler as ‘passive’ to make the page more responsive.

with following ERRORS:

#1:
xhr.js:177 POST …://apps.sentinel-hub.com/token_sentinel_hub 403
(anonymous) @ xhr.js:177
e.exports @ xhr.js:13
e.exports @ dispatchRequest.js:50
Promise.then (async)
u.request @ Axios.js:61
r.forEach.u. @ Axios.js:87
(anonymous) @ bind.js:9
(anonymous) @ App.jsx:78
c @ runtime.js:63

Show 5 more frames

#2:
apps.sentinel-hub.com/:1 Access to XMLHttpRequest at ‘…-hub.com/api/v1/process’ from origin ‘…://apps.sentinel-hub.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

#3:
ProcessRequestOverlayButton.js:75 Something went wrong. Error: Network Error
at e.exports (createError.js:16:15)
at d.onerror (xhr.js:84:14)

errorHandler @ ProcessRequestOverlayButton.js:75
(anonymous) @ RequestButton.js:79
c @ runtime.js:63
(anonymous) @ runtime.js:293
(anonymous) @ runtime.js:118
r @ asyncToGenerator.js:3
u @ asyncToGenerator.js:29
Promise.then (async)

#4:
xhr.js:177 POST …-hub.com/api/v1/process net::ERR_FAILED 502
(anonymous) @ xhr.js:177
e.exports @ xhr.js:13
e.exports @ dispatchRequest.js:50
Promise.then (async)
u.request @ Axios.js:61
r.forEach.u. @ Axios.js:87
(anonymous) @ bind.js:9
value @ index.js:119
(anonymous) @ index.js:99
(anonymous) @ RequestButton.js:64

$t @ react-dom.production.min.js:68

If U narrow me to more specifics, can provide.

Cheers!
Zlatomir

Hi @zlatomir.d.dimitrov ,

Could you please use a dedicated client_id for each of these tests, i.e., to be used only for the test, and share the first 2 blocks with me. In this case I can check our backlog and try to figure out what is happening.

Thank you!

1 Like

Hello Chung!
No worries, but will be easier if we skype and I share my screen. Could You please give me some of your contacts ?!

Also, I notice this endpoint failure:

Failed to load resource: the server responded with a status of 403 (https://apps.sentinel-hub.com/token_sentinel_hub/ )

So, that morning I’ve renewed the Access token
(via command line curl command:

curl --request POST --url https://services.sentinel-hub.com/oauth/token --header “content-type: application/x-www-form-urlencoded” --data "grant_type=client_credentials&…

…and it’s working!
Maybe, the OAuth server interrupts quietly somehow the connection, in case the token expires and/or in case an old token is used (but, yesterday I renewed the token, but nonetheless it wasn’t working).

Cheers,
Zlatomir.

Hi @zlatomir.d.dimitrov ,

I checked our back log and found that there were only 4 requests made with user id 43aa****----******** raised an error on 20th July from 1800 to 1930. Two of them was caused by idle timeout from our side, and the others were caused by Connection reset by peer which might be related to bad connection. During this period there were 18 other successful requests which took 30-200 seconds to respond. As we don’t put time limitations for timeout on our side, the gateway timeout (i.e., the loading icon disappears without output) is probably related to the browser.

I hope this explain the errors.

Cheers!

1 Like

Hi, Chung!
Okay, Thank You very much for the extensive explanation!
Will keep in mind those timeouts.

Cheers !
Zlatomir.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.