Skip to content
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

Error displaying images from Parse-Server (Heroku/Mongolab) #170

Closed
calhouncole opened this issue Feb 2, 2016 · 13 comments
Closed

Error displaying images from Parse-Server (Heroku/Mongolab) #170

calhouncole opened this issue Feb 2, 2016 · 13 comments
Labels
type:question Support or code-level question

Comments

@calhouncole
Copy link

In my Parse database, I have several images that are called and displayed by an iOS Client. When the client is connected to the parse apis, these images display no problem. However, when connected to my own parse-server, the images don't show and the following error is logged:

[Error]: Response status code was unacceptable: 403 (Code: 1, Version: 1.12.0)
Error Domain=Parse Code=1 "Response status code was unacceptable: 403" UserInfo={error=Response status code was unacceptable: 403, NSLocalizedDescription=Response status code was unacceptable: 403, code=1}

All other queries work just fine. I'm using the heroku/mongolab stack described in the migration tutorial. I've also successfully migrated my database from Parse to mongolab.

Are there any settings that need to be changed in the Parse-Server or in mongolab? Thanks in advance!

@reinder42
Copy link

@calhouncole Did you set the fileKey in the configuration dictionary in when initializing the ParseServer instance? In parse-server-example, this happens in index.js. You can find the key in your Parse Dashboard.

@calhouncole
Copy link
Author

@reinderdevries Thanks for the tip. Seems to have worked.

Do you know if the files themselves are stored on the mongodb or does Parse store a link to the actual file in a S3?

In the migration guide, it states the following:
"fileKey: A key that specifies a prefix used for file storage. (only necessary for old files in s3 clarify this)"

If Parse is storing these files in an S3, I'm assuming I won't be able to access them after Parse's hosting service has been discontinued?

@skinp
Copy link
Contributor

skinp commented Feb 3, 2016

@calhouncole hold files that already existed before the migration are still stored in S3. We're working on a migration tool to allow you to download those to somewhere you control.

As for new files by default they're stored in Mongo (GridStoreAdapter) but you can also setup S3 using the new S3Adapter.

@skinp skinp closed this as completed Feb 3, 2016
@sanergulec
Copy link

Hi Calhouncole,

I have the same problem about displaying images in my IOS swift project. I migrated from parse to mongolab and AWS beanstalk. How can I add the fileKey? I am a bit new in coding, I tried to add the fileKey in the AWS console as in the picture below, but it didn't work. Should I also add it to the appDelegate in my ios project? Or did I added the fileKey in the AWS console wrong?

pgwyh

@calhouncole
Copy link
Author

@sanergulec -- sorry for the late response.

You need to add the fileKey to your parse-server initialization. I'm running on Heroku/mongolab and mine is as so:


var parse_api = new ParseServer({
  databaseURI: process.env.MONGOLAB_URI || 'xxxxxxx',
  cloud: './cloud/main.js',
  appId: 'xxxxxxx',
  fileKey: 'xxxxxxx',
  masterKey: 'xxxxxxx',
  serverURL: process.env.PARSE_SERVER_URL || 'http://www.xxxxx.com/parse'
});

app.use('/parse', parse_api);

@KathleenFMalone
Copy link

Hi. I am having the same problem with images, but I'm using objective-c. The configuration class is ParseMutableClientConfiguration and there is not a fileKey property on that class. Where can I declare the fileKey property. Or how can I get images to load on AWS beanstalk and mlab migration with client written in objective-c. Thanks!

@KathleenFMalone
Copy link

Sorry I misunderstood the thread above. I thought you needed to add the fileKey on the client side, but it looks like it needs to be added on the new parse server installation. I'm using AWS beanstalk like @sanergulec and there is not an option to add it there. Do you know where I do this in beanstalk? I have the same console as @sanergulec, but it looks like adding where he/she tried doesn't work.

@reinder42
Copy link

You're right, try setting it in your index.js / wherever you create the ParseServer instance, just like @calhouncole mentioned. Don't forget to add, commit and deploy your code changes.

@KathleenFMalone
Copy link

Ok, I'll look into it some more. With beanstalk, I never had to do anything with index.js. I just hit install, added app_id, database_url and master_key and everything was set up. I'll post if/when I figure it out. Thanks.

@ratan93
Copy link

ratan93 commented Oct 1, 2016

Hello Everyone,

@KathleenFMalone, were you able to solve the concern of image loading with error : [Error]: Response status code was unacceptable: 403 (Code: 1, Version: 1.14.2)

Currently I am going through this issue as recently I migrated my iOS Application from Parse Server to back4app server and getting the above error with each file download, not able to get the data. So please help me on this if you were solve the concern and guide me.

Thanks,
Ratneshwar Singh,
iOS App Developer

@jakelisby
Copy link

@ratan93 make sure your file key matches what was on Parse.com (you can update back4app if needed). This will allow you to see previous files and continue supporting both connections in the future.

@wellkeptbeauty
Copy link

Hello Everyone,

@KathleenFMalone, were you able to solve the concern of image loading with error : [Error]: Response status code was unacceptable: 403 (Code: 1, Version: 1.14.2)

Currently I am going through this issue as recently I migrated my iOS Application from Parse Server to Heroku server and getting the above error with each file download, not able to get the data. So please help me on this if you were solve the concern and guide me.

Thanks,
karthik

@mital87
Copy link

mital87 commented Feb 6, 2017

Hello Team,

I have migrated my iOS Application from Parse Server to Heroku server and getting the error with each file download, not able to get the data. Please help me to resolve this issue as soon as possible. Do needful.

Thanking You.

Best Regards,
Mital

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

10 participants