Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:31:51 +0000.
Sender:Marcelo
.
Date:Monday, 19 October 2015 03:58:21 UTC+1.
Hi everyone,
I’m getting “Key object validation failed.” error when trying to update key using tyk analytics v0.9.6.5. Could anyone help me? Thanks
Imported Google Group message.
Sender:Martin Buhr
.
Date:Saturday, 21 November 2015 09:26:12 UTC.
Hi Marcelo,
Sure thing - I’ll need to see the response body.
Cheers,
Martin
-
show quoted text -
-
show quoted text -
–
You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/fddbd759-9ec2-4866-b846-65881709888b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Imported Google Group message.
Sender:Marcelo
.
Date:Monday, 19 October 2015 06:17:09 UTC+1.
Hi Marcelo,
Is the gateway logs outputting any errors? Most likely you’ve put an invalid value into one of the key creation fields.
Cheers,
Martin
Imported Google Group message.
Sender:Martin Buhr
.
Date:Monday, 19 October 2015 06:33:48 UTC+1.
Hi Martin, thanks for reply. No, nothing on logs…
Imported Google Group message.
Sender:Marcelo
.
Date:Monday, 19 October 2015 06:42:18 UTC+1.
Is hash_keys enabled in both tyk.conf and tyk_analytics.conf? It was a new security feature we introduced, it might be causing both your issues, if your keys are I hashed, and this setting is set to true, then Tyk and Tyk analytics will be trying to work on a hashed set and not on the actual token.
Cheers,
Martin
Imported Google Group message.
Sender:Martin Buhr
.
Date:Monday, 19 October 2015 15:34:00 UTC+1.
Hi Martin, My tyk.conf and tyk_analytics.conf don’t have “hash_keys” parameter. If I don’t set this param, will Tyk assume false as default value? Change log says it is not backwards compatible, if I configure “has_keys” as false will make still not backwards compatible?
Imported Google Group message.
Sender:Marcelo
.
Date:Monday, 19 October 2015 15:41:13 UTC+1.
Hi Marcelo,
hash_keys is false by default (to ensure compatibility), so if it’s unset, it’ll be false. Was worth a shot.
One thing you could check is the tyk_analytics logs, if there’s nothing there, take a look at the actual request when it goes out (chrome developer console) and see what gets returned, it may be a more verbose error message.
Cheers,
Martin
-
show quoted text -
-
show quoted text -
–
You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/6e84c736-5b6d-487f-88b1-74d983c98c39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Imported Google Group message.
Sender:Martin Buhr
.
Date:Monday, 19 October 2015 16:15:35 UTC+1.
Martin using chrome console as you suggested, I got this:
Imported Google Group message.
Sender:Marcelo
.
Date:Wednesday, 4 November 2015 08:18:11 UTC.
I had the same problem.
When trying to increase the monthly quota. After pressing “Update” button I get, at first, the top error, then after pressing again I get the bottom one:
Imported Google Group message.
Sender:Tarmo Janson
.
Date:Wednesday, 4 November 2015 08:45:18 UTC.
Hi Tarmo,
It would be helpful if you could send over the server response (before saving the key, open the console, and go go the network tab, then submit the key.
The dashboard will make an API request, to the endpoint above, if you select it and then click on “Response”, you’ll get the raw response from the API so we can diagnose better. If you could also send the request object (It will be the entire headers section), then we can see what got sent and what was returned, it will tell us a lot more and also allow us to replicate if necessary.
Many thanks,
Martin
Imported Google Group message.
Sender:Martin Buhr
.
Date:Wednesday, 4 November 2015 08:57:42 UTC.
Response:
{“Status”:“Error”,“Message”:“Key object validation failed.”,“Meta”:"",“Errors”:[{“Context”:{},“Description”:“must be of type object”,“Value”:null}]}
Request headers:
PUT /api/apis/{apiId}/keys/{keyId}?suppress_reset=1 HTTP/1.1
Host: {URL}:8443
Connection: keep-alive
Content-Length: 577
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
Origin: https://{URL}:8443
authorization: {Auth key}
Content-Type: text/plain;charset=UTF-8
Accept: /
DNT: 1
Referer: https://{URL}:8443/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,et;q=0.6
Cookie: _ga=GA1.2.369907512.1442305998; api-usage=true; authorisation={Auth key}
Response headers:
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Wed, 04 Nov 2015 08:50:05 GMT
Content-Length: 149
Imported Google Group message.
Sender:Tarmo Janson
.
Date:Wednesday, 4 November 2015 09:02:28 UTC.
Hi Tarmo,
Thanks - and the request payload for the PUT (bottom of the headers section) - send it to me directly if you don’t want it in the forum.
Cheers,
Martin
Imported Google Group message.
Sender:Martin Buhr
.
Date:Wednesday, 4 November 2015 09:34:56 UTC.
Hi Tarmo,
(Posting this to group as it might be a viable solution)
For users that have upgraded to the newer versions of Tyk, new validation schemas have been put in place for key objects, this might be affecting old versions not being able to update the tokens.
A potential fix:
Replace the tyk_analytics/schemas/key_data.json file with one from an older version of Tyk Dashboard
Or:
Modify tyk_analytics/schemas/key_data.json amd remove this element:
“meta_data”: {
“type”:“object”
},
Let me know how you get on with it.
Cheers,
Martin
On Wed, Nov 4, 2015 at 8:57 AM, Tarmo Janson [email protected] wrote:
Imported Google Group message.
Sender:Martin Buhr
.
Date:Wednesday, 4 November 2015 12:35:49 UTC.
Thanks!
Removing the meta_data element fixed it.
Imported Google Group message.
Sender:Tarmo Janson
.
Date:Saturday, 21 November 2015 05:39:34 UTC.
Hi Martin,
I tried the two potentials fixes: removing the meta_data element and then replacing schemas/key_data.json with older version, but did not work for me. Could I send to your email my server response for a better debug?
Thanks in advance!
Imported Google Group message.
Sender:Marcelo
.
Date:Saturday, 21 November 2015 09:26:12 UTC.
Hi Marcelo,
Sure thing - I’ll need to see the response body.
Cheers,
Martin
-
show quoted text -
-
show quoted text -
–
You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/fddbd759-9ec2-4866-b846-65881709888b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Imported Google Group message.
Sender:Martin Buhr
.
Date:Tuesday, 24 November 2015 15:54:41 UTC.
Hi,
Martin helped me by email, and sent me a key_data.json without any validation and it worked well for me. But it is recommended include the validation rules one by one to identify which one is causing the problem.
Thanks.