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.

Carbon closes connection unexpectedly resulting in net::ERR_CONNECTION_CLOSED error

See original GitHub issue

Hi,

I was trying to process a bash scripts file and the carbon-now-cli always shows that

Error: Sending code to https://carbon.now.sh went wrong

I uploaded my script here, and please try the following command on it.

First, carbon-now colortest, does’t work.

There are 75 lines in the file, and changing the the -e option to a value smaller than or equal to 61, it will work.

Then, without modifying the -e, try changing the values for -s option, I find that the CLI would stop working if -s is greater than or equal to 5.

The correspondent code blocks that I suspect to be the cause of the bug are:

Line 4 to line 6:

colortest_usage () {
    echo -e "Usage: colortest [[-v|--verbose] | [-a|--all] | [-h|--help]]\n\nPrint out colors available in this terminal emulator. The default output is a short list of colors. If -v or --verbose is specified, a table containing all combination of background and foreground colors is displayed. Alternatively, if -a or -all is specified, then both short list and the detailed table would be displayed.\n\nNote that there should be no argument to this programme.\n  -v, --verbose\t displays a table with detailed table of combinations of colors.\n  -a, --all    \t displays both brief and detailed results.\n  -h, --help   \t displays this help."
}

And line 62 to line 71:

  while [[ "$#" > 0 ]]; do
    case "$1" in
      -h|--help) colortest_usage;;
      -v|--verbose) colortest_long;;
      -a|--all) colortest_short; colortest_long;;
      --) colortest_short;;
      *) echo "$0: Error(1): This function doesn't accept any argument." >&2 | logger; colortest_usage;unset -f colortest_usage colortest_short colortest_long; option; return 1;;
    esac
    shift
  done

It seems that as long as I’m not asking carbon-now-cli to process both code blocks, then it works fine.

Please take a look. Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Sneezoocommented, Feb 17, 2019

As explained thoroughly in https://stackoverflow.com/a/417184 , there is no character limit in URLs in theory, but most servers and browsers defined their own limits.

I guess Puppeteer is not the problem here, but the carbon now server. As you can see in the link above, puppeteer would likely have it’s limits about over 32k.

Also a “connection closed” error sounds more like a carbon issue to me, meaning the server closed the connection unexpectedly.

Update: Tried it! It’s a carbon now issue. If you reload the page after pasting your code in the web app, you will get the same error.

1reaction
mixncommented, Feb 17, 2019

Hi @lebensterben, thanks for the very detailed report on this. 🙂 Also, nice username. 😊

I was able to reproduce this issue for your particular use case and started investigating. Debugged for quite a bit and ended up noticing that it has nothing to do with certain special characters or your file in particular.

It has something to do with the length of the URL that gets produced and Puppeteer tries to open.

The longer the file you’re parsing, the longer the URL (which is ok and completely logical). But seemingly long URLs (above ~6510 characters in total length) lead to a net::ERR_CONNECTION_CLOSED on Puppeteers end. 🤔

Having a foo.txt with 6330x the letter a will fail with this error:

screenshot 2019-02-17 at 22 05 05

…which is the same error I was getting for your file. Or any big file for that matter.

I couldn’t find a Puppeteer issue for long URLs at first glance. Will likely file a report and see what the feedback is. This has a high priority atm because it kind of limits the CLI to small-ish files… and your file wasn’t even that big with 75 LOC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What could be the reason of "net_io_connectionclosed." when ...
The problem may be a simple as a failed connection. Remember, not every connection is successful, and it's the sender's responsibility to retry ......
Read more >
c# - SmtpException: Unable to read data from the transport ...
Just in-case anyone digs up this post, I had the same problems, (Unable to read data from the transport connection: net_io_connectionclosed.), but I...
Read more >
Error: Unable to Read Data from the Transport Connection
Error: Unable to Read Data from the Transport Connection: net_io_connectionclosed. ... This error is a generic error from your SMTP Server.
Read more >
Unable to read data from the transport connection - Sage City
I am trying to set up the Distribution Settings and keep getting this error: Unable to read data from the transport connection: ...
Read more >
"Failure sending mail. Unable to read data from the transport ...
TIBCO Spotfire Automation Services error:"Failure sending mail. Unable to read data from the transport connection: net_io_connectionclosed".
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