1

C O N C L U S I O N

https://docs.parseplatform.org/parse-server/guide/#configuring-s3adapter

I suspect that there are just so many PFFiles you can store in a Parse-Server class using the AWS free tier. I didn't have thousands of images but I think I hit this limit. I have a new question as to how I can check this limit, increase this limit (paying amazon somehow?), and how I can remove old records that may be filling the space. I am also curious how to convert to S3 instead of using the PFFile to store the actual data sounds like the solution for when I move to production as well so I will have to learn how do that. I wish I could just send some arguments to Parse and have it handle all the s3 stuff, but I would be shocked if it is that easy and can't find any tutorial on youtube or Udemy... so if anyone has any training they can point me to I would really appreciate it!

O R I G I N A L P O S T

I have a swift app that uploads a post with a file to a parse server running AWS marketplace configuration for a parse-server. Everything has been working fine for months and it just stopped working. I reverted to an old build and that didn't work either for encoding and saving PFFiles ...

The non-file data elements for the post ARE loading just fine. I haven't changed anything on the code nor on the AWS server so I am not sure what to look into. I know that iOS 12 just came out so I was hoping this may be related to that?

I am hoping that that someone has had this issue before and can at least give me some clues to hunt down and things to check out. The fact that the non-PFFile fields on the parse object are loading just fine leads me to believe this is particular to PFFiles and swift and not a server issue.

Something very odd... I commented out the section of code where the image is getting turned into data for a PFFile and changed it to one I have in assets...(see below) <I now think this only worked because the hard coded image was smaller so there was room for it in the filling up db>

if let image = UIImage(named: "B - light grey") {
    if let imageData = UIImageJPEGRepresentation(image, 1.0) {
//if let imageData = UIImageJPEGRepresentation(self.choosenImage!, 1.0) {
    print("start image encode to PFFile")
    if let blipFile = PFFile(name: "image.jpg", data: imageData as Data) {
        newBlipFile.imageFile = blipFile
        if curBlip.fileCount == 0 {
            curBlip.imageFile = blipFile
            curBlip.imageUIImage = newBlipFile.imageUIImage
        }
    }
    print("done image encode to PFFile")
}
}

When I did this the file upload WITH NO FAILURE. This confuses me greatly because I use "self.choosenImage!" as a UIImage in multiple UIImageViews and have no problems with it. I also get no failures or errors that suggest the conversion to data and setting as a PFFile has any issues... why would the hardcoded image become a well behaving PFFile but the one from camera roll raises no failures but just doesn't post to the server? I also noticed this error in the log...

Blip dropper[26789:11219152] [discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
image NIL
Blip dropper[26789:11219072] [Error]: Could not store file. (Code: 130, Version: 1.17.1)

-dan

Daniel Patriarca
  • 361
  • 3
  • 20
  • Did you use and configure the S3 files adapter or the default grid store adapter? – flovilmart Oct 03 '18 at 00:32
  • I set up an AWS instance by choosing Parse Server powered by Bitnami from the "AWS Marketplace". I didn't install any adapters. I have whatever the default set up is when you install the Parse-server cocoa pod and start using PFFIles as a data type. I am currently contemplated some trial and error tests like restarting the AWS instance. – Daniel Patriarca Oct 03 '18 at 03:25
  • 1
    I am pretty sure your database is full, and this is why you can’t store files – flovilmart Oct 04 '18 at 10:48
  • When I delete the record with the PFFile from parse server, does that delete the file? I deleted half the rows in the table that had PFFiles and then rebooted my AWS instance to test this. Is it possible that the deletion of the rows didn't actually delete the files that the PFFiles refer to and I have to manually clean them out? I am running on an AWS free tier, is there a way to see how much space my server is taking up to check this hypothesis? – Daniel Patriarca Oct 05 '18 at 01:27
  • Created a new parse server and that new one works just as the old one did. I thing that flovilmart was right that the db was full and when I deleted the records through the Parse dashboard they were not truly being deleted. – Daniel Patriarca Oct 05 '18 at 03:37
  • When you delete an object that has a reference to the file, the file isn’t deleted, so that makes sense. – flovilmart Oct 06 '18 at 03:15
  • > how I can check this limit, increase this limit by default, the files are stored in the database, so you should check your database instead > but I would be shocked if it is that easy and can't find any tutorial on youtube or Udemy. is is that easy, you just need to configure the credentials as described in the documentation, and all your files will after be stored on S3. As for moving files from the default storage to S3, it is possible with a few lines of code. – flovilmart Oct 07 '18 at 22:04

1 Answers1

0

The answer is that the failure was due to the database not having space for the file. The solution is to switch from parse server's default GridStoreAdapter and instead use an S3 adapter. I haven't done this yet but this is the link to the parse documentation that led me to that conclusion.

https://docs.parseplatform.org/parse-server/guide/#configuring-s3adapter

Daniel Patriarca
  • 361
  • 3
  • 20
  • I am struggling with the exact same thing, were you able to solve your issue with S3? Or did you stick with GridStoreAdapter? – Noah-1 Nov 11 '19 at 01:33
  • I converted to s3 and following the instructions were not too complex. Its also important to remember that if you are getting a failure because the GridStoreAdapter filled up you have to actually clean them out of the mongoDB. Just deleting them through parse will not solve it. – Daniel Patriarca Dec 21 '19 at 00:24