{"action":"created","issue":{"url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/57","labels_url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/57/comments","events_url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/57/events","html_url":"https://github.com/processone/ejabberd-contrib/issues/57","id":51999669,"number":57,"title":"mod_archive_odbc not working with postgresql","user":{"login":"teodor-pripoae","id":393437,"avatar_url":"https://avatars.githubusercontent.com/u/393437?v=3","gravatar_id":"","url":"https://api.github.com/users/teodor-pripoae","html_url":"https://github.com/teodor-pripoae","followers_url":"https://api.github.com/users/teodor-pripoae/followers","following_url":"https://api.github.com/users/teodor-pripoae/following{/other_user}","gists_url":"https://api.github.com/users/teodor-pripoae/gists{/gist_id}","starred_url":"https://api.github.com/users/teodor-pripoae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teodor-pripoae/subscriptions","organizations_url":"https://api.github.com/users/teodor-pripoae/orgs","repos_url":"https://api.github.com/users/teodor-pripoae/repos","events_url":"https://api.github.com/users/teodor-pripoae/events{/privacy}","received_events_url":"https://api.github.com/users/teodor-pripoae/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-15T15:35:40Z","updated_at":"2015-04-22T09:52:46Z","closed_at":"2015-04-22T09:52:46Z","body":"Hi,\r\n\r\nI have a setup with ejabberd 2.1.10 and postgresql 9.3. I'm using branch `2.1.x` for ejabberd-contrib. I'm getting this error when accessing archive collection over xmpp protocol.\r\n\r\n```\r\npostgresql_1 | ERROR:  date/time field value out of range: \"0000-01-01 00:00:00\" at character 172\r\npostgresql_1 | STATEMENT:  select count(*) from archive_collections where us = 'username@chat.local' and deleted = 0 and with_server = 'chat.local' and with_user = 'username' and utc >= '0000-01-01 00:00:00'  and utc < '2038-01-19 00:00:00'\r\nejabberd_1   |\r\nejabberd_1   | =ERROR REPORT==== 13-Dec-2014::08:49:48 ===\r\nejabberd_1   | E(<0.381.0>:mod_archive_odbc:2428) : failed transaction: {aborted,\r\nejabberd_1   |                                                           {{badmatch,\r\nejabberd_1   |                                                             {aborted,[]}},\r\nejabberd_1   |                                                            [{mod_archive_odbc,\r\nejabberd_1   |                                                              get_collections_links_count_tmpl,\r\nejabberd_1   |                                                              6},\r\nejabberd_1   |                                                             {mod_archive_odbc,\r\nejabberd_1   |                                                              get_collections_links,\r\nejabberd_1   |                                                              4},\r\nejabberd_1   |                                                             {mod_archive_odbc,\r\nejabberd_1   |                                                              '-process_local_iq_list/3-fun-1-',\r\nejabberd_1   |                                                              4},\r\nejabberd_1   |                                                             {ejabberd_odbc,\r\nejabberd_1   |                                                              outer_transaction,\r\nejabberd_1   |                                                              3},\r\nejabberd_1   |                                                             {ejabberd_odbc,\r\nejabberd_1   |                                                              run_sql_cmd,4},\r\nejabberd_1   |                                                             {p1_fsm,\r\nejabberd_1   |                                                              handle_msg,10},\r\nejabberd_1   |                                                             {proc_lib,\r\nejabberd_1   |                                                              init_p_do_apply,\r\nejabberd_1   |                                                              3}]}}, stack: {backtrace,\r\nejabberd_1   |                                                                             <<\"Program counter: 0x00007f50fe8261f8 (unknown function)\\nCP: 0x00007f50f548ff78 (mod_archive_odbc:run_sql_transaction/2 + 408)\\n\\n0x00007f50f5a75d90 Return addr 0x00007f50f547b208 (mod_archive_odbc:process_local_iq/3 + 656)\\ny(0)     {aborted,{{badmatch,{aborted,[]}},[{mod_archive_odbc,get_collections_links_count_tmpl,6},{mod_archive_odbc,get_collections_links,4},{mod_archive_odbc,'-process_local_iq_list/3-fun-1-',4},{ejabberd_odbc,outer_transaction,3},{ejabberd_odbc,run_sql_cmd,4},{p1_fsm,handle_msg,10},{proc_lib,init_p_do_apply,3}]}}\\n\\n0x00007f50f5a75da0 Return addr 0x00007f50fe81e660 (gen_iq_handler:process_iq/6 + 144)\\ny(0)     []\\ny(1)     {iq,\\\"1:list\\\",get,\\\"urn:xmpp:archive\\\",[],{xmlelement,\\\"list\\\",[{\\\"xmlns\\\",\\\"urn:xmpp:archive\\\"},{\\\"with\\\",\\\"username@chat.local\\\"}],[]}}\\ny(2)     []\\ny(3)     Catch 0x00007f50f547b208 (mod_archive_odbc:process_local_iq/3 + 656)\\ny(4)     {xmlelement,\\\"list\\\",[{\\\"xmlns\\\",\\\"urn:xmpp:archive\\\"},{\\\"with\\\",\\\"username@chat.local\\\"}],[]}\\n\\n0x00007f50f5a75dd0 Return addr 0x00007f50fe81eac8 (gen_iq_handler:handle_info/2 + 264)\\ny(0)     {jid,\\\"username\\\",\\\"chat.local\\\",[],\\\"username\\\",\\\"chat.local\\\",[]}\\ny(1)     {jid,\\\"usernmae\\\",\\\"chat.local\\\",\\\"bosh_3229\\\",\\\"username\\\",\\\"chat.local\\\",\\\"bosh_3229\\\"}\\ny(2)     Catch 0x00007f50fe81e660 (gen_iq_handler:process_iq/6 + 144)\\n\\n0x00007f50f5a75df0 Return addr 0x00007f50fb5354d0 (gen_server:handle_msg/5 + 1680)\\ny(0)     {state,\\\"chat.local\\\",mod_archive_odbc,process_iq}\\n\\n0x00007f50f5a75e00 Return addr 0x00007f50fb4d0350 (proc_lib:init_p_do_apply/3 + 56)\\ny(0)     gen_iq_handler\\ny(1)     {state,\\\"chat.local\\\",mod_archive_odbc,process_iq}\\ny(2)     <0.381.0>\\ny(3)     <0.208.0>\\ny(4)     {process_iq,{jid,\\\"username\\\",\\\"chat.local\\\",\\\"bosh_3229\\\",\\\"username\\\",\\\"chat.local\\\",\\\"bosh_3229\\\"},{jid,\\\"username\\\",\\\"chat.local\\\",[],\\\"username\\\",\\\"chat.local\\\",[]},{iq,\\\"1:list\\\",get,\\\"urn:xmpp:archive\\\",[],{xmlelement,\\\"list\\\",[{\\\"xmlns\\\",\\\"urn:xmpp:archive\\\"},{\\\"with\\\",\\\"username@chat.local\\\"}],[]}}}\\ny(5)     Catch 0x00007f50fb5354d0 (gen_server:handle_msg/5 + 1680)\\n\\n0x00007f50f5a75e38 Return addr 0x000000000082ad68 (<terminate process normally>)\\ny(0)     Catch 0x00007f50fb4d0370 (proc_lib:init_p_do_apply/3 + 88)\\n\">>}\r\n```"},"comment":{"url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/comments/95104458","html_url":"https://github.com/processone/ejabberd-contrib/issues/57#issuecomment-95104458","issue_url":"https://api.github.com/repos/processone/ejabberd-contrib/issues/57","id":95104458,"user":{"login":"cromain","id":743187,"avatar_url":"https://avatars.githubusercontent.com/u/743187?v=3","gravatar_id":"","url":"https://api.github.com/users/cromain","html_url":"https://github.com/cromain","followers_url":"https://api.github.com/users/cromain/followers","following_url":"https://api.github.com/users/cromain/following{/other_user}","gists_url":"https://api.github.com/users/cromain/gists{/gist_id}","starred_url":"https://api.github.com/users/cromain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cromain/subscriptions","organizations_url":"https://api.github.com/users/cromain/orgs","repos_url":"https://api.github.com/users/cromain/repos","events_url":"https://api.github.com/users/cromain/events{/privacy}","received_events_url":"https://api.github.com/users/cromain/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T09:52:45Z","updated_at":"2015-04-22T09:52:45Z","body":"ejabberd 2.1.10 is more that 3 years old. all 2.1.x branch are unmaintained.\r\nplease consider using 15.x ejabberd and use master branch of ejabberd-contrib."}}