BingAds / BingAds-dotNet-SDK

Other
26 stars 41 forks source link

BulkAccount `SyncTime` value is null after downloading entities #32

Closed franckyj closed 7 years ago

franckyj commented 7 years ago

While doing some tests I encountered a case where an exception was thrown when downloading the entities after having sent a bunch of modifications.

As it turns out, the error was coming from reading the entities with the BulkFileReader:

using (var reader = new BulkFileReader(bulkReportCSVFile.FullName, ResultFileType.FullDownload, DownloadFileType.Csv))
{
    return reader.ReadEntities().ToList();
}

This is the stack trace I got:

at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.Convert.ToDateTime(String value, IFormatProvider provider)
at System.String.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Microsoft.BingAds.V10.Internal.Bulk.StringExtensions.Parse[T](String s, Boolean returnDefaultValueOnNullOrEmpty) in d:\dbs\sh\mdns\1229_192221\cmd\1\private\bingadsapisdk\V10\Internal\Bulk\StringExtensions.cs:line 60
at Microsoft.BingAds.V10.Bulk.Entities.BulkAccount.<>c.<.cctor>b__16_5(String v, BulkAccount c) in d:\dbs\sh\mdns\1229_192221\cmd\1\private\bingadsapisdk\V10\Bulk\Entities\BulkAccount.cs:line 55
at Microsoft.BingAds.V10.Internal.Bulk.Mappings.SimpleBulkMapping`1.ConvertToEntity(RowValues values, T entity) in d:\dbs\sh\mdns\1229_192221\cmd\1\private\bingadsapisdk\V10\Internal\Bulk\Mappings\SimpleBulkMapping.cs:line 32
at Microsoft.BingAds.V10.Internal.Bulk.MappingExtensions.ConvertToEntity[T](RowValues values, T entity, IEnumerable`1 mappings) in d:\dbs\sh\mdns\1229_192221\cmd\1\private\bingadsapisdk\V10\Internal\Bulk\MappingExtensions.cs:line 16

It seems this value isn't suppose to be null. The SDK version I'm using is 10.4.12.0

Let me know if you need anything else.

Thanks, Francois

eric-urban commented 7 years ago

I apologize for the delayed reply. Please clarify did you request a full download or are you trying to parse the upload result file? If the file is for upload results, you'll want to set ResultFileType.Upload instead of ResultFileType.FullDownload. If the file contents are from a full download are you still able to repro this issue with version 10.4.13? Upload result will not have Account with sync time. Full download should have Account with non-null sync time. Did you open the result file and confirm the field is empty/null? That would be an issue with the Bulk service itself (not SDK). Either way if you can provide more details about the repro we can investigate.

eric-urban commented 7 years ago

No repro