Problem/Motivation

In #1887046: Convert drupal_http_request usage in install.core.inc to Guzzle. (#31) the language requirement error description caused confusion. A website which could not connect to the translation server, probably due to a firewall, reported to be offline.
Currently the code does not differentiate between offline and not able to connect the translation server. Once the guzzle http library is being used for http requests (the mentioned issue) this becomes possible.

Proposed resolution

* Separately detect and report online/offline.
* Separately detect and report whether the translation server can be connected.

Test this patch in the following situations:

  • Drupal 8 located on a server behind a firewall which blocks HTTP access to ftp.drupal.org
  • Drupal 8 located on a server behind a proxy server which blocks HTTP access to ftp.drupal.org
  • Drupal 8 located on a (localhost) server with no connection to internet
  • Drupal 8 located on a (localhost) server with an unreliable internet connection. E.g. 3G while traveling
  • Install with a non-existing language code in the url. E.g. core/install.php?langcode=xyz
  • And finally ;) Drupal 8 located on a (localhost) server a normal internet connection installing in a regular language.

Check if the failure situation is correctly detected. Check if the help text is clear and helpfull.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Update the issue summary Instructions
Update the issue summary noting if allowed during the beta Instructions

User interface changes

Changing language requirements report.

Files: 
CommentFileSizeAuthor
#68 install-server-offline-1912886-68-8.0.7.diff484 bytesredsd
#65 install-server-offline-1912886-65-8.0.7.patch495 bytesredsd
#64 install-server-offline-1912886-62-8.0.7.patch495 bytesredsd
#62 install-server-offline-1912886-62-8.0.7.patch497 bytesredsd
#60 install-server-offline-1912886-60-8.0.7.patch996 bytesredsd
#57 1912886_translation_server_offline.png74.34 KBkeopx
#57 1912886_translation_not_available.png73.36 KBkeopx
#52 install-language-messages-1912886-50.patch8.04 KBkeopx
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,402 pass(es). View
#43 install-language-messages-1912886-43.patch8.05 KBadci_contributor
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch install-language-messages-1912886-43.patch. Unable to apply patch. See the log in the details link for more information. View
#38 1912886-install-language-messages-38.patch7.99 KBSutharsan
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1912886-install-language-messages-38.patch. Unable to apply patch. See the log in the details link for more information. View
#32 drupal8.install-system.1912886-32.png45.89 KBgyuhyon
#30 1912886-install-language-messages-30.patch7.83 KBSutharsan
PASSED: [[SimpleTest]]: [MySQL] 59,060 pass(es). View
#26 interdiff-1912886-25-26.patch2.98 KBSutharsan
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch interdiff-1912886-25-26.patch. Unable to apply patch. See the log in the details link for more information. View
#25 1912886-install-language-messages-25.patch0 bytesSutharsan
PASSED: [[SimpleTest]]: [MySQL] 57,900 pass(es). View
#22 1912886-install-language-requirements-22.patch9.71 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 54,444 pass(es). View
#12 screenshot-1912886-11-1.png28.56 KBvijaycs85
#12 screenshot-1912886-11-2.png15.7 KBvijaycs85
#4 1912886-error.png14 KBvijaycs85
#3 install-1912886-3-all-ok.png60.36 KBSutharsan
#3 install-language-requirements-1912886-3.patch9.74 KBSutharsan
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch install-language-requirements-1912886-3.patch. Unable to apply patch. See the log in the details link for more information. View
#3 install-1912886-3-all-fail.png270.37 KBSutharsan

Comments

Sutharsan’s picture

Proposal for new error text:

Offline

Failed to connect.
The installer requires to contact the translation server to download a translation file. Verify your internet connection and verify that your website can contact the translation server at !server_url.

Can not contact the server.

Failed to contact the translation server.
The installer requires to contact the translation server to download a translation file. Verify that your website can contact the translation server at !server_url. This fault may be caused by firewall or proxy settings.

Sutharsan’s picture

Issue tags: +D8MI, +language-ui

Tagging

Sutharsan’s picture

Title: Improve language requirements description and offline detection » Improve installation language requirement descriptions and offline detection
Status: Active » Needs review
Issue tags: +Needs manual testing
FileSize
270.37 KB
9.74 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch install-language-requirements-1912886-3.patch. Unable to apply patch. See the log in the details link for more information. View
60.36 KB

The patch makes more use of Guzzle's exceptions to distinguis 4xx/5xx errors from failed connections (offline/firewall/proxy). 'offline' message text changed, 'Failed to contact the translation server ' message added.

Screenshot of all positive and all negative texts included for evaluation.
install-1912886-3-all-ok.png
install-1912886-3-all-fail.png

Small change to the issue title to identify the issue scope (installer).

vijaycs85’s picture

FileSize
14 KB
47.33 KB

@Sutharsan, I applied patch in #3 and getting below error when try to install fresh (no settings.php, no defualt/files/ and empty DB).

1912886-error.png

Sutharsan’s picture

@vijaycs85, this error makes sense, it is a core bug and is being worked on. See the issue description.

Sutharsan’s picture

Issue summary: View changes

Updated issue summary.

Sutharsan’s picture

Issue summary: View changes

Test-suggestion added

Sutharsan’s picture

@vijaycs85, #1887046: Convert drupal_http_request usage in install.core.inc to Guzzle. has just been committed. No error will now occur when you install in French. Looking forward to your test results.

vijaycs85’s picture

FileSize
26.65 KB

Thanks for the update @Sutharsan. I'm getting below error now (as I'm behind a proxy). it is better than #4. However, I'm just wondering why it doesn't say "Failed to connect the translation server", which is more appropriate to my problem. As I can visit http://ftp.drupal.org/ directly, "Check internet connectivity" might confuse user...

1912886-re-test-7.png

YesCT’s picture

Issue tags: +medium

this manual testing, is probably more complicated than typical novice, so tagging medium

Sutharsan’s picture

@vijaycs, I don't know how to make this more clear in only a few lines of text. In case Drupal is located at a server, the problem lies with the server not being able to connect to ftp.d.o, in case Drupal is installed on a localhost the problem lies with the computer not able to connect. Any suggestion for a better text? I think we should focus on the first use case, the second will notice the problem easily, get first doesn't.

Sutharsan’s picture

@vijaycs, I misread your question. Your error should read "failed to connect". I think something went wrong with applying your patch.

vijaycs85’s picture

FileSize
28.02 KB

@Sutharsan, you are right. Seems I tested without the patch on #7. I just confirmed that it is working as expected. Sorry for the confusion.

1912886-11.png

I can confirm the translation unavailable scenario as well:

screenshot-1912886-11-1.png

After select a language, if we try to change mind, it doesn't allow (until remove the .po file of selected language) as below screen. Just want to confirm that is working as per design.

screenshot-1912886-11-2.png

Guess, we can RTBC, if you are OK with this test.

vijaycs85’s picture

Updating screenshots in #10.

YesCT’s picture

Issue tags: -Needs manual testing

#1848490-42: Import translations automatically during installation 8. shows that is by design (or was at the time).

I think a separate issue should be opened to discuss that. There are a couple of use cases at odds there.

looks like manual testing is done. (updating tags)
Just a code review needed now.

vijaycs85’s picture

vijaycs85’s picture

Just re-testing... AFAIK, code looks fine to me.

vijaycs85’s picture

Issue tags: -D8MI, -language-ui, -medium

Status: Needs review » Needs work

The last submitted patch, install-language-requirements-1912886-3.patch, failed testing.

YesCT’s picture

Status: Needs work » Needs review
YesCT’s picture

vijaycs85’s picture

Status: Needs review » Needs work
Issue tags: +D8MI, +language-ui, +medium

The last submitted patch, install-language-requirements-1912886-3.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
9.71 KB
PASSED: [[SimpleTest]]: [MySQL] 54,444 pass(es). View

Re-rolling...

David_Rothstein’s picture

Only skimmed this issue quickly (coming here from #1991298: Fatal error when installing Drupal on servers that don't have the cURL extension which may turn out to be relevant for it) but:

+        'description' => st('The installer requires to contact the translation server to download a translation file. Verify that your website can contact the translation server at <a href="!server_url">!server_url</a>. This fault may be caused by firewall or proxy settings.', array('!server_url' => $server_url)),
....
+          'description' => st('The %language translation file is not available at the translation server. <a href="!url">Choose a different language</a> or select English and translate your website later.', array('%language' => $language, '!url' => check_url($_SERVER['SCRIPT_NAME']))),

Why not add the "select English and translate your website later" text/link to the first message (and all others too)? That seems like a very important link, and (besides the back button) is the only way some people will get out of the hole they're in when they see this screen.

Also, the grammar here is wrong (both added via this patch and some of the existing messaging). Instead of "requires to contact" it should be something else... I think "failed to contact" would be fine here? But if "requires" is going to stay it should be something more like "requires a connection to" or "requires the ability to contact".

pixelite’s picture

Status: Needs review » Needs work

This patch needs to be re-rolled since the install.core.inc file has changed.

Re: comment #23, I would also recommend changing 'The installer requires to contact the translation server' to 'The installer failed to connect to the translation server'.

Sutharsan’s picture

Status: Needs work » Needs review
FileSize
0 bytes
PASSED: [[SimpleTest]]: [MySQL] 57,900 pass(es). View

Re-rolled the patch

Sutharsan’s picture

FileSize
2.98 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch interdiff-1912886-25-26.patch. Unable to apply patch. See the log in the details link for more information. View
7.83 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1912886-install-language-messages-26.patch. Unable to apply patch. See the log in the details link for more information. View
7.59 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1912886-install-language-messages-25_0.patch. Unable to apply patch. See the log in the details link for more information. View

Processed the comments in #23 and #24.
Bad patch added to #25, the right one added here.

Status: Needs review » Needs work

The last submitted patch, interdiff-1912886-25-26.patch, failed testing.

Cottser’s picture

Status: Needs work » Needs review

@Sutharsan - Name your interdiff ending in .txt, not .patch. That way it doesn't go through testbot :)

1912886-install-language-messages-26.patch still applies to HEAD as of today.

12345678912345678’s picture

Sutharsan’s picture

FileSize
7.83 KB
PASSED: [[SimpleTest]]: [MySQL] 59,060 pass(es). View

Re-rolled the patch.

Status: Needs review » Needs work

The last submitted patch, 1912886-install-language-messages-30.patch, failed testing.

gyuhyon’s picture

I've test installation without internet connection with patch #30 applied and worked as described.

language suggestion wrong

Just one additional idea for a better user experience.

Because user needs to change the language to English anyway,
it needs to detect internet connection before it suggest language to install and default installation language needs to be English
in case
1. the server can not download browser language
and
2. the distribution doesn't include language file with it.

Sutharsan’s picture

@gyuhyon, this suggestion requires the installation to contact the translation server. But we don't want to do this without the consent of the user. That's what the description below the select list refers to. Therefore your suggested improvement is not possible.

Sutharsan’s picture

Status: Needs work » Needs review

The failing test in #30 does pass locally. Lets run the testbot again...

Sutharsan’s picture

gyuhyon’s picture

Status: Needs review » Needs work

@Sutharsan, I agree with you re suggested function on contacting the translation with prior consent of user.

Then, the patch just need to pass the simple test.

Sutharsan’s picture

Status: Needs work » Needs review

Un-intentionally changed the status? Back to 'needs review', patch currently in bot's queue.

Sutharsan’s picture

Issue summary: View changes

Removed the dependency on #1887046

Sutharsan’s picture

Issue summary: View changes
FileSize
7.99 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1912886-install-language-messages-38.patch. Unable to apply patch. See the log in the details link for more information. View

Rerolled.

mgifford’s picture

Status: Needs review » Needs work

The last submitted patch, 38: 1912886-install-language-messages-38.patch, failed testing.

Gábor Hojtsy’s picture

Issue tags: +SprintWeekend2015Queue
adci_contributor’s picture

Status: Needs work » Needs review
FileSize
8.05 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch install-language-messages-1912886-43.patch. Unable to apply patch. See the log in the details link for more information. View

Trying to reroll.

YesCT’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

needs a beta evaluation (especially since this is a normal task). added instructions to the issue summary.

Gábor Hojtsy’s picture

This is an installer usability / user experience issue and as such should be among prioritized changes as per https://www.drupal.org/contribute/core/beta-changes (for that issue summary update).

develCuy’s picture

Gábor Hojtsy’s picture

@develCuy: are you working on this one?

develCuy’s picture

Issue tags: +SprintWeekend2015Queue

Removed SprintWeekend2015Queue by mistake.

keopx’s picture

Assigned: Unassigned » keopx
Status: Needs review » Needs work

I am working to reroll

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 43: install-language-messages-1912886-43.patch, failed testing.

keopx’s picture

Status: Needs work » Needs review
FileSize
8.04 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,402 pass(es). View

Here reroll

keopx’s picture

Assigned: keopx » Unassigned
Gábor Hojtsy’s picture

Issue tags: +Needs tests

Let's make sure we have tests.

keopx’s picture

Assigned: Unassigned » keopx
keopx’s picture

Assigned: keopx » Unassigned

@gábor-hojtsy

I am revised manually and works correctly.

Test this patch in the following situations:

  • Drupal 8 located on a server behind a firewall which blocks HTTP access to ftp.drupal.org
  • Drupal 8 located on a server behind a proxy server which blocks HTTP access to ftp.drupal.org
  • Drupal 8 located on a (localhost) server with no connection to internet
  • Drupal 8 located on a (localhost) server with an unreliable internet connection. E.g. 3G while traveling
  • Install with a non-existing language code in the url. E.g. core/install.php?langcode=xyz
  • And finally ;) Drupal 8 located on a (localhost) server a normal internet connection installing in a regular language.

Here some capture.

We (@jlbellido, @fran-seva) are trying do some test but we do not know if it is possible.

keopx’s picture

Attached captures, sorry

fran seva’s picture

Issue tags: +drupaldevdays
fran seva’s picture

Status: Needs review » Needs work

@Gabor I need more info to implement the tests :S

redsd’s picture

Version: 8.0.x-dev » 8.0.6
Priority: Normal » Major
Status: Needs work » Needs review
FileSize
996 bytes

Using drupal 8.0.6 it also gives the error

The translation server is offline.

The true error is:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

What I find strange is that the url that is checked is:
http://ftp.drupal.org/files/translations/8.x/drupal/drupal-8.0.6.nl.po

However when I check the GuzzleHttp output it tells me it calls:
https://ftp.drupal.org/files/translations/8.x/drupal/drupal-8.0.x.nl.po

This can pose problems for lots of people working on a webserver that doesn't have a certificate installed since there is no error and no easy way to fix it.

I created an fix that forces using http instead of https to make sure people will get past the first installation screen, since drupal is allready trying to call the http url I recon there is no problem with the fix?

Status: Needs review » Needs work

The last submitted patch, 60: install-server-offline-1912886-60-8.0.7.patch, failed testing.

redsd’s picture

Status: Needs work » Needs review
FileSize
497 bytes

Okay Apparently coding of the patch got messed up somehow, so we will try again but now an UTF-8 file.

Status: Needs review » Needs work

The last submitted patch, 62: install-server-offline-1912886-62-8.0.7.patch, failed testing.

redsd’s picture

another attempt to get the patch right for the test.
Still regarding issue for comment #60

redsd’s picture

Version: 8.0.6 » 8.0.x-dev
Status: Needs work » Needs review
FileSize
495 bytes

another attempt to get the patch right for the test (got to love this patch system)
Still regarding issue for comment #60

Status: Needs review » Needs work

The last submitted patch, 65: install-server-offline-1912886-65-8.0.7.patch, failed testing.

The last submitted patch, 65: install-server-offline-1912886-65-8.0.7.patch, failed testing.

redsd’s picture

Status: Needs work » Needs review
FileSize
484 bytes

See comment #60

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.

Kifah Meeran’s picture

The patch looks good to me and applies cleanly on Drupal 8.2.x

Kifah Meeran’s picture

Status: Needs review » Reviewed & tested by the community
vijaycs85’s picture

Status: Reviewed & tested by the community » Needs work

Sorry @Kifah Meeran, I disagree that this is RTBC. The patch we should use is in #52 and if you have tried it and it worked, then we need to add tests as per #54.

@redsd, all your patches from #60 have one line of code change and pretty much same. Are you trying to do something entirely different from what we got so far in #52?

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.