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

query returns nothing and started printing "UserInfo={error={"code":1,"message":"Internal server error."}, NSLocalizedDescription" #3135

Closed
aksinhagit opened this issue Nov 29, 2016 · 4 comments

Comments

@aksinhagit
Copy link

aksinhagit commented Nov 29, 2016

Issue Description

[DELETE EVERYTHING ABOVE THIS LINE BEFORE SUBMITTING YOUR ISSUE]

When doing a query again the username it return correct object and all the username. But when started query against the GeoPoint it gives following error and no values.

The Class variable has : username, location member.
[i.e Query through the GeoLocation] It give Error and return no objects.

To cross check when query against the username. It worked fine.

Error msg.

2016-11-28 22:57:54.227 ParseStarterProject-Swift[75946:665166] [Error]: {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)
Error: Error Domain=Parse Code=1 "{"code":1,"message":"Internal server error."}" UserInfo={error={"code":1,"message":"Internal server error."}, NSLocalizedDescription={"code":1,"message":"Internal server error."}, code=1} [error: {"code":1,"message":"Internal server error."}, NSLocalizedDescription: {"code":1,"message":"Internal server error."}, code: 1]
2016-11-28 22:57:54.241 ParseStarterProject-Swift[75946:665171] [Error]: {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.12.0)
Error: Error Domain=Parse Code=1 "{"code":1,"message":"Internal server error."}" UserInfo={error={"code":1,"message":"Internal server error."}, NSLocalizedDescription={"code":1,"message":"Internal server error."}, code=1} [error: {"code":1,"message":"Internal server error."}, NSLocalizedDescription: {"code":1,"message":"Internal server error."}, code: 1]

1.why query on Location is not working ?
2. For testing Hardcoded the latitude and longitude but still the query return nothing.

   var query = PFQuery(className:"riderRequest")
   //query.whereKey("username", equalTo:"user1")         <<< Query against username : Working
   query.whereKey("location", nearGeoPoint:PFGeoPoint(latitude:-37, longitude:12))           <<< Query against Location : Not Working     

    var contents = [PFObject]()

    do {

    contents = try query.findObjects()

    print("List of Objects")

    print(contents)

    } catch _ {

    print("Error : No Objects")

    }

##Describe your issue in as much detail as possible.

var query = PFQuery(className:"riderRequest")
//query.whereKey("username", equalTo:"user1") <<< Query against username : Working

But query against GeoPoint is giving Above Error

query.whereKey("location", nearGeoPoint:PFGeoPoint(latitude:location.latitude, longitude:location.longitude)) <<< Query against Location : Not Working

Steps to reproduce

Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.

  1. query.whereKey("location", nearGeoPoint:PFGeoPoint(latitude:location.latitude, longitude:location.longitude))

Expected Results

Lists of Object based on Location

Actual Outcome

No Ojects Returned

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : Parse Dash 1.0.18, Server version: 2.1.6
    • Operating System: MacOs
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
  • Database

    • MongoDB version: MangoDB
    • Storage engine: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [FILL THIS OUT]

Logs/Trace

You can turn on additional logging by configuring VERBOSE=1 in your environment.

[FILL THIS OUT]

@steven-supersolid
Copy link
Contributor

steven-supersolid commented Nov 29, 2016

It looks like you are using parse-server version 2.1.6.
Want to try with a more recent version such as 2.2.25?
Also, please can you post a server log by setting VERBOSE=1

@aksinhagit
Copy link
Author

Thanks Steven.

How to update the Parse Version to 2.2.25 ?
Where to set the VERBOSE=1 ?

Following is the command using

parse-dashboard --appId myAppId --masterKey myMasterKey --serverURL "https://temp.herokuapp.com/parse" --appName myapp
The dashboard is now available at http://0.0.0.0:4040/

@aksinhagit
Copy link
Author

Hi Steven,
I have updated to parse 2.2.25 and it started working.

Is there any recent fix for Geo Query which was broken in 2.1.6 ?

@steven-supersolid
Copy link
Contributor

I'm not sure as did not work on any geo stuff myself but you could take a look at release notes for past releases: https://github.com/ParsePlatform/parse-server/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants