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

Server 500 error on /parse/schemas #888

Closed
rblalock opened this issue Mar 7, 2016 · 5 comments
Closed

Server 500 error on /parse/schemas #888

rblalock opened this issue Mar 7, 2016 · 5 comments
Labels
type:question Support or code-level question

Comments

@rblalock
Copy link

rblalock commented Mar 7, 2016

Environment Setup

Parse server 2.1.4
Parse Dashboard 2.0.0
Heroku, and a dev server and prod server environment

Steps to reproduce

Deployed parse server and ran parse dashboard locally. It has no problem reading the schema from the development instance I setup but when I try to hit the production server I have I don't get anything back because the parse/schemas endpoint is always a 500. I can interact with the server though and it behaves appropriately. e.g. /parse/classes/Users, etc. But the schemas endpoint fails.

The only difference I can see between the two servers in Heroku is my production server uses https and my dev one does not.

Logs/Trace

2016-03-07T14:44:55.645275+00:00 app[web.1]: Uncaught internal server error. [TypeError: type.startsWith is not a function] TypeError: type.startsWith is not a function
2016-03-07T14:44:55.645325+00:00 app[web.1]:     at Object.mongoFieldTypeToSchemaAPIType (/app/node_modules/parse-server/lib/Schema.js:315:12)
2016-03-07T14:44:55.645329+00:00 app[web.1]:     at /app/node_modules/parse-server/lib/Routers/SchemasRouter.js:49:29
2016-03-07T14:44:55.645331+00:00 app[web.1]:     at mongoSchemaAPIResponseFields (/app/node_modules/parse-server/lib/Routers/SchemasRouter.js:48:29)
2016-03-07T14:44:55.645330+00:00 app[web.1]:     at Array.reduce (native)
2016-03-07T14:44:55.645331+00:00 app[web.1]:     at mongoSchemaToSchemaAPIResponse (/app/node_modules/parse-server/lib/Routers/SchemasRouter.js:62:13)
2016-03-07T14:44:55.645332+00:00 app[web.1]:     at Array.map (native)
2016-03-07T14:44:55.645333+00:00 app[web.1]:     at /app/node_modules/parse-server/lib/Routers/SchemasRouter.js:70:20
2016-03-07T14:44:55.645337+00:00 app[web.1]:     at run (/app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:84:47)
2016-03-07T14:44:55.645338+00:00 app[web.1]:     at /app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:95:28
2016-03-07T14:44:55.645338+00:00 app[web.1]:     at flush (/app/node_modules/parse-server/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:19:5)
2016-03-07T14:44:55.645340+00:00 app[web.1]:     at process._tickDomainCallback (node.js:389:13)
2016-03-07T14:44:55.645339+00:00 app[web.1]:     at nextTickCallbackWith0Args (node.js:419:9)
2016-03-07T14:44:55.645341+00:00 app[web.1]:     at process.wrappedFunction (/app/node_modules/newrelic/lib/transaction/tracer/index.js:245:51)
@drew-gross
Copy link
Contributor

Could you provide more details about the contents of your _SCHEMA collection? It looks like it might be badly formatted.

@rblalock
Copy link
Author

rblalock commented Mar 7, 2016

Here's a dump of the schema from Mongo:
https://gist.github.com/rblalock/ae56dd513e51962740cc

Doesn't look like there's an issue from a quick glance

@drew-gross
Copy link
Contributor

The issue was due to the existence of some legacy keys from Parse.com that weren't handled by Parse Server. I've submitted a fix in #900.

nlutsenko added a commit that referenced this issue Mar 8, 2016
Handle legacy _client_permissions key in _SCHEMA. Fixes #888.
@rblalock
Copy link
Author

rblalock commented Mar 8, 2016

sweet thanks

@shariqkhan1
Copy link

I am getting a similar issue.

LOG:
error: error while sending push TypeError: type.startsWith is not a function at mongoFieldToParseSchemaField (/parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js:32:12) at /parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js:65:22 at Array.reduce (native) at mongoSchemaFieldsToParseSchemaFields (/parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js:64:29) at mongoSchemaToParseSchema (/parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js:91:13) at Array.map (native) at /parse/node_modules/parse-server/lib/Adapters/Storage/Mongo/MongoSchemaCollection.js:183:24 at run (/parse/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:89:22) at /parse/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:102:28 at flush (/parse/node_modules/babel-polyfill/node_modules/core-js/modules/_microtask.js:18:9)

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
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

4 participants