-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ParseFile save fails on parser-server after migration: Unable to encode an unsaved ParseFile #136
Comments
Reported the same on parse-android-sdk. parse-community/Parse-SDK-Android#384 |
@gfosco Sorry, just checking if this is a valid bug. I couldn't upload images to parse-server after migration. Any solutions appreciated. |
Will look at this within the next day or two, looks valid, will combine other issues to point here. |
@smanikandan14, are you using OkHttp dependency on you app? As soon as I added OkHttp, I started to have some problems with my parse-server:
So, the issue seems to be around the SDK, at least for me as I only have problems when using OkHttp dependency on my app. |
Got the same error after migration: [Error]: Invalid file upload. (Code: 130, Version: 1.12.0) |
I am using the .NET sdk and I get this error as well 'Invalid file upload' but I suspect the bug might be in the SDK as I can upload text files and images directly to my parse-server using cURL. |
I have found a solution to my issue by explicitly setting the MIME type when uploading a ParseFile. |
@gfosco idea on that, is that because we use a raw body parser and the content maybe encoded in another format depending on the client configuration (usually multipart/form-data with boundaries) |
I am using the .NET SDK to upload PFFiles (images), and also got the When I change back to my old Parse.com-hosted server, it works fine. |
@JoshR604 Are you setting the MIME type in the ParseFile constructor? |
@oyvindvol Yes, here is the code I am using: var file = new ParseFile ("photo.jpg", data, "image/jpeg"); Also, I am using the .NET sdk on Xamarin and have tested this code on iOS and Android. |
I just discovered today that by default the migration feature of the new Parse dashboard only migrates your data. It does not migrate the contents of the ParseFile object itself. In my case I am storing jpg and png images inside a ParseFile. When I did the first mirgration the ParseFile objects migrated but they pointed towards the www.parsefss.com url. In my case I was able to by pass the need for the migration tool because I happened to have a backup/restore feature on my client's website. Where I was able to do a full backup while still on the Parse.com database. Then when I switched to my open source Parse Server with it's own MongoDB, I did a full restore. This caused the file uploading to store a brand new copy of the ParseFile images inside the MongoDB database. I was able to check this simply by doing a View Image with the browser. So it looks like all you have to do is something similar to this and you're ready to go! I did a double check on my website before posting this comment. The open source Parse Server uploads, edits and deletes images just fine! |
@perriera I had a similar question about Parse.Files on the old system. Apparently a file migration tool that will migrate your files to your new MongoDB is in the works. For now, configuring your server with a fileKey (from your Parse file key) will make your server point correctly to the old files that still reside on Parse's Amazon file store. New files created on your server using Parse.File will be stored on your own MongoDB and work just fine. |
@gfosco Do you know when you will look at this bug? |
When you do the migration as made available by Parse.com, the current implementation of that migration does not automatically copy over the images that any of your ParseFile objects have embedded in them. While the ParseFile object is migrated, the embedded image is not. It continues to point to the original storage location. However, when you go through the trouble of re-uploading that image to your open source Parse Server from scratch it will embed the image inside very same open source Parse Server. All you have to do is look at your MongoDB to see it. As well, simply check the image in your browser to see when it is now pointing. So it's not really a bug anymore, just an oversight. The open source Parse Server has been refined over a period of five long years. It's very well put together. It's just a matter of learning how to use it properly. Cheers, Perry Anderson Unified Objects, Inc. http://www.unifiedobjects.com/ We build beautiful web and mobile apps! http://hosting.unifiedobjects.com/ Tel: 844 440 7400perry.anderson@gmail.com with me on LinkedIn. http://lnkd.in/5TpErEOn Thu, Feb 18, 2016 at 4:30 PM, oyvindvol notifications@github.com wrote:
|
@perriera That`s OK, but that was not really my problem. The problem is that when uploading images from file upload via the .NET SDK we get the error |
Keep me posted! Parse Server is open source now so it's going to be up to Cheers, Perry Perry Anderson Unified Objects, Inc. http://www.unifiedobjects.com/ We build beautiful web and mobile apps! http://hosting.unifiedobjects.com/ Tel: 844 440 7400perry.anderson@gmail.com with me on LinkedIn. http://lnkd.in/5TpErEOn Fri, Feb 19, 2016 at 4:26 AM, oyvindvol notifications@github.com wrote:
|
any news on file upload process? @gfosco |
Looks like we require the |
@nlutsenko So, I updated my parse server to 2.1.2, and tried again uploading file from .NET SDK. Still get the same error And this is how I create the file: |
The fix literally landed ~6 hours ago and 2.1.2 is about 3 days old at this point, meaning that it will be a part of 2.1.3. 😁 |
@nlutsenko Ah, I`m sorry :) Thanks! |
did this bug already fixed? I'm still get the error "invalid file upload" thanks |
It is not released yet, it will be part of parse-server 2.1.3. |
@vioside, that sounds super strange. Any chance you can open a separate issue for it, also would be super helpful if you would specify there how you are configuring S3 storage. |
@nlutsenko ok, issue created: #675 |
I am experiencing this issue with Parse-Server, though it was working fine with saving images hosted on the www.parsefss.com domain, until today. I wonder if uploading through the parse.com file browser somehow caused it to not save the images from the application anymore. Are you able to share any resources on how to take the database and re-upload it (to mLab from Heroku in my case)? What you're saying is that by using this process it will save the files to with a domain pointing to our server and not the parse.com one? |
What is the update on this. Still getting the error |
This actually was happening because I maxed out the HDD on the mongodb host I use (mLab) . Didn't realize it bc I'm used to Parse. So that may help. You also in general want to try updating the parse-server SDK, for some other things that helped me. Good luck.
|
I was able to resolve the issue by adding a file content Type like this. I would suggest that it should be updated on the documentations if contentType is a required field or ParseFile |
I am on the latest release of Parse Server (2.2.12), and I am still getting this (or a similar) error. Only now, the message changes to
The additional bits of Original line (in FileRouter.js): Modified to: My Method that creates and tries to save the parsefile: `var uploadToParse = function(filename, vendor) {
}` |
hello, i am still getting this error in the latest version (2.2.12): Error Domain=Parse Code=130 "Could not store file." UserInfo={code=130, temporary=0, error=Could not store file., NSLocalizedDescription=Could not store file.} |
Hi, can you share your S3Adapter config and initialization line from your code? |
problem solved 👍 i had a problem in the s3 adapter |
hi @HananeAlSamrout , I have the same issue here just like you. Can you share your s3 adapter setting to me? |
@HananeAlSamrout Same here: what was the problem with the S3 adapter? |
Still have error after migration with photo upload: "Invalid file upload". Use android-parse 1.13.1 and parse-server 2.3.2. Adding Content-Type "image/png" to new ParseFile do not solve problem. Code:
EDIT: Solved, part of my code was bad:
After not sending empty byte array to server, problem was solved. |
Getting this error out of no where now. Was working fine yesterday. Error Domain=Parse Code=130 "Could not store file." UserInfo={code=130, temporary=0, error=Could not store file., NSLocalizedDescription=Could not store file.} |
#3438 I'm having the same problem with GCS Adapter |
@FeleciaGenet Did you get this resolved? I am facing this issue all of a sudden. Strangely I can upload images using IOS SDK but not working from Android. It doesn't matter if I use S3 adapter or default grid store adapter. I get 'Invalid file upload' error. Parse-server: 2.3.2 byte[] data = "Working at Parse is great!".getBytes();
|
Solved the issue by declaring parse file as lesson learned: Don't rely solely on documentation :) |
@kittuvenkat glad it worked out for you. For what it's worth, for me the issue was that I had truly run out of space on the new database. Once I upgraded my storage, the issue was resolved. |
@kittuvenkat you can help the Parse community by improving the docs 😊 |
@natanrolnik Sure. I am fairly new to parse community but will contribute what I can. Thanks for the links. |
The "Could not store file." error is occuring for me too out of nowhere after it was working perfectly for months. I'm not sure what is causing this. How would I know if I needed to update my storage? |
I have the same problem. Yesterday was working fine. |
I am using parse-android SDK 1.13.0. I am able to upload file to parse's backend.
But when i change my server endpoint to migrated end point, upload fails.
I added console logs in file.js on parse-server i found the request.body is empty.
Files.js processCreate req: [object Object] : {} : undefined
Exception message shown on client side.
Seems to be an issue on the parse-server side. The request body is found empty. I reported this issue on parse-android-sdk. Since the sdk could upload to parse hosted backend. Suspect is on the parse-server side.
The text was updated successfully, but these errors were encountered: