GithubHelp home page GithubHelp logo

Comments (9)

vbspace avatar vbspace commented on June 9, 2024 1

@roryrjb thank you for trying to help

from iplocation.

wtfleming avatar wtfleming commented on June 9, 2024 1

We we're seeing this too and were able to get non-empty results again by reversing the list of providers we found at https://github.com/roryrjb/iplocation/blob/master/src/index.ts#L6

So that our client code looks like this

    const providers = [
      'https://ipinfo.io/*',
      'https://ipapi.co/*/json/',
    ];

    const result = await iplocation(ipAddress, providers);

My guess is something changed at ipapi.co recently

from iplocation.

roryrjb avatar roryrjb commented on June 9, 2024

Hey @shivwork thanks for raising this. I have tested with the latest versions in 6.x, 5.x and 4.x branches and cannot replicate. This can happen if there isn't a value from the IP metadata provider, but for this particular IP address all the data is there. I could also have been a temporary issue with the provider at the time. If this issue persists, please let me know and could you also include the output of DEBUG=iplocation node {your_script_name}.js which will include information about what providers the module tried, what responses it got, etc.

from iplocation.

vbspace avatar vbspace commented on June 9, 2024

I am also getting empty response.

from iplocation.

vbspace avatar vbspace commented on June 9, 2024

@roryrjb can you help me please ?

from iplocation.

roryrjb avatar roryrjb commented on June 9, 2024

@ntk860 if you are able to share a snippet of the code you are using and ideally the IP address so I can properly test this then that would be good, otherwise if you could tell me what fields are empty.

from iplocation.

vbspace avatar vbspace commented on June 9, 2024
iplocation('56.70.97.8').then((res) => { 
        // res is empty
        console.log(res)
    })
    .catch(error => {
        console.log(error)
    })
})

{ country: '',
countryCode: '',
region: '',
regionCode: '',
city: '',
postal: '',
ip: '',
latitude: null,
longitude: null,
timezone: '' }

from iplocation.

roryrjb avatar roryrjb commented on June 9, 2024

@wtfleming thanks for pointing this out. I reached a similar fix when looking at this but wanted to get a more permanent solution in place, it seems like we may not be able to continue relying on ipapi.co, so will look for some alternatives. @ntk860 if you are able to implement something similar to this fix I think it'll be the best short term solution.

from iplocation.

jlchereau avatar jlchereau commented on June 9, 2024
iplocation('90.254.60.95', [], callback);

Return an empty record as experienced by #16 (comment).

iplocation(
    '90.254.60.95',
    [
        'https://ipinfo.io/*',
        'https://ipapi.co/*/json/'
    ],
    callback
);

Returns a proper record as suggested by #16 (comment)

https://ipapi.co/90.254.60.95/json/ returns:

"{\"error\": true, \"reason\": \"RateLimited\", \"message\": \"Sign up for IP Address Location API @ https://ipapi.co\"}"

then in

try {
    log("got: " + body);
    json = JSON.parse(body);
}
catch (ex) {
    return retry(++i, callback);
}

JSON.parse passes, so return retry(++i, callback); is not executed.

You need to throw an error or return retry(++i, callback); in the try block if json.error exists.

from iplocation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.