parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

S3 Files Uploaded by Parse Server Inaccessible to api.parse.com clients

Open benishak opened this issue 10 years ago • 34 comments

We migrated our database before the deadline, it is working fine, We are hosting now ParseServer on our server and want to use it, we will release a new version of our iOS App that points to our ParseServer. People using the new version of the App won't see any problem, but the user who still using the older version, won't be able to see the new data stored on our own S3.

Are you going to release a tool that can solve this problem ? something like configuration in the dashboard where we can configure a Storage Adapter?

Files Migration is in itself no problem, we can go through all files and copy them to our own S3, it is all about users who use our old version can see the objects uploaded to the new S3.

How fast do you think we are going to see this problem solved?

benishak avatar Apr 21 '16 13:04 benishak

I'm not sure (and I may be wrong) about that problem. Your newly stored files should be publicly accessible and the URL's for the new files on your S3 will be stored in your DB alongside the old ones. So given that, as long as your files are properly uploaded to S3, an 'old' client would just get the new URL, pointing to your S3. Is it an issue you're seeing now?

flovilmart avatar Apr 21 '16 13:04 flovilmart

The current situation now, the users who are using the app that point to parse.com are not able to see files stored in our DB or our S3 because the look like this

http://files.parsetfss.com/$filekey/$filename

and not like this

https://api.parse.com/files/$appid/$filename // if file is stored in the DB

or am I wrong?

benishak avatar Apr 21 '16 15:04 benishak

that should not matter as the File objects store the full URL. Are your newly stored files accessible via your web browser?

flovilmart avatar Apr 21 '16 15:04 flovilmart

no because it forward me to http://files.parsetfss.com

benishak avatar Apr 21 '16 15:04 benishak

for the new files? How did you configure the S3 Adapter?

flovilmart avatar Apr 21 '16 15:04 flovilmart

The old App uses : api.parse.com The new App uses: api.ourparseServer.com

People using the "new App" can see files hosted on our S3 because we configured our S3Adapter and also the files hosted on Parse S3 ('ttfs')

But lets assume not all users upgrade the App so some users who use OLD APP, which use api.parse.com are not able to see or access object upload to our OUR S3

benishak avatar Apr 21 '16 15:04 benishak

This is a known issue. api.parse.com has no knowledge of your specific Parse Server configuration, it only knows about files.parsetfss.com and files.parse.com. If Parse Server stores only the filename, api.parse.com will assume it is being hosted on files.parse.com and it will return a files.parse.com URL, which expectedly will fail to load the resource.

hramos avatar Apr 21 '16 19:04 hramos

Don't we store the full URL if not, that's a big deal

flovilmart avatar Apr 21 '16 21:04 flovilmart

My understanding is that only a filename is stored in the database, and it is up to the file adapter to look up the static asset or construct the direct URL when direct access is enabled.

See https://github.com/parse-server-modules/parse-server-s3-adapter/blob/master/index.js#L144 as reference.

hramos avatar Apr 21 '16 21:04 hramos

Ok is Parse.com working on any solution or a tool on the dashboard that allow us to configure our own S3 or any kind of solutions? If yes how long will it take to see something?

benishak avatar Apr 21 '16 21:04 benishak

We're heads down on database migration tasks at the moment. Improving the file migration story is something we have on our sights as we enter Phase 2 on April 28. No promises but this seems something that would be useful to look into.

See #8 and #1521 for related issues.

hramos avatar Apr 21 '16 22:04 hramos

That Would be fairly Easy to make sure we store the full URL's. I believe the controller asks the adapter for the custom location, so it should in that case be stored as a full URL. I'll have a look.

flovilmart avatar Apr 22 '16 00:04 flovilmart

@benishak any luck?

kvreem avatar May 17 '16 22:05 kvreem

When using the default file grid adapter or amazon s3 older versions of the app cannot see the newly uploaded files. Users on new versions can see both. Did anyone figure a workaround or managed to get it working on grid adapter? Was surprised when the default adapter wasnt working either.

kvreem avatar May 18 '16 03:05 kvreem

i have the same problem too, old users cannot see new file upload with the default file grid adapter, that's a real big problem.

MattiaConfalonieri avatar May 18 '16 13:05 MattiaConfalonieri

As @Kkhattab @MattiaConfalonieri pointed out, this issue is holding us from going production with the new hosted Parse Server.

kkgelu avatar May 25 '16 10:05 kkgelu

We pop up a dialog asking people to upgrade app and we will not support this version anymore and they will notice that

benishak avatar May 25 '16 10:05 benishak

@kkgelu same here, this have nonsense... the migration term suggested is 28th July... how we can do that?

@benishak not very elegant, but this is a solution... the only one at the moment...

MattiaConfalonieri avatar May 25 '16 10:05 MattiaConfalonieri

Yeah unfortunately. ..

benishak avatar May 25 '16 10:05 benishak

The MongoDB only keeps the file name, it has no knowledge about where the file system is.

Somehow the new server knows where the old files are, probably by prefix.

The problem is to let the Parse.com Server understand the new files. We have no way to upgrade api.parse.com but the Parse team.

kkgelu avatar May 25 '16 10:05 kkgelu