-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 fails because of "pointer to incorrect className" #3404
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
any news on this issue??
|
I cannot remember how I resolved/fixed this issue. |
Who asked ??!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somehow I have saved pointers to different classes (user and a custom class) in the same column. The query fails because the mongo transform adapter (MongoTransform.js) throws in error versus logging and dropping the column. This occurs whether or not I include the column. It also occurs whether or not I get or find.
When "found a pointer column not in the schema" and when "found a pointer in a non-pointer column" occurs the column is dropped. These pointer problems seem to be on par with "pointer to incorrect className". These issues seem like they should be treated the same.
In the mongo transform adapter I have done the following and not noticed any issues:
Commented out the throw:
Replaced the throw with
Using the above options I am able to loop through and update (or unset) the offending column data but it seems that the server should handle this more gracefully then throwing an error. Primarily because we now have multiple ways to access and damage our data. We use parse because it is so easy to implement but now we have tools to create more issues.
The offending data was last updated in April 2015. I believe I created the issue by deleting the column in the dashboard and then reusing the same column name but with a pointer to a custom class versus the user class. The column data should have been deleted but maybe not.
Parse hosted does not throw an error. In the dashboard it will even show the pointer id to the incorrect class. Clicking through to the pointer will simply show zero results.
Steps to reproduce
Run query on class that has column that contains correct and incorrect pointers. Pointers should have a class name of "Account" but older data contains class name "_User".
Good Data
Bad Data
Expected Results
Multiple results. Ideally the offending column is not even dropped.
Actual Outcome
Error because "pointer to incorrect className", see log info below. Event – ParseError {code: 1, message: undefined}.
Environment Setup
Server
Database
CURL
This curl works in parse hosted dashboard whether or not the column data pointer is to the correct class. This will not work via the local host dashboard when the data pointer is to the incorrect class.
curl -X GET
-H "X-Parse-Application-Id: Qe7OgKeblL8tZWRSr45UDRQhp9wkuN37VCabgwey"
-H "X-Parse-Master-Key: cjHVcef0CeJNLNwyfHmG4JgdIp846i0zxyOsHHFv"
-G
--data-urlencode "where={"objectId":"p4cGpGJ7U3"}"
https://api.parse.com/1/classes/Event
Logs/Trace
verbose: REQUEST for [GET] /parse/classes/Event: {
"where": {},
"limit": 10
} method=GET, url=/parse/classes/Event, host=localhost:1337, pragma=no-cache, accept=/, accept-language=en-us, accept-encoding=gzip, deflate, cache-control=no-cache, content-type=text/plain, origin=http://localhost:1337, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/604.1.2 (KHTML, like Gecko) Version/10.2 Safari/604.1.2, referer=http://localhost:1337/main, content-length=236, connection=keep-alive, cookie=pnctest=1, , limit=10
error: Error generating response. 'pointer to incorrect className' error=pointer to incorrect className
error: Uncaught internal server error. pointer to incorrect className
pointer to incorrect className
Suggestion
Potentially allow the enabling of "unsafe" queries in development mode so that the data can be returned and easily inspected to find the errors. I had a similar issue with invalid dates last week. I am not sure if there is a good reason to throw this error but if there is an error of this type and you do not have access to the adapter you are essentially out of luck if you need to fix the data. If the problem requires a patch and you are using a service such as Sashido or Nodechef you may need to wait until they have time to implement a patch. If you have a live product this could be crippling to your users.
The text was updated successfully, but these errors were encountered: