Hi, I have an own deployed parse server and a MongoDB. I assigned a 10GB dedicated volume to MongoDB service but nothing to parse server service. I am able to upload small files upto 600-700 kliobytes by parse-android-sdk and also save documents. But I get I/O Failure when trying to upload files larger than 700 kilobytes. Should I assign a dedicated volume to my parse server service too? Is it possible to be a solution for uploading larger files? And if yes, how large this volume should be? Since getting more storage on my server has some cost to me, I need to get in the details first.
Do you have any reverse proxy on top of your Parse Server? That uses to be the main reason why you cannot upload larger files since most of them have a max payload limit.
There is no proxy, React native developer using the same server as me got no problem with base64 encoding. I tried to implement it on android too, so I used a cloud code to save the base64 string sent from my android client as a file, but still getting the error. I should mention that my android code works on back4app.com without any problems, uploading large files is done. It’s why I’m absolutely confused. Assuming there is a reverse proxy, how it comes possible that React native developer is facing no problem?
Also I should mention that uploading larger files is done by a fast network like 4G cellular data without problems by the android client. Does it give you any ideas about the reason of problem?
I’m using : GitHub - parse-community/parse-server-example: Example server using Express and the parse-server module. as my parse server. and the content of app.config file under .ebextensions is :
Is it related?
Do you mind to share the code that you are using to upload the file and also your complete parse server configuration including the file adapter?
Sorry, since I’m almost a beginner, maybe I can not ask my questions in a right way. Anyway here are my code snippets.(Since there is much code, I’ve pasted them in Ubuntu paste bin to keep things clean and clear here)
The Service class in android side, since I want uploading stays in progress even when the activity is stopped or destroyed, I run a service: Ubuntu Pastebin
And here’s the related code in MainActivity (It’s not all the code in MainActivity, just where I fetch the byte array from URI and start my service, the rest is just onCreate function and defining some view components) : Ubuntu Pastebin
And about the server I should say that I’m using https://www.fandogh.cloud/ which is a cloud service. And it works like this : You upload a zip file as “Image” and it will run npm commands on it at server side, and prepares the “Image”. Then you should start a “Service” in fandogh using a Manifest which contains some data like “Image”, variables and so on.
I’ve downloaded this repository as a zip file : GitHub - parse-community/parse-server-example: Example server using Express and the parse-server module. and the only thing I changed with this zip file, was Index.js file and replaced my MongoDB URI :
mongodb://mongo:[email protected]:27017/main?authSource=admin&authMechanism=SCRAM-SHA-1. Then I uploaded the zip file as “Image” to fandogh and it ran npm commands on it and finally the “Image” is successfully created.
Now I should start my parse-server “Service” and here’s the Manifest I created the service with : Ubuntu Pastebin This is the Manifest file content but format of the real Manifest file is .yml
I’m able to save documents and upload files upto 500-600 kilobytes via the android snippets I sent. But while trying to upload larger files, after some retries, I get
I/O Failure with the cause of timeout. And also I should note again that all android functionalities are working properly on back4app.com without any problems. I don’t mind if I give you my username and password on fandogh then you can check things out, but let’s keep it as the last shelter.
Maybe it is some limit that your provider has in place. Have you tried to open a ticket with them?
Possible but he says on fast network there is no problem. Maybe host is overloaded. And even smaller interruptions effects the connection.
@ali_pro My suggestion is setup a proxy between parse server and your clients. Proxy like nginx buffer request before sending it to backend. With this way you can determine if problem is related to your parse server or host.
Thank you but it seems that the team I’m working with doesn’t let me to take part anymore… But as my last question, this parse-server configuration has a pretty straight forward path to put cloud codes : GitHub - parse-community/parse-server-example: Example server using Express and the parse-server module. under cloud directory and main.js
But in this configuration : GitHub - parse-community/parse-server: API server module for Node/Express which is the one that React and PHP developer can upload files to it successfully on the same server(and I can not as android developer), I couldn’t find the path that I should put my cloud code. Maybe it seems to be a silly question but please tell me where should I put the main.js as cloud code and let me know if there are any changes that I should make to index.js
you can put cloud code in