Clarifai / clarifai-javascript

Official Clarifai JavaScript client for browsers and node.js
https://docs.clarifai.com
Other
351 stars 81 forks source link

Initial 400 error: 11103 Method Not Allowed before face recognition api runs normally #34

Closed AveryTheDev closed 5 years ago

AveryTheDev commented 5 years ago

I have an issue in which the first image or two URL address is not accepted and I am met with the following:

Failed to load resource: the server responded with a status of 400 (Bad Request)

When I click on the link provided, it leads to a page with this on a single line.

{"status":{"code":11103,"description":"Method not allowed","details":"Method Not Allowed"}}

However, if I try another image and then go back to the original image used the server accepts the image.

Why is my request not accepted until I try enough images?

rok-povsic commented 5 years ago

@abrown945 Hi, I'm having trouble understanding what the problem is. From the response you get it seems that an incorrect GET/POST/PATCH/DELETE request method is being sent to the server, but I'm unsure where this is coming from.

Can you post a snippet of your JavaScript code where you use the Clarifai JS library, which produces this error?

Thanks

AveryTheDev commented 5 years ago

Sure. The problem is that I initially get a 11103 error when I use the app integrated with the face recognition api after it open. However, the error goes away after using a couple of additional photos.

Screenshot (50)

I have the code associated with the error placed above the console. I see additional details above the red highlighted text in the console, that may help

rok-povsic commented 5 years ago

@abrown945 Hi, if I understand this correctly, the issue occurs on first execution of the onButtonSubmit function, but not at any later point?

Can you print out imageUrl and check if, at all times, the value passed in as imageUrl is a valid image URL?

AveryTheDev commented 5 years ago

Its always a valid address because when the error eventually goes away I can use the same URL to have the face detected.

AveryTheDev commented 5 years ago

And yes, @rok-povsic it occurs on the first execution of the onButtonSubmit function per launch. Once that execution error goes away, I no longer have any error with the api.

rok-povsic commented 5 years ago

@abrown945 From the code snippet I don't see where the issue occurs. Can you please expand the data field in the response object? It may tell us the source of the error.

AveryTheDev commented 5 years ago

I just opened up the app and now I can't reproduce the error. Due to this, I can't provide any additional information and will close this for now.

I appreciate your assistance and if this error occurs again as I have made no changes to my code, I will be sure to follow your additional instructions. Thank you for your time