mikepenz / xray-action

... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.
Apache License 2.0
48 stars 18 forks source link

`ERR_NON_2XX_3XX_RESPONSE` error after updating from v2.4.5 to v3.0.5 #837

Closed rafrafek closed 2 months ago

rafrafek commented 6 months ago

After updating from v2.4.5 to v3.0.5 the action stopped working. Enabling debug is not helpful.

::group::🚀 Connect to xray
🚀 Connect to xray
  ℹ️ Configured XrayCloud
  ℹ️ Start logging in procedure to xray
  ::add-mask::***
  ℹ️ Completed login and retrieved token
  ::endgroup::
::group::📝 Import test reports
📝 Import test reports
  ℹ️ Importing from: e2e_tests/e2etest_reports/test_result_gh_action.json
  ℹ️ Importing using format: cucumber
  ##[debug]followSymbolicLinks 'false'
  ##[debug]followSymbolicLinks 'false'
  ##[debug]implicitDescendants 'true'
  ##[debug]matchDirectories 'true'
  ##[debug]omitBrokenSymbolicLinks 'true'
  ##[debug]Search path '/home/runner/work/xxx/xxx/e2e_tests/e2etest_reports/test_result_gh_action.json'
  ##[debug]Try to import: /home/runner/work/xxx/xxx/e2e_tests/e2etest_reports/test_result_gh_action.json
  ##[debug]Using endpoint: https://xray.cloud.getxray.app/api/v2/import/execution/cucumber
  Error: 🔥 Failed to import: /home/runner/work/xxx/xxx/e2e_tests/e2etest_reports/test_result_gh_action.json
 ({"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE",
"timings":{"start":1[71](https://github.com/xxx/xxx/actions/runs/xxx/job/xxx#step:14:72)5182537553,
"socket":1715182537553,"lookup":1715182537553,"connect":1715182537553,
"secureConnect":1715182537553,"upload":1715182537553,"response":17151825[73]
(https://github.com/xxx/xxx/actions/runs/xxx/job/xxx#step:14:74)783,"end":1715182573784,
"phases":{"wait":0,"dns":0,"tcp":0,"tls":0,"request":0,"firstByte":36230,"download":1,"total":36231}}})
  ℹ️ Processed 0 of 1 elements. Failed to import: 1
  ::endgroup::
mikepenz commented 3 months ago

Apologies for the late answer.

Unfortunately this appears to be a xray API response. Does it work if you manually invoke the API request?

rafrafek commented 3 months ago

Is there any way to print the HTTP status and the body of the API response using the GH Action? Can it be printed when in debug mode?

rafrafek commented 3 months ago

"ERR_NON_2XX_3XX_RESPONSE" isn't much helpful, and instead of timings that I don't really need there could be the body.

mikepenz commented 3 months ago

The action prints the full error object from the networking library: https://github.com/mikepenz/xray-action/blob/main/src/processor.ts#L124

Which is thrown via here as far as I can tell: https://github.com/mikepenz/xray-action/blob/main/src/utils.ts#L76-L103

rafrafek commented 3 months ago

This log worked:

https://github.com/mikepenz/xray-action/blob/e326cb7c058e5ca844387c664cf90e348c9b9107/src/processor.ts#L124

These didn't work:

https://github.com/mikepenz/xray-action/blob/e326cb7c058e5ca844387c664cf90e348c9b9107/src/utils.ts#L91

https://github.com/mikepenz/xray-action/blob/e326cb7c058e5ca844387c664cf90e348c9b9107/src/utils.ts#L94

mikepenz commented 2 months ago

This should be improved with https://github.com/mikepenz/xray-action/pull/879