<div dir="ltr"><div>I believe I tracked this down to a time conversion bug in the Python API. <br><br></div>In the capture, the query for the recid 20160421070000 returns start time of 1461222000. The DELETE command is sending back a start time of 1461220200. The time of offset by 1800s or 30min. I'm running the script from the same machine as the backend. I can't really figure out why the time would shift 30min, but there must be some strange conversion happening between the QUERY and conversion back to prog.toString().<br><div><br>Maybe Raymond W. can help since it looks like he's worked on a few of these tickets. I'm not running the latest backend. Is it safe to run the latest Python bindings without changing the backend?<br><br></div><div>Casey<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Apr 23, 2016 at 4:18 PM Casey McGinty <<a href="mailto:casey.mcginty@gmail.com">casey.mcginty@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I'm trying to create a tool that undeletes a recording. I have the following code working, except the backend does not actually perform the action<b>, even though it logs the undelete event, and return code is 0 (i.e. success)</b>. Can anyone explain why this isn't working? I've even been using tcpdump to compare against a working client and the command looks almost identical.<br><br></div>code sample:<br><br></div><div>def undelete(rec):
    <br>    prog = Program.fromRecorded(rec)
    <br>    cmd = BACKEND_SEP.join(['UNDELETE_RECORDING', prog.toString()])
    <br>    res = BE.backendCommand(cmd)
    <br>    if int(res) != 0:
        <br></div><div>        raise MythBEError("undelete failed")<br><br></div><div>The TCP capture is:<br><br>14:29:00.447240 IP gandalf.local.33900 > gandalf.local.6543: Flags [P.], seq 124:176, ack 294442, win 3637, options [nop,nop,TS val 59730401 ecr 59729698], length 52
E..h~.@.@.:~.........l...8...+.....5.......
..i...g"44      QUERY_RECORDING TIMESLOT 3101 20160421070000
<br>14:29:00.447290 IP gandalf.local.6543 > gandalf.local.33900: Flags [.], ack 176, win 342, options [nop,nop,TS val 59730401 ecr 59730401], length 0
E..47.@.@..............l.+...8.....V.......
..i...i.
<br>14:29:00.450204 IP gandalf.local.6543 > gandalf.local.33900: Flags [P.], seq 294442:294991, ack 176, win 342, options [nop,nop,TS val 59730402 ecr 59730401], length 549
E..Y7.@.@..............l.+...8.....V.......
..i...i.541     OK[]:[]NOVA[]:[]Wild Ways[]:[]Newly established wildlife corridors offer hope to endangered species around the world.[]:[]0[]:[]0[]:[]4311[]:[]Science[]:[]3101[]:[]10_1[]:[]KMEB-HD[]:[]KMEB-HD[]:[]3101_20160421070000.mpg[]:[]6259832428[]:[]1461222000[]:[]1461225600[]:[]0[]:[]gandalf[]:[]0[]:[]0[]:[]0[]:[]0[]:[]-3[]:[]99[]:[]0[]:[]15[]:[]6[]:[]1461222000[]:[]1461225630[]:[]5[]:[]Deleted[]:[][]:[]EP00003163[]:[]EP000031630871[]:[][]:[]1461415115[]:[]0[]:[]2016-04-20[]:[]Default[]:[]0[]:[]0[]:[]Default[]:[]1[]:[]19[]:[]1[]:[]0[]:[]0[]:[]0
<br>14:29:00.454521 IP gandalf.local.33900 > gandalf.local.6543: Flags [P.], seq 176:748, ack 294991, win 3979, options [nop,nop,TS val 59730403 ecr 59730402], length 572
E..p~.@.@.8u.........l...8...+.............
..i...i.564     UNDELETE_RECORDING[]:[]NOVA[]:[]Wild Ways[]:[]Newly established wildlife corridors offer hope to endangered species around the world.[]:[]0[]:[]0[]:[]4311[]:[]Science[]:[]3101[]:[]10_1[]:[]KMEB-HD[]:[]KMEB-HD[]:[]3101_20160421070000.mpg[]:[]6259832428[]:[]1461220200[]:[]1461223800[]:[]0[]:[]gandalf[]:[]0[]:[]0[]:[]0[]:[]0[]:[]-3[]:[]99[]:[]0[]:[]15[]:[]6[]:[]1461220200[]:[]1461223830[]:[]5[]:[]Deleted[]:[][]:[]EP00003163[]:[]EP000031630871[]:[][]:[]1461413315[]:[]0.000000[]:[]2016-04-20[]:[]Default[]:[]0[]:[]0[]:[]Default[]:[]1[]:[]19[]:[]1[]:[]0[]:[]0[]:[]0
<br>14:29:00.458981 IP gandalf.local.6543 > gandalf.local.33900: Flags [P.], seq 294991:295000, ack 748, win 351, options [nop,nop,TS val 59730404 ecr 59730403], length 9
E..=7.@.@..............l.+...8.?..._.......
..i...i.1       0
<br>14:29:00.479246 IP gandalf.local.33900 > gandalf.local.6543: Flags [P.], seq 748:760, ack 295000, win 3979, options [nop,nop,TS val 59730409 ecr 59730404], length 12
E..@~.@.@.:..........l...8.?.+.............
..i...i.4       DONE
<br></div><div><br></div><div>I also get the exact same log output from the backend as I do when the command is runs correctly in my frontend:<br><br>Apr 23 16:13:25 gandalf mythbackend: mythbackend[10514]: I ProcessRequest mainserver.cpp:1420 (HandleAnnounce) MainServer::ANN Monitor
<br>Apr 23 16:13:25 gandalf mythbackend: mythbackend[10514]: I ProcessRequest mainserver.cpp:1422 (HandleAnnounce) adding: gandalf as a client (events: 0)
<br>Apr 23 16:13:27 gandalf mythbackend: mythbackend[10514]: I Scheduler scheduler.cpp:2098 (HandleReschedule) Reschedule requested for CHECK -3 99 0 DoHandleUndelete | NOVA | Wild Ways | Newly established wildlife corridors offer hope to endangered species around the world. | EP000031630871
<br>Apr 23 16:13:27 gandalf mythbackend: mythbackend[10514]: I Scheduler scheduler.cpp:2211 (HandleReschedule) Scheduled 50 items in 0.1 = 0.00 match + 0.00 check + 0.07 place
<br><br></div><div>Can anyone expain why it works on the mythfrontend but not when using the Python bindings?<br><br></div><div>Sincerely,<br></div><div>Casey McGinty<br></div></div></blockquote></div>