Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bhavesh Jadav 35 posts 144 karma points
    Jun 05, 2018 @ 10:07
    Bhavesh Jadav
    0

    Personalisation Package Issue

    Hi,

    When we are trying test personalisation group package on cloud front, we are getting below issue:

    Exception occured:MaxMind.GeoIP2.Exceptions.GeoIP2Exception: The specified IP address was incorrectly formatted: 61.12.66.6, 52.66.194.148 at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem, Nullable1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency) at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem) at Zone.UmbracoPersonalisationGroups.Providers.GeoLocation.MaxMindGeoLocationProvider.GetCountryFromIp(String ip) at Zone.UmbracoPersonalisationGroups.Criteria.Country.CountryPersonalisationGroupCriteria.MatchesVisitor(String definition) at Zone.UmbracoPersonalisationGroups.PersonalisationGroupMatcher.IsMatch(PersonalisationGroupDefinitionDetail definitionDetail) at Zone.UmbracoPersonalisationGroups.PersonalisationGroupMatcher.CountMatchingDefinitionDetails(PersonalisationGroupDefinition definition) at Umbraco.Web.PublishedContentExtensions.ShowToVisitor(IList1 pickedGroups, Boolean showIfNoGroupsDefined)

    Umbraco Version: 7.3

    Personalisation Package version: 0.2.5

    Regards,

    Bhavesh Jadav

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jun 05, 2018 @ 10:21
    Andy Butland
    0

    It looks like there's a problem extracting the requesting IP address, I guess because it's going through CloudFront. Or rather it is getting the IP address, but seems to be actually getting two - 61.12.66.6, 52.66.194.148 and as I'm treating that as a single one we get this error as it's not an expected format.

    I've implemented this here for reference.

    Are you able to dig out what headers come over with IP based information from Cloudfront? If so I may be able to determine a better header to use. If not, can set up something to check if for some reason we do get two or more comma delimited IPs, to just take the first one.

    Thanks

    Andy

  • Bhavesh Jadav 35 posts 144 karma points
    Jun 08, 2018 @ 08:52
    Bhavesh Jadav
    0

    Hi Andy,

    We are getting "X-Forwarded-For" header with IP based information from cloudfront.

    Please look into below link for more info: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html

    Regards,

    Bhavesh Jadav

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jun 09, 2018 @ 10:11
    Andy Butland
    1

    Thanks for the update. OK, have learnt something here. I thought X-Forwarded-For would only ever contain a single IP but seems that's not always the case.

    From here: "the value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from."

    So looks like I need to account for that, and if there's more than one IP, take the first one to get the IP from where the request is coming from.

    I'll get a new release together with this behaviour in so you can upgrade.

    Andy

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jun 09, 2018 @ 10:47
    Andy Butland
    100

    Could you do me a favour please and check if you swap in the dll for this one is resolves the issue for you?

    If so, I'll prepare an update to the package.

    Thanks

    Andy

  • Bhavesh Jadav 35 posts 144 karma points
    Jun 11, 2018 @ 06:37
    Bhavesh Jadav
    0

    Thanks for your help.

    Provided dll has resolved the issue for me.

    Thanks,

    Bhavesh Jadav

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jun 11, 2018 @ 13:03
    Andy Butland
    0

    Great, good to hear and thanks for checking it.

    I've pushed out a new release to NuGet and our - version 0.3.3 - so if you prefer you can reference that now.

    Andy

Please Sign in or register to post replies

Write your reply to:

Draft