Unable to request ads from server due to network error

1,351 views
Skip to first unread message

Jeremy Provost

unread,
Nov 9, 2015, 3:30:48 PM11/9/15
to Interactive Media Ads SDK
Hi there,

I'm integrating the IMA SDK for iOS into a project that was already serving ads manually. The old method of manually serving the ad works correctly while attempting to use the IMA SDK does not.

1) We are using the iOS SDK, latest version, integrated through Cocoapods
3) We are able to reproduce this issue in the sample app, after changing the ad tag to the one above. When using the Video Suite Inspector there is no issue. So it only appears to be an issue when using it through the iOS SDK.
4) To reproduce, download the sample video player and replace the value of kTestAppAdTagUrl with the ad tag above and also set Allow Arbitrary Loads = YES for App Transport Security.

The log that we get is the following:

Core: (INFO) ima.loader.AdsLoaderWrapper: Requesting ads using new ads loader.
Core: (INFO) ima.loader.AdsLoaderWrapper: requestAds, processing external request.
Core: (INFO) ima.loader.SequentialAdsLoader: Enqueued new request.
Core: (INFO) ima.loader.SequentialAdsLoader: Starting request from queue.
Core: (SEVERE) ima.loader.UrlLoader: Failed! retrying without credentials
Core: (INFO) ima.loader.AdSourceFetcher: errorCallback for errorCode: 6
Error loading ads 1: Unable to request ads from server due to network error. (1012)
Core: (INFO) ima.loader.SequentialAdsLoader: Starting request from queue.

Thanks for your help.

Jeremy

Vu Chau (IMA SDK Team)

unread,
Nov 9, 2015, 5:07:05 PM11/9/15
to Interactive Media Ads SDK
Hi Jeremy,

I looked into this, and it turned out that the issue is caused by the 1-second preroll.  As you mentioned, I also didn't see this issue manifest in the VSI and the Android SDK.  Once I changed the duration to, say, 10 seconds, the tag worked fine with the iOS SDK and all the events fired.

Could you elaborate on the use case surround the 1-second preroll.  For example, was that intended for testing purposes?

Thanks,

Vu Chau
IMA SDK Team

Jeremy Provost

unread,
Nov 9, 2015, 6:01:25 PM11/9/15
to Interactive Media Ads SDK
Sorry, I'm not sure what you are seeing, but this is a 15 second ad. Not 1 second. Perhaps you are seeing a different result due to geographic targeting.

Jeremy Provost

unread,
Nov 9, 2015, 9:44:42 PM11/9/15
to Interactive Media Ads SDK
Here is the result I get from a browser:

<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="2.0">
 <Ad id="96711570">
  <InLine>
   <AdSystem>GDFP</AdSystem>
   <AdTitle>TEST Dinner Spinner preroll</AdTitle>
   <Description><![CDATA[TEST Dinner Spinner preroll ad]]></Description>
   <Creatives>
    <Creative id="44826013290" sequence="1">
     <Linear>
      <Duration>00:00:15</Duration>
      <TrackingEvents>
      </TrackingEvents>
      <VideoClicks>
      </VideoClicks>
      <MediaFiles>
      </MediaFiles>
     </Linear>
    </Creative>
   </Creatives>
   <Extensions>
    <Extension type="activeview"><CustomTracking>
</CustomTracking>
</Extension>
    <Extension type="geo"><Country>PA</Country>
<Bandwidth>3</Bandwidth>
<BandwidthKbps>2100</BandwidthKbps>
</Extension>
   </Extensions>
  </InLine>
 </Ad>
</VAST>

Vu Chau (IMA SDK Team)

unread,
Nov 10, 2015, 10:23:03 AM11/10/15
to Interactive Media Ads SDK
Hi Jeremy,

Thanks for the notice and for the VAST.  I guess seeing the 1-second ad was a result of geographic targeting as you said.  

However, I tested with the 15-second ad and saw something different. This time the VAST failed to return a media file for the ad playback, so it errored out on all SDKs (on Android I encountered a timeout). If you test it in the VSI, you will get an "AdError 400: There was an error playing the video ad. Caused by: Error: [object MediaError]" error, which basically means there is an error with the media files.  I realized that the media files are inaccessible even via the browser.  Are you seeing the same?  Has anything changed on the serving side?

When I proxied the traffic via Charles, I saw the SDK requested and loaded the ad.  It then skipped the ad due to the MediaError error, and fired ALL_ADS_COMPLETED to resume to content.


Vu Chau
IMA SDK Team

Jeremy Provost

unread,
Nov 12, 2015, 6:40:35 AM11/12/15
to ima...@googlegroups.com
This doesn’t match what I’m seeing at all. I always see the MediaFiles entries. It works perfectly using VSI. Is there any way for me to get a deeper look into why it is erroring on my side? Because what you’re seeing doesn’t seem to match my experience.




--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/OvBqmKe7X90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at http://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Jeremy Provost

unread,
Nov 12, 2015, 12:38:15 PM11/12/15
to Interactive Media Ads SDK
As a further test I tried hard-coding the ad tag URL in an Android project we have that uses the IMA SDK. There it works fine. So it works in VSI and it works in the IMA SDK on Android. Seems like the issue is specific to iOS and doesn't seem to have anything to do with our code since it can be recreated in the Google sample project for iOS.

Any updates on this?
To unsubscribe from this group and all its topics, send an email to ima-sdk+unsubscribe@googlegroups.com.

Vu Chau (IMA SDK Team)

unread,
Nov 12, 2015, 2:33:33 PM11/12/15
to Interactive Media Ads SDK
Hi Jeremy,

We are definitely seeing different results here on our end.  When I test the latest XML in the VSI (see the attached VSI screenshot), I'm always getting the "AdError 400: There was an error playing the video ad. Caused by: Error: [object MediaError]" error I mentioned in the previous post.  This is caused by our access to the media files being forbidden (media file screenshot).

In the meantime, since there's a discrepancy in what you and I are seeing, I'm going to list some troubleshooting steps you can take to diagnose the issue that you can reproduce on your end:
  1. Proxy the traffic via Charles at the time of the ad request, and see if there's any anomaly turning up in the log.  Check if you see any creative fetched.
  2. Try with a different ad tag and let us know if you continue seeing the same issue.  If so, send us this tag so we will be able to replicate the exact behavior you see on your end.  Sending the Charles log is a more foolproof way to maintain the integrity of the VAST content.
Vu Chau
IMA SDK Team
...
jeremy_mediafile.bmp
jeremy_VSI.bmp

Jeremy Provost

unread,
Nov 12, 2015, 2:45:05 PM11/12/15
to Interactive Media Ads SDK
When I test the XML it plays the ad no problem from the VSI. Is it possible that the media file itself is geo-protected? I'll try your other suggestions.
...

Jeremy Provost

unread,
Nov 12, 2015, 3:39:41 PM11/12/15
to Interactive Media Ads SDK
Looking at the Charles results I can see that if I run it through VSI everything is as expected with a 200 status code and the expected response. When I run it through the iOS IMA SDK with the same URL the SDK seems to modify the URL.

Original URL:


URL after it has been modified by the IMA SDK:


The second URL is failing specifically because the semicolon (;) after ar.ios.apps.allrecipes.recipes has been replaced with a question mark (?). I have verified this on the VSI. If I switch the ? back to a ; it loads as expected.

Is this something that can be addressed in the SDK? In the meantime is there something we could change in our URL so that it would not covert the semicolon to a question mark?
...

Vu Chau (IMA SDK Team)

unread,
Nov 12, 2015, 5:05:18 PM11/12/15
to Interactive Media Ads SDK
Hi Jeremy,

1. I think there is a confusion earlier in the discussion.  When I said the media files were inaccessible, I was referring to those found in the second VAST XML you posted, but not the original tag you provided.  The media files in the original tag work fine for me, but then on my end the creative has a duration of 1 second (see screenshot).  I changed this value to 10, for example, and I was able to request and play the ad just fine using the iOS SDK.

This touches on the other point I was making previously: Do you see the same behaviors with the iOS SDK when you use another ad tag?  I took one of our sample tags and modified to have a duration of 1 second as well, but it worked well nevertheless.

2. Regardless of the 1-second scenario, I'm able to verify that the question mark in the ad tag is replaced with a semicolon in the tag URL.  I will bring this up with the rest of the team and see what we can do.  In the meantime, let us know if the same scenario happens with other ad tags as well.
 
Thanks,

Vu Chau
IMA SDK Team
...

Jeremy Provost

unread,
Nov 12, 2015, 5:12:56 PM11/12/15
to ima...@googlegroups.com
I understand how you are testing. And yes, the default ad tag that ships with the iOS sample app works. However I have confirmed that it is the change from semicolon to question mark is the cause of the issue. If I try the IMA SDK-modified URL in VSI it no longer works. If I take the modified URL, change the question mark to a semicolon, and then put it in VSI it works. The question mark is the issue and that's what we need corrected. Can you provide an ETA on a fix? Any idea why that URL is being modified? Can we disable that when using the SDK?



--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/OvBqmKe7X90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.

Vu Chau (IMA SDK Team)

unread,
Nov 13, 2015, 9:42:43 AM11/13/15
to Interactive Media Ads SDK
Hi Jeremy,

We'll need to verify whether this is a bug or intended behavior.  I will post on this thread once I have further updates.

Thanks!

Vu Chau
IMA SDK Team

Jeremy Provost

unread,
Nov 13, 2015, 10:11:44 AM11/13/15
to ima...@googlegroups.com
I hope it isn’t intended behavior to take a working URL and make it unusable. Please let me know as soon as you can.

Vu Chau (IMA SDK Team)

unread,
Nov 24, 2015, 12:16:15 PM11/24/15
to Interactive Media Ads SDK
Hi Jeremy,

The team has fixed this bug, and the fix will be live with the next SDK release.  I will let you know once we have pushed it out.  You may also check with our release notes for updates.

Thanks,

Vu Chau
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages