I set up a site with an HTTP POST function, which I’m currently testing.
It seems that whenever the data that I send to this function (using JSON) is too big, the function fails - I tried it with a single array of data - when I use either half of that array, it works fine; but when I try to send the entire array, it fails. This would indicate that it’s not the data itself, its structure, or anything like that, but rather - the amount.
I tried a couple of different clients. I made sure there is not timeout set in the client itself.
Here’s the response that I’m getting (not sure if this is data from the server or from the client - probably the client):
“Something went wrong - The remote end-point couldn’t be contacted -
Error: 56 - OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104”
It might be a size limitation for POST. There are a number of things that could limit the size of the POST body. What is the size of the data in the POST? What is the URL used for the POST?
Please post the URL of your site. Only authorized Wix personnel can get access to your site in the editor.
The URL for the POST request is: https://talorbach.wixsite.com/itex-api-temp/_functions/ex?who=itex&key=1&dont_email
A quick look at the http-users database shows that the results of the query couldn’t be too big as the database isn’t that big. One thing I noticed is that one of the records is missing a value for the key field. A missing field might be the reason that there is “something wrong” with the POST body.
@yisrael-wix Pretty sure that’s not it. I’m not even trying to work with that collection. I’d gladly send you the entire JSON which I’m passing as the POST body, but not here.
Anyway, as I mentioned in the OP - when I just send half of one table or the other half - everything works fine, but when I send all of it together - it fails with no response. (BTW, when the problem stems from Wix DB, my http function does return an error, whereas in the case I’m writing about here - it returns nothing, so I don’t think it’s a DB thing, but maybe I’m wrong)
@tal-orbach How big is the entire JSON? What database is being queried?
@yisrael-wix It’s pretty big. Do you want me to save it as text and give you the size?
Essentially, it’s supposed to update nearly all collections in the DB, but right now, for testing purposes, I’m working with Subjects (as it has more than a few entries in it).
@tal-orbach Yes, let me know the size. I was told that there is a 512K size limit, but it’s possible that it could be limited even further.
You could do multiple queries (POSTs) and then assemble them.
@yisrael-wix So the size is 774KB.
Multiple queries would be a very poor solution here (too many people involved - opens up a great big doorway to problems). Any other suggestion? Perhaps saving the JSON somewhere and reading it (with the location passed as the request body)? or some other creative idea?
@tal-orbach Are you trying to give me a headache?
Let me think about this a bit. Plus, I sent this on to one of the smart people at Wix.
@yisrael-wix I wasn’t trying to give you a headache. Your headache is just icing on the cake.
Finally - one of the smart people at Wix!
Hi Tal.
I am Genry from WixCode R&D.
Can you please send me the exact payload you are sending? I understand it is a sensitive information, please send me directly to email: genrym@wix.com
Regards,
Genry.
HI Genry. I sent it just now.
@tal-orbach Hi. It seems, that the payload you are trying to process in the function is too long to process, and the client reaches a timeout. More elaborate analysis of what is happening in the function sent by email.
Regards,
Genry.
@genry-manashirov Hi, we have a similar problem. Can you help us?
Hi @betospina23
Can you please write a url to your site? And which function is causing a timeout?
Regards,
Genry.
Hi.
Just to update, the issue was resolved.
The issue was an import of public (client) module instead of backend one in http-functions.js file, which rendered an error in loading of http-functions.js file.
instead of:
import wixUsers from ‘wix-users’;
should be:
import wixUsers from ‘wix-users-backend’;
Regards,
Genry.