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

iOS Swift 403 issue in Xcode and crashes #1600

Closed
gateway opened this issue Apr 22, 2016 · 8 comments · Fixed by #7387
Closed

iOS Swift 403 issue in Xcode and crashes #1600

gateway opened this issue Apr 22, 2016 · 8 comments · Fixed by #7387
Labels
state:released Released as stable version state:released-beta Released as beta version

Comments

@gateway
Copy link

gateway commented Apr 22, 2016

Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

Parse Server running on Heroku

swift code added to AppDelegate.swift

    Parse.initializeWithConfiguration(ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) -> Void in
        configuration.server = "https://xxx.herokuapp.com/parse/" // '/' important after 'parse'
        configuration.applicationId = "xxxxx"
        configuration.clientKey = "xxx"
    }))

Code taken from Parse Server Example, and not clear if you need client key since it says its optional on the parse server git readme. (we need some clarification)

When running the code I see at the bottom of xcode

2016-04-22 12:47:00.940 xxx[8414:4911444] [Error]: Response status code was unacceptable: 403 (Code: 1, Version: 1.13.0)
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb) 

Steps to reproduce

Logs/Trace

@drew-gross
Copy link
Contributor

Could you provide some server logs from when you make this request?

@gateway
Copy link
Author

gateway commented Apr 22, 2016

I believe the issue is with images, its returning null, or 403.

Setup is Heroku running parse server 2.2.7, running the latest dashboard also on heroku, data was migrated to mlab. When clicking a link to a photo/image in the dashboard we get the aws access denied.

Tried to get on the slack channel but its not working..

@drew-gross
Copy link
Contributor

Send me your email address and I'll add you to the slack

@gateway
Copy link
Author

gateway commented Apr 22, 2016

done

@gateway
Copy link
Author

gateway commented Apr 23, 2016

Ok this took a bit to dig around and find what the issue was.

Things learned.

If you use profileImages and make a build on parse.com then build your own parse server, your iOS build will have a reference image link to parse.com which would fail. The file url was invalid which caused it to crash.

If your not refreshing your user profile at launch (we do it ever so often) and go from parse.com to your own parse server this could happen to you, its easy to resolve, delete the app off your phone and rebuild it.

Another thing is make sure your fileKey is set on the parse server, if you don't you will get access denied.

cheers to @nlutsenko for helping me debug this..

@gateway gateway closed this as completed Apr 23, 2016
@kaanselhep
Copy link

@gateway
I'm having this exact same issue and I have similar configuration to yours. Heroku and mlab for server and db.

And my files are being served from S3 - AWS. Some images load fine but some don't.
I tried deleting the app but that didn't resolve the issue. I still get 403 for only some images. Any help would be appreciated.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants