Current time: 10-16-2019, 05:26 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AWS Private instance API 400
05-27-2016, 02:29 AM
Post: #1
AWS Private instance API 400
I've set up an AWS box using your AMI on eu-west-1. It works great doing tests from the web interface.

We have code set up successfully making API calls to Webpagetest on the public boxes.

We change the target of those API calls to our own private instance, we get:

{ statusCode: 400,
statusText: 'Invalid Location, please try submitting your test request again.' }

The Location we're sending in is eu-west-1:Chrome.

Our 'getLocations' shows we have an idle agent at eu-west-1:Chrome.

The locations.ini file is empty, as deployed.

The key looks to be working & authenticating, given the error.

What am I missing please? What other info would help?

Many thanks

Ben
Find all posts by this user
Quote this message in a reply
05-27-2016, 08:21 AM
Post: #2
RE: AWS Private instance API 400
(05-27-2016 02:29 AM)benthompson Wrote:  I've set up an AWS box using your AMI on eu-west-1. It works great doing tests from the web interface.

We have code set up successfully making API calls to Webpagetest on the public boxes.

We change the target of those API calls to our own private instance, we get:

{ statusCode: 400,
statusText: 'Invalid Location, please try submitting your test request again.' }

The Location we're sending in is eu-west-1:Chrome.

Our 'getLocations' shows we have an idle agent at eu-west-1:Chrome.

The locations.ini file is empty, as deployed.

The key looks to be working & authenticating, given the error.

What am I missing please? What other info would help?

Many thanks

Ben

I'm having the same issue. I just set up an instance in us-east-1. I tried kicking off a test via the API not giving a location and I get that API response. I checked the /getLocations.php endpoint and get
Code:
"data": {
"us-east-1:Chrome": {
"Label": "US East (N. Virginia)",
"location": "us-east-1",
"Browser": "Chrome",
"relayServer": null,
"relayLocation": null,
"labelShort": "US East (N. Virginia) - Chrome",
"default": true,
....

back. So thinking that location is default I wouldn't think I'd need to pass in a location. I try to pass in us-east-1:Chrome for location anyway and still get that API 400 response. I check AWS console and it hadn't spun up any test agent instances. I kick off a test from the web UI and I see it spin up an agent and my test works. Try again via API and I still get that 400 response.

From the comments in ec2_locations.ini it doesn't sound like any locations need to be put into locations.ini as the two files get merged provided the ec2_locations=1 in settings.ini which I've verified it does. I'm befuddled.
Find all posts by this user
Quote this message in a reply
06-02-2016, 07:35 PM
Post: #3
RE: AWS Private instance API 400
Thanks themark. Still stuck on this one I'm afraid, I can't find anything in the docs which tells you how to enable API calls to your private instance.
Find all posts by this user
Quote this message in a reply
06-03-2016, 07:10 AM
Post: #4
RE: AWS Private instance API 400
Think I've figured this out - at least I got it working for myself. Hopefully this solves your issue too! During setup of the AMI I passed in the API key which I got from the public instance at webpagetest.org. Something of the form "A.1234e5....". This gets stored in /var/www/webpagetest/www/settings/keys.ini. I ended up removing the "A." and just leaving everything else, ie. 1234e5.... I restarted nginx and then I used 1234e5... as my API key in my calls and I was able to get a test to run.
Find all posts by this user
Quote this message in a reply
06-06-2016, 10:36 PM
Post: #5
RE: AWS Private instance API 400
We are jumping around the room with joy! Thanks very much, test ran first time with edited API key!

Thank you!

Ben
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)