-
Notifications
You must be signed in to change notification settings - Fork 185
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
Empty reply from server after updating brand followed by immediately creating product #138
Comments
@flyingL123 can you provide me the store domain that you are noticing issues with? |
The domain is |
This looks like a test site, any reason I cannot grab the api credentials from admin and run a few tests directly to the site? |
That's totally fine. You can do whatever you need. |
Could it make a difference that I am using oAuth and you aren't? |
It should not matter. I do see the error that you had in the logs, it is reported as |
Also, out of curiosity, how are you using the PHP client with oAuth? We have not released this functionality in this library. |
I just made some minor changes to the client to support oAuth: https://github.com/flyingL123/bigcommerce-api-php I'm receiving this error consistently 100% of the time. The only difference between our code is that I'm using oAuth. Are you sure this wouldn't cause the problem? Could I provide you with the oAuth credentials so you could try it that way? Also, are you sure that 409 resource conflict is a result of this? Normally a resource conflict gets returned as a client error, not the network error like I'm seeing here. I had received resource conflict errors earlier today for other reasons, so I just want to make sure you aren't seeing that and assuming it's from this code. |
I just tried again a few more times, and received the same error. |
Hi @aleachjr - I just tried the same code using standard Auth instead of oAuth, and it worked. Any idea why this is happening? |
Upon looking at your branch, I also notice that you are using code that is 40 commits behind current master. I would suggest that you update your branch to the latest master code and try again. If that continues to fail, try this without using oAuth as it is not currently supported in the library. I am unable to test this using unsupported code at this time. |
I understand. The problem is that Bigcommerce requires oAuth for certain things, like webhooks, but then your SDK's don't support oAuth, so it puts us developers in a tough position. Are you at least able to see if there are any errors occurring on your server that would cause this empty response? I understand that you can't just take my word for it, but there is nothing in my branch that would be causing this. It works in every other scenario as expected. It even works fine if you just change the order of the the two commands we're discussing. Thank you for your help. |
I apologize for the hassle. We are aiming to have an oAuth supported library released within the next 30 days. Additionally, upon looking at server logs, I am not seeing any errors to your store since the last one about an hour ago. If you email me directly ([email protected]) we can talk about the changes you made to the library to support oAuth. |
Hey @flyingL123 just wanted to chime in that I tested your code with the newest library (with my own oAuth support), and it worked successfully. Can you make sure that product is adhering to the limits here? https://developer.bigcommerce.com/blog/changelog/api-limits Also, are you positive you are not being rate limited? Seems the rate limiting on oAuth is somewhat random. I have a version of the Client that will automatically sleep, and repeat the the request upon being rate limited, if that helps I can upload that here today. |
Thanks @MullinsR . My product is adhering to the limits in the link you provided. If I make the As far as I know, if I were being rate limited, I would be receiving a |
Hi @flyingL123 Yes you would receive 429 but it would not be available from You authenticate through oAuth using:
We use Let me know if using the updated library solves your issue, |
Thanks for the info. I actually have |
Hi, i am having same kind of issue. Were you able to fix this issue? If i POST a customfields and GET a product right after posting. Empty product is returned. But if i close and reopen the connection which will init_curl() between two of these calls it works fine. This looks like something is not reseting between two curl calls. I am testing in xamp in windows. I could not figure out whats going on in here. |
@shprabin - the issue that was happening for me was that i was receiving empty responses because the requests were actually failing silently with '429 - too many requests' ... this was confirmed by me printing the full response data (headers, statusCode, etc). so, to see if maybe you are experiencing this same issue, i would ask you to print the full response data after you make that GET request to see if maybe you are being 429 rate limited. EDIT: or, just implement a delay between the two requests. HTH |
I am attempting to first update a brand, then create a product using the Bigcommerce API. I am doing so with the following code:
This results in an
Bigcommerce\Api\NetworkError
being returned, with the messageEmpty reply from server
.If I run either of the commands above by themselves, the request succeeds. If I switch the order of the commands, so that the product is created and then the brand is updated, both requests succeed. However, when I run them as shown, the
updateBrand
command works correctly, but thecreateProduct
command hangs for a while and then throws theBigcommerce\Api\NetworkError
.Why would this be happening?
The text was updated successfully, but these errors were encountered: