I'm using a SOAP call to perform an SQL Query and I get this error:

QueryDefinition was unable to queue this task. This query definition is not active

My call :

<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">

I found that this error was thrown because I did delete the same SQL query with the same name and customerKey so when I retrieve the ObjectID via the customerKey, there are 3 of them like marketing cloud would have a recycle bin.


Do you have any idea, how could I delete those ghosts ?

  • 1
    Talk to your account rep or SFMC Global support to get this taken care of. It is stored where no user is able to edit. Jul 11 '18 at 16:21
  • And is it normal or is it a known bug where some data remains for no reason ?
    – Otor
    Jul 12 '18 at 7:31
  • And is there a property like 'isActive' or so ? To make a complex filter where there are no ghosts, if you know this it would solve my problem :)
    – Otor
    Jul 12 '18 at 8:11

If you want to chase ghosts from your SOAP API calls, use the property : 'Status' that will tell you if the object is 'Active' or 'Inactive'. Here an example of result:

"soap:Body": [{
        "RetrieveResponseMsg": [{
            "$": {
                "xmlns": "http://exacttarget.com/wsdl/partnerAPI"
            "OverallStatus": ["OK"],
            "RequestID": ["bdc3ef5a-22f7-4d10-a4fc-90089cfe57c3"],
            "Results": [{
                "$": {
                    "xsi:type": "QueryDefinition"
                "PartnerKey": [{
                    "$": {
                        "xsi:nil": "true"
                "ObjectID": ["0e4969..."],
                "Name": ["AllJobsID"],
                "Status": ["Active"]

Use a complex filter in your SOAP call to chase them :

<Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
           <LeftOperand xsi:type="par:SimpleFilterPart">
           <RightOperand xsi:type="par:SimpleFilterPart">

ghostbuster image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.