{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/2383","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/2383/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/2383/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/2383/events","html_url":"https://github.com/IQSS/dataverse/issues/2383","id":96399402,"number":2383,"title":"Migrated dataset contains handle and no doi: some datasets migrated with unregistered handles and no doi","user":{"login":"sbarbosadataverse","id":8322346,"avatar_url":"https://avatars.githubusercontent.com/u/8322346?v=3","gravatar_id":"","url":"https://api.github.com/users/sbarbosadataverse","html_url":"https://github.com/sbarbosadataverse","followers_url":"https://api.github.com/users/sbarbosadataverse/followers","following_url":"https://api.github.com/users/sbarbosadataverse/following{/other_user}","gists_url":"https://api.github.com/users/sbarbosadataverse/gists{/gist_id}","starred_url":"https://api.github.com/users/sbarbosadataverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbarbosadataverse/subscriptions","organizations_url":"https://api.github.com/users/sbarbosadataverse/orgs","repos_url":"https://api.github.com/users/sbarbosadataverse/repos","events_url":"https://api.github.com/users/sbarbosadataverse/events{/privacy}","received_events_url":"https://api.github.com/users/sbarbosadataverse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Migration","name":"Component: Migration","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20UX%20&%20Upgrade","name":"Component: UX & Upgrade","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Priority:%20Critical","name":"Priority: Critical","color":"ff9900"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Type:%20Bug","name":"Type: Bug","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"sekmiller","id":2364928,"avatar_url":"https://avatars.githubusercontent.com/u/2364928?v=3","gravatar_id":"","url":"https://api.github.com/users/sekmiller","html_url":"https://github.com/sekmiller","followers_url":"https://api.github.com/users/sekmiller/followers","following_url":"https://api.github.com/users/sekmiller/following{/other_user}","gists_url":"https://api.github.com/users/sekmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/sekmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sekmiller/subscriptions","organizations_url":"https://api.github.com/users/sekmiller/orgs","repos_url":"https://api.github.com/users/sekmiller/repos","events_url":"https://api.github.com/users/sekmiller/events{/privacy}","received_events_url":"https://api.github.com/users/sekmiller/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-07-21T19:31:56Z","updated_at":"2015-07-24T15:25:10Z","closed_at":null,"body":"Libbie contacted us about one dataset in particular that she could not publish. She received both \"unregistered handle and publishing dataset\" message when she selected to \"publish\" but neither  the \"registration\"  or \"publishing\" function worked. \r\n\r\nStephen noticed the dataset contained a handle and no doi. We followed up with Libbie who confirmed the dataset was created on our interface and prior to 4.0 migration.\r\n\r\ndataset example:  https://dataverse.harvard.edu/dataset.xhtml?persistentId=hdl:1902.1/M474V1&version=DRAFT\r\n"},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/124558180","html_url":"https://github.com/IQSS/dataverse/issues/2383#issuecomment-124558180","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/2383","id":124558180,"user":{"login":"sekmiller","id":2364928,"avatar_url":"https://avatars.githubusercontent.com/u/2364928?v=3","gravatar_id":"","url":"https://api.github.com/users/sekmiller","html_url":"https://github.com/sekmiller","followers_url":"https://api.github.com/users/sekmiller/followers","following_url":"https://api.github.com/users/sekmiller/following{/other_user}","gists_url":"https://api.github.com/users/sekmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/sekmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sekmiller/subscriptions","organizations_url":"https://api.github.com/users/sekmiller/orgs","repos_url":"https://api.github.com/users/sekmiller/repos","events_url":"https://api.github.com/users/sekmiller/events{/privacy}","received_events_url":"https://api.github.com/users/sekmiller/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T15:25:10Z","updated_at":"2015-07-24T15:25:10Z","body":"The issue is caused by the globalIdCreateTime on the dataset being null.  The command tries to fill in the time but since the dataset doesn't have a doi protocol it fails.  The code should be updated to handle this.\r\n\r\nAs a bandaid we can manually update the global id create time which should allow them to publish.\r\n\r\nHere are two diagnostic queries and an update query to accomplish this:\r\n\r\nSelect * from dataset where authority = '1902.1'\r\nand protocol = 'hdl' \r\nand identifier = 'M474V1'; \r\n\r\nselect createtime from datasetversion where dataset_id = \r\n(Select id from dataset where authority = '1902.1'\r\nand protocol = 'hdl' \r\nand identifier = 'M474V1');\r\n\r\nupdate dataset set globalidcreatetime = (select createtime from datasetversion where dataset_id = \r\n(Select id from dataset where authority = '1902.1'\r\nand protocol = 'hdl' \r\nand identifier = 'M474V1'))\r\nwhere authority = '1902.1'\r\nand protocol = 'hdl' \r\nand identifier = 'M474V1';\r\n\r\nRun the diagnostic queries to make sure we're getting the correct dataset then run the update."}}