35

I've been getting this error when loading certain pages:

net::ERR_INCOMPLETE_CHUNKED_ENCODING 

These pages don't do anything special and everything seems to work in other browsers. The pages that this happens on display data in JSON. It only happens when the JSON page has to display a large amount of items. The rails console is not displaying any errors (200 response).

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
StefanDorresteijn
  • 409
  • 1
  • 5
  • 10
  • I'm seeing `net::ERR_INCOMPLETE_CHUNKED_ENCODING` on Chrome only as well. It's a Rails 3 app on Heroku. I tried changing from thin to unicorn, but it didn't help. – Mei May 12 '14 at 21:59
  • 1
    I'm seeing it on Apache on a shared hosting. I was using gzipped compression, and the error seemed to appear randomly. It's not just rails. – Kayla Aug 17 '14 at 18:04
  • I restarted Apache and the problem's gone – ursuleacv Dec 08 '15 at 22:23
  • did you get final solution ? Cache, RealTime Antivirus, Content-Length , ... ? – Kiquenet May 26 '16 at 06:35

13 Answers13

15

I encountered this problem yesterday. It's because the server didn't respond with some resources.

In my page, I have some large file links like <a href="/file_path">file_name</a>. This happened only in Chrome.

After awhile, I recognized this may be caused by Chrome's 'Predict network actions to improve page load performance' feature. So, I turned off this feature in chrome://settings and tried it again. As expected, the error didn't occur again.

After that, I changed resource links to have full_url_path instead of relative_path. In Rails, use resource_url instead of resource_path. Then I didn't have to turn off Chrome's feature, and it looks good.

Kirby
  • 15,127
  • 10
  • 89
  • 104
gavin1986
  • 318
  • 2
  • 7
  • Worked for me after Drupal stopped loading the admin interface. I was able to enable the _Predict network actions to improve page load performance_ feature afterwards without running into the same problem again. – Erik Töyrä Silfverswärd Aug 19 '16 at 07:49
8

I had this with a Wordpress website, also only in Chrome.

Updating the website and its plugins to the latest version didn't help, and other people didn't seem to have the same problem when visiting the website, but then I saw this post, turned off my antivirus (avast) real-time shields, as suggested, and the problem went away.

NOTE: The Real-Time Protection on some of the various anti-virus programs (AVAST, Kapersky and ESET) seem to be a major cause of this error.

Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
bjdmeest
  • 91
  • 2
  • 6
  • 2
    This works. Turning off the real-time protection on my ESET anti-virus did the trick. – Wayne Whitty Jun 23 '15 at 15:33
  • 1
    Same problem (random white screens on a Drupal site, only appearing in Chrome, with same error message), same fix, this time with Avira Antivirus Pro. I turned off Web Protection (while leaving all other protective services enabled) and the errors stopped. Not a great solution, though. – Giles B Aug 19 '15 at 15:26
  • thanks, I have same issue and disabling avast solves it, but what about my customers, is it possible to solve it on server? – Ivan Borshchov Feb 12 '16 at 20:15
  • @user3479125 I am afraid that this is a client-side issue, independent of browser vendor, so nothing the server can do. This should be fixed in the real-time protection shields of the various anti-virus programs. – bjdmeest Feb 15 '16 at 07:43
7

In my case, the problem was cache-related and was happening when doing a CORS request.

As stated in comments above:

the error seemed to appear randomly

This is because of the HTTP cache system.

Forcing the response header Cache-Control to no-cache resolved my issue:

This is using the Symfony HttpFoundation component.

<?php
$response->headers->add(array(
   'Cache-Control' => 'no-cache'
));
Kirby
  • 15,127
  • 10
  • 89
  • 104
eightyfive
  • 4,601
  • 3
  • 35
  • 44
3

I had this in a symfony project (PHP).

Like you describe your issue I had some static page (html.twig) with simple HTML and CSS... so nothing special about it.

For me it was a mod_rewrite problem, after I enabled mod_rewrite and added FallbackResource /index.php to my vhost it all worked smoothly.

PS: if you have apache lower than 2.2.16 create a .htaccess file in your root folder and use this code:

Options -MultiViews

RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L] </IfModule>
Herr Nentu'
  • 1,438
  • 3
  • 18
  • 49
  • I'm not running on Apache unfortunately. I'm running on Puma (Ruby on Rails) – StefanDorresteijn Apr 04 '14 at 12:49
  • 1
    Funny enough, I have Apache 2.4 running, and was getting this error. I was using `FallbackResource`. I switched back to the other (old) way, and the problem went away. This was a Silex app, and they recommended these confs as well. – jmar Sep 11 '14 at 20:37
  • I am running on Nginx and having the same issue – Andy Aug 10 '17 at 16:38
3

If having problems with symfony4 apache2, take a look at this answer

as summary, you have to disable FallbackResource/index.php into your virtualhost configuration file, next, you may want to run composer install symfony/apache-bundle and fix your /etc/apache2/apache.conf changing AllowOverride none for AllowOverride All, in order to enable the .htaccess file created in the installation recipe run, at the end, by restarting apache2 service (sudo service apache2 restart) the site must load without /index.php at the end of the URI.

Hope this helps someone!

Jorgeeadan
  • 343
  • 8
  • 20
2

This error comes, if you have relationship among domain objects or model object which you are returning back to Jquery. Please annotate with @JsonBackReference, your issue will be resolved

@ManyToOne(fetch = FetchType.LAZY,cascade=CascadeType.ALL)
@JoinColumn(name = "parentId", nullable = false)
@JsonBackReference
public Parent getParent() {
    return this.parent;
}

@OneToMany(cascade=CascadeType.ALLfetch =FetchType.LAZY,mappedBy=      
"parent")
@JsonBackReference
public Set<Category> getChild() {
   return this.child;
}
sunny
  • 57
  • 3
2

In my case I have "No space left on device". When I delete useless files on Server — error disappeared

stereodenis
  • 3,618
  • 2
  • 22
  • 27
1

We had net::ERR_INCOMPLETE_CHUNKED_ENCODING problem in case of HTML, which contained too much empty lines. Some browsers had difficulties with interpretation of long files.

Once we've made code cleaning in our templates by cleaning the code from empty lines, error disappeared.

Fedir RYKHTIK
  • 9,844
  • 6
  • 58
  • 68
1

At least for Java Web Application, and more specifically using JSPs, I have seen this happening when JSP are messed up. So, make sure your JSPs are correct.

andres.santana
  • 624
  • 1
  • 6
  • 13
  • This error was plaguing me as well until I traced down a JSP exception in Tomcat's localhost log. Fixing this error eliminated the browser issue for me as well. – tkincher Jun 21 '22 at 22:01
1

I've catched the same error on a local website. In logs I found this record:

"nginx failed (13: Permission denied) while reading upstream, client:   127.0.0.1".

My decision through restart of nginx and php-fpm from the right user:

Let's my_user – main user of website's directory.

First, go to nginx.conf: Change

user nginx; -> user my_user my_user_group;

or paste this

user my_user my_user_group;

on the top of file

2) Second, in php5/fpm/pool.d/www.conf

# Find and change this variables from old -> to new:
user -> my_user
group -> my_user
listen.owner -> my_user
listen.group -> my_user

3) And finally you need restart of nginx and php-fpm. Then make chown 0700 in handmode for /var/lib/nginx/tmp for my_user, like this:

chown -R my_user:my_user 0700 /var/lib/nginx/tmp
Anton
  • 11
  • 1
0

Please check your radware load balancer configuration. The setting for “FastView” and “APM” features can cause this issue. In my case it will get fixed after disabling those.

0

If you have opened any streams for the response those must be closed. For example code if you have opened a ServletOutputStream to download the zip directory the stream need to be closed as follows.

ServletOutputStream sos = response.getOutputStream();
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment;filename=project.ZIP");
sos.write(zip);
sos.flush();
sos.close();
0

By my experience there was an EXCEPTION that stopping the normal code executions, returning an incomplete or unexpected result Surround all the code in try/catch [with top exception level (es. "Throwable" in java)] and log the exception Another way is to use the debugger exception breakpoint