example-dfp-line-item-generator icon indicating copy to clipboard operation
example-dfp-line-item-generator copied to clipboard

Error: soap:Server: [PublisherQueryLanguageSyntaxError.UNPARSABLE @ Unable to parse query: 'Where '

Open JuanCaicedo opened this issue 8 years ago • 8 comments

Copied from https://github.com/spanishdict/node-google-dfp-wrapper/issues/24 by @brianibok

Hi All,

Getting the error below when I try to run the script to generate the line-items:

node scripts/create-line-items.js --order ORDER_NAME --start 1 --end 1

Error: Progress [=-] 50% 0.0screating line items failed because Error: soap:Server: [PublisherQueryLanguageSyntaxError.UNPARSABLE @ Unable to parse query: 'Where ' Syntax error at line 0, column 0.]

However no modifications were made to the script

JuanCaicedo avatar Nov 27 '16 14:11 JuanCaicedo

I think this problem steps from this commit where we removed the ad unit name from the formatting. I think adunitid is a field required by DFP to create line items however. Maybe what we could do is add it as a parameter you pass to the script.

To test if that would work, @brianibok could you add this line below this code:

adUnitName: 'name-of-your-ad-unit',

Note that the library will look up that ad unit in DFP, so it needs to already exist

JuanCaicedo avatar Nov 27 '16 14:11 JuanCaicedo

Thanks for the update Juan, this stopped the error from popping up, but no lines were actually pushed to DFP. Will review the commit to see whether there is anything else missing that needs to be added.

brianibok avatar Nov 28 '16 03:11 brianibok

Disregard my last note. I am still getting the same error.

brianibok avatar Nov 29 '16 22:11 brianibok

Hi JuanCaicedo,

Im still really stuck here, any ideas? What was the reason for making the changes to the commit you specified? I am considering adding these back in, but want to make sure its the right way to.

brianibok avatar Dec 02 '16 21:12 brianibok

Try commenting out L634 in dfp.js in node-google-dfp-wrapper.

https://github.com/spanishdict/node-google-dfp-wrapper/blob/401a38abdcd4a61b58df365496e47d94010c4e12/lib/dfp.js#L634

.then(this.replaceAdUnitName)

This step is no longer needed. It is expecting parameters that are not longer included in this example script so it errors out.

@JuanCaicedo We should see how we can remove or only optionally call this in node-google-dfp-wrapper in a backwards compatible way.

nanek avatar Dec 02 '16 21:12 nanek

I'm experiencing the same error message as @brianibok, I tried the above fix @nanek without luck. Will continue to investigate..

EDIT: just to add more detail to my comment, @nanek after commenting out line 634 in dfp.js in node-google-dfp-wrapper, I get a new error message when running 'node scripts/create-line-items.js ...': $node scripts/create-line-items.js --order ORDER_NAME --start 1 --end 10 --order ORDER_NAME --start 1 --end 10 Progress [=----------] 9% 0.0screating line items failed because Error: Expected to find results, but there were none at extractResults (/Users/jameshume/node_modules/node-google-dfp-wrapper/lib/dfp.js:236:11) at tryCatcher (/Users/jameshume/node_modules/bluebird/js/release/util.js:11:23) at Promise._settlePromiseFromHandler (/Users/jameshume/node_modules/bluebird/js/release/promise.js:488:31) at Promise._settlePromise (/Users/jameshume/node_modules/bluebird/js/release/promise.js:545:18) at Promise._settlePromise0 (/Users/jameshume/node_modules/bluebird/js/release/promise.js:590:10) at Promise._settlePromises (/Users/jameshume/node_modules/bluebird/js/release/promise.js:673:18) at Promise._fulfill (/Users/jameshume/node_modules/bluebird/js/release/promise.js:614:18) at /Users/jameshume/node_modules/bluebird/js/release/nodeback.js:42:21 at /Users/jameshume/node_modules/node-google-dfp-wrapper/lib/user.js:75:11 at /Users/jameshume/node_modules/soap/lib/client.js:145:7 at /Users/jameshume/node_modules/soap/lib/client.js:304:7 at Request._callback (/Users/jameshume/node_modules/soap/lib/http.js:109:5) at Request.self.callback (/Users/jameshume/node_modules/request/request.js:198:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (/Users/jameshume/node_modules/request/request.js:1082:10)

James328 avatar Dec 08 '16 23:12 James328

Hi, I had the same issue and commenting out replaceAdUnitName line fixed it. But now I'm having trouble with the custom targeting and this query...

{ filterStatement: { query: 'Where customTargetingKeyId like '510964' and name like '1.00'' } }

This returns....

GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID The WHERE clause in the Statement.query must always contain CustomTargetingValue.customTargetingKeyId as one of its columns in a way that it is AND'ed with the rest of the query.

And I can't work out why! Any ideas?

Thanks Rich

reelcitizen avatar Mar 02 '17 16:03 reelcitizen

If it helps anyone I fixed the above by creating a new query with = instead of 'like' for the Key ID...

var query = new nodeGoogleDfp.Statement("Where customTargetingKeyId = 510964 and name like '1.00'");

reelcitizen avatar Mar 03 '17 11:03 reelcitizen