{"action":"created","issue":{"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378","repository_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs","labels_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378/comments","events_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378/events","html_url":"https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378","id":320042505,"number":378,"title":"got error: Caught Error: { AskSdk.DynamoDbPersistenceAdapter Error: Could not save item (amzn1.ask.account.....) to table (InternetArchiveSessions): The parameter cannot be converted to a numeric value: NaN","user":{"login":"hyzhak","id":184706,"avatar_url":"https://avatars1.githubusercontent.com/u/184706?v=4","gravatar_id":"","url":"https://api.github.com/users/hyzhak","html_url":"https://github.com/hyzhak","followers_url":"https://api.github.com/users/hyzhak/followers","following_url":"https://api.github.com/users/hyzhak/following{/other_user}","gists_url":"https://api.github.com/users/hyzhak/gists{/gist_id}","starred_url":"https://api.github.com/users/hyzhak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyzhak/subscriptions","organizations_url":"https://api.github.com/users/hyzhak/orgs","repos_url":"https://api.github.com/users/hyzhak/repos","events_url":"https://api.github.com/users/hyzhak/events{/privacy}","received_events_url":"https://api.github.com/users/hyzhak/received_events","type":"User","site_admin":false},"labels":[{"id":907548675,"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/labels/2.x.x","name":"2.x.x","color":"b60205","default":false},{"id":907548194,"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/labels/response%20needed","name":"response needed","color":"a943d8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-05-03T19:05:17Z","updated_at":"2018-05-03T22:55:48Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n- [ ] Regression (a behavior that used to work and stopped working in a new release)\r\n- [x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n- [ ] Performance issue\r\n- [ ] Feature request\r\n- [ ] Documentation issue or request\r\n- [ ] Other... Please describe:\r\n\r\n## Expected Behavior\r\nI'm trying to save alexa skill state to DynamoDB session table and usually it works.\r\n``` javascript\r\nconst persistentAttributes = {\"id\":\"amzn1.ask.account.AESW4Y2T3NOFH6AFOZRROM46HVP7RXZWITXM4HFDY2G72UTHWQOJRWBPH26T7NHIGKF7NHYZQVAQUXCZSMHH3NL7L5CSBAFWGCZRBMDCYI5U5MB7BP2UCUWYOPD2IDAVLVOMLLFRF6LE4UPFBSNV43JLCMMS2DP3NFS7CRDH2SC5DFJETU6KSANDZ2G6CCHXEXE4CGF2CFQFHRA\",\"attributes\":{\"amzn1.ask.device.AHDIDEBSPA33HUZNNIBVHB6SREOR26JVMCTUR6SQZDTTDXONVZNGU3GG2HFOABJZIRFUJUMEJTKRSKZ7YC7BKGOMQVWFNBJSS35Y2DSZUEOBNPKQPWSJTM6PJOKSBBLG667ZDKIQRH3GFA5NZXES3HP5SNNQ\":{\"fsm\":{\"state\":\"playback\"},\"dialog\":{\"lastPhrase\":{\"speech\":\"You've selected 78s. What genre of music would you like to listen to? Please select a topic like Jazz, Instrumental or Dance?\",\"suggestions\":[\"Jazz\",\"Instrumental\",\"Dance\"],\"reprompt\":null}},\"query\":{\"values\":{\"collectionId\":\"georgeblood\",\"order\":\"random\",\"subject\":\"dance\"}},\"playlist\":{\"feederName\":\"albums-async\",\"extra\":{\"cursor\":{\"current\":{\"album\":0,\"song\":0},\"total\":{\"songs\":1,\"albums\":1358}}},\"current\":0,\"items\":[{\"filename\":\"02 - Blossom Time Waltzes - Sigmund Romberg and his Orchestra.mp3\",\"title\":\"Blossom Time Waltzes\",\"audioURL\":\"https://archive.org/download/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410/02%20-%20Blossom%20Time%20Waltzes%20-%20Sigmund%20Romberg%20and%20his%20Orchestra.mp3\",\"collections\":[\"78rpm\",\"78rpm_mcneil\",\"georgeblood\",\"audio_music\"],\"coverage\":\"USA\",\"creator\":[\"Sigmund Romberg and his Orchestra\",\"Lehar\",\"Dorothy Donnelly\",\"Schubert\",\"Berte\",\"Sigmund Romberg\",\"Ziehrar\",\"Romberg\",\"Oscar Hammerstein, II\",\"Johann Strauss, Jr.\",\"Harbach\",\"Hammerstein II\",\"Mandel\"],\"imageURL\":\"https://archive.org/services/img/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"suggestions\":[\"Next\"],\"album\":{\"id\":\"78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"title\":\"Waltzing with Romberg\"},\"track\":2,\"year\":null},{\"filename\":\"01 - The Merry Widow Waltzes - Sigmund Romberg and his Orchestra.mp3\",\"title\":\"The Merry Widow Waltzes\",\"audioURL\":\"https://archive.org/download/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410/01%20-%20The%20Merry%20Widow%20Waltzes%20-%20Sigmund%20Romberg%20and%20his%20Orchestra.mp3\",\"collections\":[\"78rpm\",\"78rpm_mcneil\",\"georgeblood\",\"audio_music\"],\"coverage\":\"USA\",\"creator\":[\"Sigmund Romberg and his Orchestra\",\"Lehar\",\"Dorothy Donnelly\",\"Schubert\",\"Berte\",\"Sigmund Romberg\",\"Ziehrar\",\"Romberg\",\"Oscar Hammerstein, II\",\"Johann Strauss, Jr.\",\"Harbach\",\"Hammerstein II\",\"Mandel\"],\"imageURL\":\"https://archive.org/services/img/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"suggestions\":[\"Next\"],\"album\":{\"id\":\"78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"title\":\"Waltzing with Romberg\"},\"track\":1,\"year\":null}]}},\"amzn1.ask.device.AHDIDEBSPA33HUZNNIBVHB6SREO4JSWUYWQFDHQ5OTFMYIG272UYLLQD4AZT3G3JJODENWL7QMM7LJXBGE7U7GTCYBJBMYWPPFNQS6YXBM6GDF7PCE5SKEY6PRAADE57JDU2GNIPOFR6KLH7ORYHQNAX6KXQ\":{\"fsm\":{\"state\":\"search-music\"},\"dialog\":{\"lastPhrase\":{\"speech\":\"You've selected 78s. What genre of music would you like to listen to? Please select a topic like Jazz, Instrumental or Dance?\",\"suggestions\":[\"Jazz\",\"Instrumental\",\"Dance\"],\"reprompt\":null}},\"playlist\":{\"current\":0,\"feederName\":\"albums-async\",\"items\":[],\"extra\":{\"cursor\":{\"current\":{\"song\":0,\"album\":0},\"total\":{\"songs\":0,\"albums\":0}}}},\"query\":{\"values\":{\"collectionId\":\"georgeblood\",\"subject\":\"droll\",\"order\":\"random\"}}}}}\r\nhandlerInput.attributesManager.setPersistentAttributes(persistentAttributes)\r\n```\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\n\r\n## Current Behavior\r\nbut sometimes (more than half of times) I'm getting error:\r\n```javascript\r\nCaught Error: { AskSdk.DynamoDbPersistenceAdapter Error: Could not save item (amzn1.ask.account......) to table (InternetArchiveSessions): The parameter cannot be converted to a numeric value: NaN\r\n    at Object.createAskSdkError (./functions/node_modules/ask-sdk-dynamodb-persistence-adapter/dist/utils/AskSdkUtils.js:22:17)\r\n    at DynamoDbPersistenceAdapter.<anonymous> (./functions/node_modules/ask-sdk-dynamodb-persistence-adapter/dist/attributes/persistence/DynamoDbPersistenceAdapter.js:173:45)\r\n    at step (./functions/node_modules/ask-sdk-dynamodb-persistence-adapter/dist/attributes/persistence/DynamoDbPersistenceAdapter.js:44:23)\r\n    at Object.throw (./functions/node_modules/ask-sdk-dynamodb-persistence-adapter/dist/attributes/persistence/DynamoDbPersistenceAdapter.js:25:53)\r\n    at rejected (./functions/node_modules/ask-sdk-dynamodb-persistence-adapter/dist/attributes/persistence/DynamoDbPersistenceAdapter.js:17:65)\r\n    at <anonymous>\r\n    at process._tickCallback (internal/process/next_tick.js:160:7) name: 'AskSdk.DynamoDbPersistenceAdapter Error' }\r\n```\r\nI don't see any long on DynamoDB side.\r\nAs well DynamoDB `setPersistentAttributes` works find in other cases.\r\n\r\nI've logged putParams from here https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/blob/2.0.x/ask-sdk-dynamodb-persistence-adapter/lib/attributes/persistence/DynamoDbPersistenceAdapter.ts#L135:\r\n```javascript javascript\r\nputParams {\"Item\":{\"id\":\"amzn1.ask.account.....\",\"attributes\":{\"amzn1.ask.device.....\":{\"fsm\":{\"state\":\"playback\"},\"dialog\":{\"lastPhrase\":{\"speech\":\"You've selected 78s. What genre of music would you like to listen to? Please select a topic like Jazz, Instrumental or Dance?\",\"suggestions\":[\"Jazz\",\"Instrumental\",\"Dance\"],\"reprompt\":null}},\"query\":{\"values\":{\"collectionId\":\"georgeblood\",\"order\":\"random\",\"subject\":\"dance\"}},\"playlist\":{\"feederName\":\"albums-async\",\"extra\":{\"cursor\":{\"current\":{\"album\":0,\"song\":0},\"total\":{\"songs\":1,\"albums\":1358}}},\"current\":0,\"items\":[{\"filename\":\"02 - Blossom Time Waltzes - Sigmund Romberg and his Orchestra.mp3\",\"title\":\"Blossom Time Waltzes\",\"audioURL\":\"https://archive.org/download/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410/02%20-%20Blossom%20Time%20Waltzes%20-%20Sigmund%20Romberg%20and%20his%20Orchestra.mp3\",\"collections\":[\"78rpm\",\"78rpm_mcneil\",\"georgeblood\",\"audio_music\"],\"coverage\":\"USA\",\"creator\":[\"Sigmund Romberg and his Orchestra\",\"Lehar\",\"Dorothy Donnelly\",\"Schubert\",\"Berte\",\"Sigmund Romberg\",\"Ziehrar\",\"Romberg\",\"Oscar Hammerstein, II\",\"Johann Strauss, Jr.\",\"Harbach\",\"Hammerstein II\",\"Mandel\"],\"imageURL\":\"https://archive.org/services/img/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"suggestions\":[\"Next\"],\"album\":{\"id\":\"78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"title\":\"Waltzing with Romberg\"},\"track\":2,\"year\":null},{\"filename\":\"01 - The Merry Widow Waltzes - Sigmund Romberg and his Orchestra.mp3\",\"title\":\"The Merry Widow Waltzes\",\"audioURL\":\"https://archive.org/download/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410/01%20-%20The%20Merry%20Widow%20Waltzes%20-%20Sigmund%20Romberg%20and%20his%20Orchestra.mp3\",\"collections\":[\"78rpm\",\"78rpm_mcneil\",\"georgeblood\",\"audio_music\"],\"coverage\":\"USA\",\"creator\":[\"Sigmund Romberg and his Orchestra\",\"Lehar\",\"Dorothy Donnelly\",\"Schubert\",\"Berte\",\"Sigmund Romberg\",\"Ziehrar\",\"Romberg\",\"Oscar Hammerstein, II\",\"Johann Strauss, Jr.\",\"Harbach\",\"Hammerstein II\",\"Mandel\"],\"imageURL\":\"https://archive.org/services/img/78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"suggestions\":[\"Next\"],\"album\":{\"id\":\"78_blossom-time-waltzes_sigmund-romberg-and-his-orchestra-lehar_gbia0020410\",\"title\":\"Waltzing with Romberg\"},\"track\":1,\"year\":null}]}},\"amzn1.ask.device.AHDIDEBSPA33HUZNNIBVHB6SREO4JSWUYWQFDHQ5OTFMYIG272UYLLQD4AZT3G3JJODENWL7QMM7LJXBGE7U7GTCYBJBMYWPPFNQS6YXBM6GDF7PCE5SKEY6PRAADE57JDU2GNIPOFR6KLH7ORYHQNAX6KXQ\":{\"fsm\":{\"state\":\"search-music\"},\"dialog\":{\"lastPhrase\":{\"speech\":\"You've selected 78s. What genre of music would you like to listen to? Please select a topic like Jazz, Instrumental or Dance?\",\"suggestions\":[\"Jazz\",\"Instrumental\",\"Dance\"],\"reprompt\":null}},\"playlist\":{\"current\":0,\"feederName\":\"albums-async\",\"items\":[],\"extra\":{\"cursor\":{\"current\":{\"song\":0,\"album\":0},\"total\":{\"songs\":0,\"albums\":0}}}},\"query\":{\"values\":{\"collectionId\":\"georgeblood\",\"subject\":\"droll\",\"order\":\"random\"}}}}},\"TableName\":\"InternetArchiveSessions\"}\r\n```\r\n\r\nActually error:\r\n> The parameter cannot be converted to a numeric value: NaN\r\n\r\ncould be more informative. Which parameter? Why it is converted to numberic value?\r\n\r\n## Your Environment\r\n* alexa-sdk@1.0.25\r\n* ask-sdk@2.0.1\r\n\r\n## Node.js and NPM Info\r\n* Node.js version used for development: v9.3.0\r\n* NPM version used for development: 5.5.1\r\n"},"comment":{"url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/comments/386461184","html_url":"https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378#issuecomment-386461184","issue_url":"https://api.github.com/repos/alexa/alexa-skills-kit-sdk-for-nodejs/issues/378","id":386461184,"user":{"login":"hyzhak","id":184706,"avatar_url":"https://avatars1.githubusercontent.com/u/184706?v=4","gravatar_id":"","url":"https://api.github.com/users/hyzhak","html_url":"https://github.com/hyzhak","followers_url":"https://api.github.com/users/hyzhak/followers","following_url":"https://api.github.com/users/hyzhak/following{/other_user}","gists_url":"https://api.github.com/users/hyzhak/gists{/gist_id}","starred_url":"https://api.github.com/users/hyzhak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyzhak/subscriptions","organizations_url":"https://api.github.com/users/hyzhak/orgs","repos_url":"https://api.github.com/users/hyzhak/repos","events_url":"https://api.github.com/users/hyzhak/events{/privacy}","received_events_url":"https://api.github.com/users/hyzhak/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T22:55:47Z","updated_at":"2018-05-03T22:55:47Z","author_association":"NONE","body":"@tianrenz sorry! It seems I have provided incorrect data, because I was used `util.inspect` to log object. But actual object has `NaN`. \r\nThus test case much simpler:\r\n\r\n```javascript\r\nhandlerInput.attributesManager.setPersistentAttributes({\r\n  value: NaN,\r\n});\r\nreturn handlerInput.attributesManager.savePersistentAttributes();\r\n```"}}
{"actor":{"display_login":"hyzhak"}}