distributed-load-testing-on-aws icon indicating copy to clipboard operation
distributed-load-testing-on-aws copied to clipboard

json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

Open KIVagant opened this issue 2 years ago • 1 comments

Describe the bug

I am trying to launch a very primitive PoC test with an URL and with an HTTP Basic Authorization header. Unfortunately it does not work. When a task starts, it shows the error in logs:

2022-02-11 22:24:13ht6AGJO8Jk 03:24:13 INFO: Shutting down...
ht6AGJO8Jk 03:24:13 INFO: Shutting down...
2022-02-11 22:22:09return _default_decoder.decode(s)
2022-02-11 22:22:09File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
2022-02-11 22:22:09obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2022-02-11 22:22:09File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
2022-02-11 22:22:09raise JSONDecodeError("Expecting value", s, err.value) from None
2022-02-11 22:22:09json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
2022-02-11 22:22:09data = response.json()
2022-02-11 22:22:09File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 910, in json
2022-02-11 22:22:09return complexjson.loads(self.text, **kwargs)
2022-02-11 22:22:09File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
2022-02-11 22:22:09File "/usr/lib/python3.9/threading.py", line 892, in run
2022-02-11 22:22:09self._target(*self._args, **self._kwargs)
2022-02-11 22:22:09File "/usr/local/lib/python3.9/dist-packages/bzt/engine/engine.py", line 144, in wrapper
2022-02-11 22:22:09return self._check_updates(install_id)
2022-02-11 22:22:09File "/usr/local/lib/python3.9/dist-packages/bzt/engine/engine.py", line 734, in _check_updates
2022-02-11 22:22:09Exception in thread Thread-1:
2022-02-11 22:22:09Traceback (most recent call last):
2022-02-11 22:22:09File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
2022-02-11 22:22:09self.run()

Plus:

2022-02-11 22:24:13ht6AGJO8Jk | https://XXXXXXX| FAIL | 0.00% | 0.569 | Non HTTP response message: Task execution failed |

To Reproduce

I am not sure how to reproduce it since I'm trying to hit an URL in a private VPC. That's the configuration I have but without sensitive data:

{
  "execution": [
    {
      "concurrency": 1,
      "ramp-up": "1m",
      "hold-for": "1m",
      "scenario": "Test4Test"
    }
  ],
  "scenarios": {
    "Test4Test": {
      "requests": [
        {
          "url": "https://XXXXXXX",
          "method": "GET",
          "body": {},
          "headers": {
            "Authorization": "Basic XXXXX"
          }
        }
      ]
    }
  },
  "reporting": [
    {
      "module": "final-stats",
      "summary": true,
      "percentiles": true,
      "summary-labels": true,
      "test-duration": true,
      "dump-xml": "/tmp/artifacts/results.xml"
    }
  ]
}

Expected behavior

At least a clear message in logs explaining what's wrong with the endpoint, an HTTP response or at least a status, not the Exception.

Please complete the following information about the solution:

  • [x] Version: public.ecr.aws/aws-solutions/distributed-load-testing-on-aws-load-tester:v2.0.1
  • [x] Region: [e.g. us-east-1]
  • [x] Was the solution modified from the version published on this repository?: NO
  • [ ] If the answer to the previous question was yes, are the changes available on GitHub?
  • [ ] Have you checked your service quotas for the sevices this solution uses?: Unrelated
  • [X] Were there any errors in the CloudWatch Logs?

Screenshots

image

Additional context

Could you please give me an example of a configuration that uses an HTTP basic authentication in a "Single HTTP Endpoint" scenario?

KIVagant avatar Feb 12 '22 03:02 KIVagant

Hi @KIVagant, Those log messages look like they're coming from the Taurus containers that run the tests.

For basic auth, according to RFC 7617, the auth needs to be base64 encoded and construct the user-pass by concatenating the user-id, a single colon (":") character, and the password.

emcfins avatar Feb 28 '22 15:02 emcfins

Closing due to inactivity. If the above comment did not properly address your question feel free to re-open this issue.

G-Lenz avatar Nov 17 '22 16:11 G-Lenz