-
Notifications
You must be signed in to change notification settings - Fork 50
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
Non-GET requests logging errors #21
Comments
Some other observations, the same code works fine in a linux environment (ubuntu or redhat), but it fails in the way illustrated above in windows. Curiously I get some msbuild errors when npm install is executed. The error states that visual studio c++ 2010 tools could not be found. I have visual studio c++ 2015 tools installed. `> [email protected] install C:\dev\workspace\oeh-assmt-mgmt\node_modules\ursa
C:\dev\workspace\oeh-assmt-mgmt\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) |
Ok, found the root cause of the issue. On windows, the methods are exposed with incorrect paths, as shown in a print-out of the app._router.stack object: Layer { Note the use of backslashes in the regexp and Route objects. I ran the process with the debugger enabled and manually overrode the generated paths in exposeList.js / exposeLists function such that that paths utilise forward slashes and this resolved the issue! The issue appears to be in the use of the path object on line 14 in exposeLists.js. The API indicates that this method joins strings together using the platform specific separate which in the case of Windows is a backslash (). |
I have an un-usual situation where all non-get requests against models are returning 500 internal server error.
The error in the log is:
error: undefined error: Unknown keystone list "api" error: ReferenceError: Unknown keystone list "api" at list (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\lib\core\list.js:12:18) at C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\lib\core\routes.js:55:24 at Layer.handle [as handle_request] (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\layer.js:95:5) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:131:13) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) at next (C:\dev\workspace\oeh-assmt-mgmt\node_modules\keystone\node_modules\express\lib\router\route.js:125:14) POST /keystone/api/assessments 500 97.558 ms
Some snippets from how I configured restful keystone:
restful.expose({ Assessment: { methods: true } })
I also have a couple of keystone "pre" middleware configured for the purposes of token verification and logging.
Some keystone config:
`{
}`
The GET request works fine:
GET /keystone/api/assessments
{ "results": [ { "id": "57d90b0dd55cf37c28e7d56b", "name": "57d90b0dd55cf37c28e7d56b", "fields": { "caseid": "1", "version": "1", "organisation": "envirokey", "blob": "{\"sdfsdf\": \"sdfsdfsdf\", \"32432\": true}" } } ], "count": 1 }
The POST request doesnt:
POST /keystone/api/assessments
The text was updated successfully, but these errors were encountered: