project8 / mantis

project8 development DAQ
Other
2 stars 1 forks source link

unable to force an unlock #58

Closed laroque closed 8 years ago

laroque commented 8 years ago

It is possible that there's no bug and I'm just not understanding the server API or client syntax, but I can't get the server to unlock using a force.

Reproduce:

Do either (dripline){14:17}higgsino:~/Repos/mantis/build:master ✓ ➭ dripline_agent cmd mantis.unlock force=True or (dripline){14:17}higgsino:~/Repos/mantis/build:master ✓ ➭ ./bin/mantis_client do=cmd dest=mantis.unlock force=true

result is a message with retcode 307

Detail dump

From message_monitor:

2015-10-20T14:07:53[Level 35] monitor_service(31) ->
None [mantis.unlock]     (From App [routing_key])
{
    "timestamp": "2015-10-20T21:07:53Z",
    "sender_info": {
        "username": "laroque",
        "exe": "/home/laroque/Repos/mantis/build/bin/mantis_client",
        "package": "Mantis",
        "hostname": "higgsino",
        "version": "3.1.4",
        "commit": "c0a29bbdaccebe38c325477fd9bb665ed1c16514"
    },
    "payload": {
        "force": true
    },
    "msgop": 9
}
2015-10-20T14:07:53[Level 35] monitor_service(31) ->
None [amq.gen-QEGETBkT16zl56wFEbvg7w]     (From App [routing_key])
{
    "timestamp": "2015-10-20T21:07:53Z",
    "sender_info": {
        "username": "laroque",
        "exe": "/home/laroque/Repos/mantis/build/bin/mantis_server",
        "package": "Mantis",
        "hostname": "higgsino",
        "version": "3.1.4",
        "commit": "c0a29bbdaccebe38c325477fd9bb665ed1c16514"
    },
    "retcode": 307,
    "return_msg": "Request denied due to lockout (key used: )",
    "payload": {}
}
nsoblath commented 8 years ago

Ah, I see the problem. At the beginning of the function that handles CMD requests it authenticates the provided key. I failed to include an exception for the case where the server is locked and the request is to unlock. I can take care of it.

nsoblath commented 8 years ago

Fixed in v3.2.3