question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

traceroute parser unable to grab IP when using "-n"

See original GitHub issue

Hi! I’m using jc’s traceroute parser to automate networking tests with pytest. it’s pretty damn useful!

I’m using jc version 1.14.3 on debian bullseye for the tests, but I’ve also verified that the same behaviour is happening with jc 1.20.0 in debian sid

I’ve just hit a tiny snag while using it: apparently when we give traceroute a -n argument, the parser is not able to grab the IP adresses anymore.

I’m wondering if the parser needs to match the hostname only conditionally… but I have not yet taken a look at the parser’s code.

Here’s an example of what happens – I’ve added -q 1 just to make the output more concise but the same happens without it (the number of hops seems correct but all of the “ip” fields are empty):

$ jc -p traceroute -n -q1 www.koumbit.org
{
  "destination_ip": "199.58.80.40",
  "destination_name": "www.koumbit.org",
  "hops": [
    {
      "hop": 1,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 0.95
        }
      ]
    },
    {
      "hop": 2,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 12.635
        }
      ]
    },
    {
      "hop": 3,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 20.982
        }
      ]
    },
    {
      "hop": 4,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 19.329
        }
      ]
    },
    {
      "hop": 5,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 20.229
        }
      ]
    },
    {
      "hop": 6,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 20.887
        }
      ]
    },
    {
      "hop": 7,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 20.315
        }
      ]
    },
    {
      "hop": 8,
      "probes": [
        {
          "annotation": null,
          "asn": null,
          "ip": null,
          "name": null,
          "rtt": 21.653
        }
      ]
    }
  ]
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lelutincommented, Aug 20, 2022

nice! I’ve tested again the 4 cases with the new version. ipv4 with(out) -n and ipv6 with(out) -n and it all seems to be working great. many thanks for such a quick fix! 😃

0reactions
kellyjonbrazilcommented, Aug 21, 2022

Released in v1.21.0 available via pip. Binaries coming soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can I traceroute to this IP address, but not ping?
On a similar question here Luke Savage explained it perfectly: Traceroute is not a protocol itself, it is an application and the protocols ......
Read more >
Traceroute Command - an overview | ScienceDirect Topics
Traceroute uses ICMP's Ping command to find out how many different devices are between the computer initiating the traceroute and the target.
Read more >
Advanced Network Troubleshooting: Using traceroute
The traceroute packets are blocked or rejected by a router in the path. Usually, the router immediately after the last visible hop is...
Read more >
How to Read a Traceroute - InMotion Hosting
Want to know how to make sense of a trace route? Learn how in this tutorial.
Read more >
Why can I ping an IP address but not 'traceroute' it? - Super User
Try using a different method in your traceroute, for example TCP SYN or ICMP instead of the default UDP method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found