-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expired token #46
Comments
Hi @alexislg2 Definitely it's not taking a new token every time you process a photo. I am suspecting you are instantializing the client every time you process a photo? Could you paste me your code snippet how you use our api? Thanks, |
Here is my code:
|
@robertwenquan is my code OK? Did clarifai changed anything in their API? I did not get these errors one month ago |
@alexislg2 token is expected to expire. That's for the consideration of security in case the token is compromised. However, it's automatically managed by the client so you don't have to worry about it. The code looks fine to me. Ohh, maybe it's the warning issue introduced in the recent version? It's just a warning and your code should run fine. Because the token is refreshed automatically. Did you see your code actually failed or did you just see this error ? |
No it raises an exception :
|
Oh sorry to hear that. If that is the case I will fix it today.
…On Thu, Feb 16, 2017 at 4:55 AM, ALEXIS LE GOFF ***@***.***> wrote:
No it raises an exception :
concept = clarifai_model_sfw.predict_by_url(url)["outputs"][0]["data"]["concepts"][0]
---------------------------------------------------------------------------
ApiError Traceback (most recent call last)
<ipython-input-26-600ba944b001> in <module>()
----> 1 concept = clarifai_model_sfw.predict_by_url(url)["outputs"][0]["data"]["concepts"][0]
[...]/site-packages/clarifai/rest/client.pyc in predict_by_url(self, url)
1578
1579 image = Image(url=url)
-> 1580 res = self.predict([image])
1581 return res
1582
[...]/site-packages/clarifai/rest/client.pyc in predict(self, inputs)
1635 '''
1636
-> 1637 res = self.api.predict_model(self.model_id, inputs, self.model_version)
1638 return res
1639
[...]/site-packages/clarifai/rest/client.pyc in predict_model(self, model_id, objs, version_id)
2463
2464 data = {"inputs": [obj.dict() for obj in objs]}
-> 2465 res = self.post(resource, data)
2466 return res.json()
2467
[...]/site-packages/clarifai/rest/client.pyc in post(self, resource, params, version)
1938 def post(self, resource, params=None, version="v2"):
1939 ''' Authorized post to Clarifai's API. '''
-> 1940 return self._requester(resource, params, 'POST', version)
1941
1942 def post_form(self, resource, params=None, version="v2"):
[...]/site-packages/clarifai/rest/client.pyc in _requester(self, resource, params, method, version, files)
1929 attempts -= 1
1930 if res.status_code != 200:
-> 1931 raise ApiError(resource, params, method, res)
1932 return res
1933
ApiError: POST models/e9576d86d2004ed1a38ba0cf39ecb4b1/versions/a6b3a307361c4a00a465e962f721fc58/outputs FAILED. code: 401, reason: Unauthorized, response:{u'status': {u'code': 11001, u'description': u'Invalid authentication token', u'details': u'expired token'}}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIe0txXmULMNuegNNLSEXygbyMHBXYPaks5rc2YogaJpZM4L6_9d>
.
--
Best,
Robert
|
@robertwenquan Any news on this? could this be the same reason why your website demo is not working? https://clarifai.com/demo |
@alexislg2 this bug has been fixed in v2.0.20 The demo outage is not relevant to this issue. It's because of an overuse of our demo that exhaused our api quota. I am closing this issue as this is fixed. Thanks again for reporting it |
Hey.
For few days now I receive this errors:
code: 401, reason: Unauthorized, response:{u'status': {u'code': 11001, u'description': u'Invalid authentication token', u'details': u'expired token'}}
I think the reason is because my token is expired. Indeed I save the
clarifaiApp
andmodel
variables because it takes too long to initialize (at least 5 seconds).Is there any workaround to avoid initializing the token for every photo I want to process?
The text was updated successfully, but these errors were encountered: