Problem/Motivation

During the batch operation for automatic import of interface translations an ajax error occurs. The batch operation continues. The batch sometimes stalls before it is completed.
Error text (translated back to English): An AJAX HTTP request terminated abnormally. Debugging information follows. Path: /batch?id=3&op=do_nojs&op=do StatusText: error ResponseText: ReadyState: 0

To reproduce:

  1. Checkout the latest Drupal 8 core dev
  2. Apply the latest patch of #1848490: Import translations automatically during installation
  3. Download and unpack the devel module into sites/all/modules/devel
  4. Install Drupal: in the first step, select Dutch as language. Continue other installation steps as usual, use defaults where possible. (with other languages it fails too)
  5. Enable the Devel module at admin/modules
  6. The ajax error occurs immediately after initialisation of the batch. The batch operation continues quickly after the ajax error. You will need to record the screen activity with a video/screencast recording program to watch the actions in detail.
  7. In the watchdog you will find two occurrences of "File not found: http://ftp.drupal.org/files/translations/8.x/devel/devel-8.x-1.x-dev.nl.po."
    In the watchdog you will find 4 php messages: "Undefined variable: old_set in _batch_process() (regel 298 van /Users/erik/www/drupal8/core/includes/batch.inc)", "Undefined variable: finished in _batch_process() (regel 305 van /Users/erik/www/drupal8/core/includes/batch.inc)."

Proposed resolution

to be determined

Files: 
CommentFileSizeAuthor
#5 debug-1877820.patch.txt5.93 KBSutharsan

Comments

Sutharsan’s picture

Issue tags: +D8MI

I've debuged this problem by logging the various function calls with a millisecond time stamp:

                devel module enabled.
1357130237.1379 Build batch: locale_translation_batch_update_build()
1357130239.2889 JS calls /batch: _batch_page(): op=start
1357130239.2900 _batch_progress_page()
1357130242.8807 JS calls /batch: _batch_page(): op=do
1357130242.8835 _batch_do()
1357130242.8841 _batch_process()
1357130242.8867 locale_translation_batch_status_fetch_remote()
1357130242.9102 JS calls /batch: _batch_page(): op=start
1357130242.9115 _batch_progress_page()
1357130242.9206 _batch_process()
1357130242.9240 locale_translation_batch_status_fetch_remote()
                File not found: http://ftp.drupal.org/files…
                File not found: http://ftp.drupal.org/files…
1357130243.6418 locale_translation_batch_status_fetch_local()
1357130243.6441 locale_translation_batch_status_fetch_local()
1357130243.6535 locale_translation_batch_status_finished()
1357130243.6535 locale_translation_batch_status_finished()
1357130243.6554 locale_translation_batch_status_finished()
1357130243.6554 locale_translation_batch_status_finished()
1357130243.6565 locale_translation_batch_fetch_import()
1357130243.6565 locale_translation_batch_fetch_import()
1357130243.6576 locale_translation_batch_fetch_update_status()
1357130243.6576 locale_translation_batch_fetch_update_status()
1357130244.1330 JS calls /batch: _batch_page(): op=do
1357130244.1360 _batch_do
1357130244.1369 _batch_process
                Notice: Undefined variable: finished in _batch_process()
                Notice: Undefined variable: old_set in _batch_process()
                Notice: Undefined variable: old_set in _batch_process()
                Notice: Undefined variable: old_set in _batch_process()
1357130244.3291 JS calls /batch: _batch_page(): op=finished
1357130244.3341 locale_translation_batch_fetch_finished()

Notice that _batch_page() is called twice with op=start. Compare this with a batch process without an error:

                url module enabled.
1357131916.1013 Build batch: locale_translation_batch…
1357131917.8105 JS calls /batch: _batch_page(): op=start
1357131917.8117 _batch_progress_page()
1357131921.3273 JS calls /batch: _batch_page(): op=do
1357131921.3301 _batch_do()
1357131921.3308 _batch_process()
1357131921.3335 locale_translation_batch_status_fetch_remote()
                File not found: http://ftp.drupal.org/files…
1357131921.7309 locale_translation_batch_status_fetch_local()
1357131921.7405 locale_translation_batch_status_finished()
1357131921.7421 locale_translation_batch_status_finished()
1357131921.7432 locale_translation_batch_fetch_import()
1357131921.7444 locale_translation_batch_fetch_update_status()
1357131921.9530 JS calls /batch: _batch_page(): op=finished
1357131921.9577 locale_translation_batch_fetch_finished()

The 'File not found: http://ftp.drupal.org/files...' is normal behaviour. locale_translation_batch_status_fetch_remote() checks a po file at the translation server, but it does not exist.

nod_’s picture

Issue tags: +JavaScript

tzg

Sutharsan’s picture

Issue tags: -JavaScript

An other test run gave the result below. In this the batch is started for a second time (op=start) even before the first batch operation (locale_translation_batch_status_fetch_remote()) got executed.

devel-module ingeschakeld.
1357139480.4391 Build batch: locale_translation_batch_update_build()
1357139482.6231 JS calls /batch: _batch_page(), op=start
1357139482.6240 _batch_progress_page()
1357139486.2145 JS calls /batch: _batch_page(), op=do
1357139486.2156 JS calls /batch: _batch_page(), op=start
1357139486.2172 _batch_do()
1357139486.2173 _batch_progress_page()
1357139486.2178 _batch_process()
1357139486.2206 locale_translation_batch_status_fetch_remote()
1357139486.2214 locale_translation_http_check(): http call started
1357139486.2265 _batch_process()
1357139486.2292 locale_translation_batch_status_fetch_remote()
1357139486.2299 locale_translation_http_check(): http call started
1357139486.9652 locale_translation_http_check(): http call completed
1357139486.9657 locale_translation_http_check(): http call completed
File not found: http://ftp.drupal.org/files…
File not found: http://ftp.drupal.org/files…
...

Logging of locale_translation_http_check() was added after the test in #1 and logs the moments before and after the drupal_http_request() function call.

Sutharsan’s picture

Issue tags: +JavaScript

putting back the tag nod_ added.

Sutharsan’s picture

FileSize
5.93 KB

This is a patch of the debug calls I used to make the above timeline in the watchdog.

Sutharsan’s picture

Issue summary: View changes

Added error message

knalstaaf’s picture

I'm having a similar issue on D7 (checking for translations, but for modules updates as well). Could this be hosting-related?

Sutharsan’s picture

@knalstaaf, I guess you are referring to using Localization Update module in D7. Please create an issue in that issue queue, and I'll be happy to help you debugging this problem.

knalstaaf’s picture

Sorry for the noise, I came in via a search engine unaware that this was a core-topic. Coincidentally it turned out to be unrelated to the Localization Update module after all (which I thought this topic was about indeed). It's solved by now by a DNS-configuration of the host: #2297765: Error when checking for updates: AJAX HTTP request terminated abnormally; ReadyState: 0

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.