{"action":"created","issue":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/4999","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/4999/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/4999/comments","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/4999/events","html_url":"https://github.com/rapid7/metasploit-framework/issues/4999","id":64074577,"number":4999,"title":"db_nmap command save directive references a nonexistent myworkspace variable","user":{"login":"sempervictus","id":1331084,"avatar_url":"https://avatars.githubusercontent.com/u/1331084?v=3","gravatar_id":"","url":"https://api.github.com/users/sempervictus","html_url":"https://github.com/sempervictus","followers_url":"https://api.github.com/users/sempervictus/followers","following_url":"https://api.github.com/users/sempervictus/following{/other_user}","gists_url":"https://api.github.com/users/sempervictus/gists{/gist_id}","starred_url":"https://api.github.com/users/sempervictus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sempervictus/subscriptions","organizations_url":"https://api.github.com/users/sempervictus/orgs","repos_url":"https://api.github.com/users/sempervictus/repos","events_url":"https://api.github.com/users/sempervictus/events{/privacy}","received_events_url":"https://api.github.com/users/sempervictus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/library","name":"library","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-24T19:04:35Z","updated_at":"2015-03-24T19:41:50Z","closed_at":null,"body":"Example:\r\n```\r\n[*] Nmap: Host is up (0.033s latency).\r\n[*] Nmap: Nmap done: 1 IP address (1 host up) scanned in 1.06 seconds\r\n[-] Error while running command db_nmap: undefined method `workspace' for #<Msf::Ui::Console::CommandDispatcher::Db:0x0000000392b488>\r\n\r\nCall stack:\r\n/opt/metasploit4/msf4/lib/msf/core/auxiliary/report.rb:58:in `myworkspace'\r\n/opt/metasploit4/msf4/lib/msf/core/auxiliary/report.rb:154:in `report_note'\r\n/opt/metasploit4/msf4/lib/msf/core/auxiliary/report.rb:456:in `store_local'\r\n/opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/db.rb:1928:in `report_store_local'\r\n/opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/db.rb:1878:in `block in cmd_db_nmap'\r\n```\r\nWhen there is no current module context, there is no myworkspace variable, and bad things happen.\r\nMy quick hack was to refence myworkspace as framework.db.workspace from the command dispatcher, but i figure there's a more elegant solution buried in the DB changes i've not caught up on.\r\n\r\n@wvu-r7: This is what i mention in #4995 "},"comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments/85664610","html_url":"https://github.com/rapid7/metasploit-framework/issues/4999#issuecomment-85664610","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/4999","id":85664610,"user":{"login":"wvu-r7","id":4551878,"avatar_url":"https://avatars.githubusercontent.com/u/4551878?v=3","gravatar_id":"","url":"https://api.github.com/users/wvu-r7","html_url":"https://github.com/wvu-r7","followers_url":"https://api.github.com/users/wvu-r7/followers","following_url":"https://api.github.com/users/wvu-r7/following{/other_user}","gists_url":"https://api.github.com/users/wvu-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wvu-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvu-r7/subscriptions","organizations_url":"https://api.github.com/users/wvu-r7/orgs","repos_url":"https://api.github.com/users/wvu-r7/repos","events_url":"https://api.github.com/users/wvu-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wvu-r7/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T19:41:50Z","updated_at":"2015-03-24T19:41:50Z","body":"Can you provide more details?"}}