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

If DB has multiple GeoPoints allowed by older ParseServer then newer ParseServer version won #3838

Closed
kross50 opened this issue May 20, 2017 · 10 comments

Comments

@kross50
Copy link

kross50 commented May 20, 2017

Issue Description

Newer ParseServer validation won't allow add/deletion of columns if multiple GeoPoints exist.

An older version of ParseServer allowed me [through a bug] to add multiple GeoPoints to a table [which is no longer supported]. The newer version of ParseServer has validation to prevent this. The problem is that because this condition of already having multiple GeoPoints exists, the newer ParseServer validation won't let me delete the additional GeoPoint columns so that I can get back to only having 1 GeoPoint column. (I currently have a total of 3 GeoPoint columns.) Furthermore, I can't make any additions or deletions for other columns because of this validation kicking in.

Steps to reproduce

  1. already have a table with 3 GeoPoints
  2. try to add or delete any column (especially trying to delete GeoPoint columns so there is only 1 again)
    • 2a Select table
    • 2b Edit (top-right)
    • 2c Delete a column (menu option)
    • 2e Select any 1 of 3 existing GeoPoint columns in list (or any column)
    • 2f Click Remove column (button)
  3. operation fails with no visual feedback but with the error in log:

{"error":{"code":111,"message":"currently, only one GeoPoint field may exist in an object. Adding physicalAddressGeoPoint when approvedUsageLocation already exists."},"level":"error","message":"Error generating response. ParseError {\n code: 111,\n message: 'currently, only one GeoPoint field may exist in an object. Adding physicalAddressGeoPoint when approvedUsageLocation already exists.' }","timestamp":"2017-05-20T15:54:19.615Z"}

Expected Results

For columns to be deleted or added.

Actual Outcome

Nothing happens after clicking confirm . Error gets posted to log.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.8 (on ParseDashboard 1.0.25)
    • Operating System: Azure
    • Hardware: Azure (2 core x 3.5GB ram)
    • Localhost or remote server? Azure
  • Database

    • MongoDB version: Azure DocumentDB/CosmosDB
    • Storage engine: Azure DocumentDB/CosmosDB
    • Hardware: Azure DocumentDB/CosmosDB
    • Localhost or remote server? Azure

Logs/Trace

{"error":{"code":111,"message":"currently, only one GeoPoint field may exist in an object. Adding physicalAddressGeoPoint when approvedUsageLocation already exists."},"level":"error","message":"Error generating response. ParseError {\n code: 111,\n message: 'currently, only one GeoPoint field may exist in an object. Adding physicalAddressGeoPoint when approvedUsageLocation already exists.' }","timestamp":"2017-05-20T15:54:19.615Z"}

@flovilmart
Copy link
Contributor

Multiple geopoint indexes are not supported by mongodb itself (2d index) not sure how you managed to get multiple geo indexes.

@kross50
Copy link
Author

kross50 commented May 20, 2017

Thank you for replying back so quickly!!!! My question is how do I fix this issue since the parse-server/parse-dashboard UI isn't letting me? Is there some modification I can make at a lower lever or can I temporarily disable this validation?

@flovilmart
Copy link
Contributor

Go into the mongodb database, and drop the column definition in the _Schema, I'm really not sure how you ended up in that situation

@kross50
Copy link
Author

kross50 commented May 20, 2017

I'm using Azure DocumentDB/CosmosDB. I'm not sure how to modify a collection directly.

@kross50
Copy link
Author

kross50 commented May 20, 2017

The old Parse.com allowed me to do this if you were curious how this happened. Then I imported all the tables into Azure Managed Parse with it like this.

@flovilmart
Copy link
Contributor

Nah, the old parse-server never allowed to add 2 geopoints in the same class: http://docs.parseplatform.org/ios/guide/#caveats

This section was valid on parse.com and is still valid now.

@kross50
Copy link
Author

kross50 commented May 20, 2017

Someone else in a post said that a bug unknowingly allowed them to do it which is probably what happened to me. That aside, how do i fix it. I cleared the values in the single record. But somewhere else maybe in parse-server that column definition is still being held since the backend is a JSON documentDB. Where do I find how to delete the definition of this column that is no longer in the stored document?

@flovilmart
Copy link
Contributor

In the _Schema collection

@kross50
Copy link
Author

kross50 commented May 21, 2017

I don't see such a collection in Azure DocumentDB. Any ideas?

@flovilmart
Copy link
Contributor

That's odd the _Schema collection is what ensures the types on your class fields.

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