BingAds / BingAds-Java-SDK

Other
43 stars 47 forks source link

Error while parsing Parent Id of failed AdGroupDeviceCriterion #88

Closed charan1595 closed 6 years ago

charan1595 commented 6 years ago

If the AdGroupDeviceCriterion is failed because of any issue, the BulkFileReader stops by throwing com.microsoft.bingads.v12.bulk.EntityReadException, which in turn was caused by java.lang.NumberFormatException: For input string: "". If the AdGroupDeviceCriterion fails, there wont be any parent Id, because of this an empty string is passed to Long.parseValue() for parent Id, causing the above errors. I have forked it and corrected here https://github.com/charan1595/BingAds-Java-SDK

This happens only when you try to create AdGroup and AdGroupDevice Criterion from the same bulk file and AdGroup Device could not be created because of some issue ( like failing to create the parent AdGroup or duplicate device criterion)

charan1595 commented 6 years ago

@qitia can you please look into this

qitia commented 6 years ago

thanks for reporting theissue. I will look into it. @charan1595. BTW the link you post above is not accessible.

qitia commented 6 years ago

May I know in which case the AdGroupDeviceCriterion failed? if you look into doc here https://docs.microsoft.com/en-us/bingads/bulk-service/ad-group-deviceos-criterion?view=bingads-12#parentid, the parentId is a required attribute..

charan1595 commented 6 years ago

This happens when you try to create both adgroup and adgroup device criterion from the same bulk file. In this case while uploading the bulk file we dont have the adgroup id to be set in adgroup device criterion, because we are creating both of them at the same time, instead we use adgroup name to specify which adgroup any particular adgroup device criterion belongs to. using logical key referencing

If by any reason adgroup creation fails, adgroup device criterion for that adgroup fails too. In this case the result file wont be having anything in parent Id for adgroup device criterion. This is causing the error while BulkFileReader reads the result file.

Note: This happens only during logical key reference and when parent fails due to any reason.

qitia commented 6 years ago

Got it @charan1595 Thanks! Let me look into this and come back.

qitia commented 6 years ago

hey @charan1595 new release 11.12.7 should fix this issue now.