{"id":7067,"date":"2014-05-19T04:11:39","date_gmt":"2014-05-19T04:11:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/casterror-cast-to-objectid-failed-for-value-21trt5sdsdesd111521-at-path-userstories-collection-of-common-programming-errors\/"},"modified":"2014-05-19T04:11:39","modified_gmt":"2014-05-19T04:11:39","slug":"casterror-cast-to-objectid-failed-for-value-21trt5sdsdesd111521-at-path-userstories-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/19\/casterror-cast-to-objectid-failed-for-value-21trt5sdsdesd111521-at-path-userstories-collection-of-common-programming-errors\/","title":{"rendered":"CastError: Cast to ObjectId failed for value &ldquo;21trt5sdsdesd111521&rdquo; at path &#8220;userStories-Collection of common programming errors"},"content":{"rendered":"<p>Hi i am installing an application on stackato, I got following error:<\/p>\n<p>2014-03-07T03:30:44-0800 staging: \/staging\/staged\/app\/node_modules\/mongoose\/lib\/utils.js:419 2014-03-07T03:30:44-0800 staging: throw err; 2014-03-07T03:30:44-0800 staging: ^ 2014-03-07T03:30:44-0800 staging: CastError: Cast to ObjectId failed for value &#8220;21trt5sdsdesd111521&#8221; at path &#8220;userStories&#8221; 2014-03-07T03:30:44-0800 staging: at ObjectId.cast (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/schema\/objectid.js:116:13) 2014-03-07T03:30:44-0800 staging: at Array.MongooseArray._cast (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/types\/array.js:108:30) 2014-03-07T03:30:44-0800 staging: at Object.map (native) 2014-03-07T03:30:44-0800 staging: at Array.MongooseArray.push (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/types\/array.js:262:23) 2014-03-07T03:30:44-0800 staging: at Promise.createProjectByDefault (\/staging\/staged\/app\/tools\/setup-db-demo.js:234:25) 2014-03-07T03:30:44-0800 staging: at Promise.onResolve (\/staging\/staged\/app\/node_modules\/mongoose\/node_modules\/mpromise\/lib\/promise.js:162:8) 2014-03-07T03:30:44-0800 staging: at Promise.EventEmitter.emit (events.js:96:17) 2014-03-07T03:30:44-0800 staging: at Promise.emit (\/staging\/staged\/app\/node_modules\/mongoose\/node_modules\/mpromise\/lib\/promise.js:79:38) 2014-03-07T03:30:44-0800 staging: at Promise.fulfill (\/staging\/staged\/app\/node_modules\/mongoose\/node_modules\/mpromise\/lib\/promise.js:92:20) 2014-03-07T03:30:44-0800 staging: at Query.findOne (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/query.js:1784:30) 2014-03-07T03:30:44-0800 stackato.stager: Completed staging application &#8216;jat&#8217;<\/p>\n<p>Below is the portion of the code where it makes reference<\/p>\n<pre><code>    var story1 = new userStoryModel ({\n        id          : '21trt5sdsdesd111521',\n        project     : reg.id,\n        title       : 'Moving a US from the Current to Done',\n        storyType   : 'Feature',\n        points      : '5',\n        isEstimated : true,\n        requester   : player2.id,\n        owner       : player1.id,\n        description : 'test test test.',\n        task        : []\n    });\n<\/code><\/pre>\n<p>Any ideas why is not working ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi i am installing an application on stackato, I got following error: 2014-03-07T03:30:44-0800 staging: \/staging\/staged\/app\/node_modules\/mongoose\/lib\/utils.js:419 2014-03-07T03:30:44-0800 staging: throw err; 2014-03-07T03:30:44-0800 staging: ^ 2014-03-07T03:30:44-0800 staging: CastError: Cast to ObjectId failed for value &#8220;21trt5sdsdesd111521&#8221; at path &#8220;userStories&#8221; 2014-03-07T03:30:44-0800 staging: at ObjectId.cast (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/schema\/objectid.js:116:13) 2014-03-07T03:30:44-0800 staging: at Array.MongooseArray._cast (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/types\/array.js:108:30) 2014-03-07T03:30:44-0800 staging: at Object.map (native) 2014-03-07T03:30:44-0800 staging: at Array.MongooseArray.push (\/staging\/staged\/app\/node_modules\/mongoose\/lib\/types\/array.js:262:23) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7067","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7067"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7067\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}