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
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.
Comment | File | Size | Author |
---|---|---|---|
#68 | install-server-offline-1912886-68-8.0.7.diff | 484 bytes | redsd |
#65 | install-server-offline-1912886-65-8.0.7.patch | 495 bytes | redsd |
#64 | install-server-offline-1912886-62-8.0.7.patch | 495 bytes | redsd |
#62 | install-server-offline-1912886-62-8.0.7.patch | 497 bytes | redsd |
#60 | install-server-offline-1912886-60-8.0.7.patch | 996 bytes | redsd |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedProposal 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.
Comment #2
Sutharsan CreditAttribution: Sutharsan commentedTagging
Comment #3
Sutharsan CreditAttribution: Sutharsan commentedThe 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.
Small change to the issue title to identify the issue scope (installer).
Comment #4
vijaycs85@Sutharsan, I applied patch in #3 and getting below error when try to install fresh (no settings.php, no defualt/files/ and empty DB).
Comment #5
Sutharsan CreditAttribution: Sutharsan commented@vijaycs85, this error makes sense, it is a core bug and is being worked on. See the issue description.
Comment #5.0
Sutharsan CreditAttribution: Sutharsan commentedUpdated issue summary.
Comment #5.1
Sutharsan CreditAttribution: Sutharsan commentedTest-suggestion added
Comment #6
Sutharsan CreditAttribution: Sutharsan commented@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.
Comment #7
vijaycs85Thanks 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...
Comment #8
YesCT CreditAttribution: YesCT commentedthis manual testing, is probably more complicated than typical novice, so tagging medium
Comment #9
Sutharsan CreditAttribution: Sutharsan commented@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.
Comment #10
Sutharsan CreditAttribution: Sutharsan commented@vijaycs, I misread your question. Your error should read "failed to connect". I think something went wrong with applying your patch.
Comment #11
vijaycs85@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.
I can confirm the translation unavailable scenario as well:
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.
Guess, we can RTBC, if you are OK with this test.
Comment #12
vijaycs85Updating screenshots in #10.
Comment #13
YesCT CreditAttribution: YesCT commented#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.
Comment #14
vijaycs85#3: install-language-requirements-1912886-3.patch queued for re-testing.
Comment #15
vijaycs85Just re-testing... AFAIK, code looks fine to me.
Comment #16
vijaycs85#3: install-language-requirements-1912886-3.patch queued for re-testing.
Comment #18
YesCT CreditAttribution: YesCT commented#3: install-language-requirements-1912886-3.patch queued for re-testing.
Comment #19
YesCT CreditAttribution: YesCT commented#3: install-language-requirements-1912886-3.patch queued for re-testing.
Comment #20
vijaycs85#3: install-language-requirements-1912886-3.patch queued for re-testing.
Comment #22
vijaycs85Re-rolling...
Comment #23
David_Rothstein CreditAttribution: David_Rothstein commentedOnly 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:
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".
Comment #24
pixeliteThis 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'.
Comment #25
Sutharsan CreditAttribution: Sutharsan commentedRe-rolled the patch
Comment #26
Sutharsan CreditAttribution: Sutharsan commentedProcessed the comments in #23 and #24.
Bad patch added to #25, the right one added here.
Comment #28
star-szr@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.
Comment #29
_12345678912345678 CreditAttribution: _12345678912345678 commented#26: 1912886-install-language-messages-26.patch queued for re-testing.
Comment #30
Sutharsan CreditAttribution: Sutharsan commentedRe-rolled the patch.
Comment #32
gyuhyon CreditAttribution: gyuhyon commentedI've test installation without internet connection with patch #30 applied and worked as described.
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.
Comment #33
Sutharsan CreditAttribution: Sutharsan commented@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.
Comment #34
Sutharsan CreditAttribution: Sutharsan commentedThe failing test in #30 does pass locally. Lets run the testbot again...
Comment #35
Sutharsan CreditAttribution: Sutharsan commented#30: 1912886-install-language-messages-30.patch queued for re-testing.
Comment #36
gyuhyon CreditAttribution: gyuhyon commented@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.
Comment #37
Sutharsan CreditAttribution: Sutharsan commentedUn-intentionally changed the status? Back to 'needs review', patch currently in bot's queue.
Comment #37.0
Sutharsan CreditAttribution: Sutharsan commentedRemoved the dependency on #1887046
Comment #38
Sutharsan CreditAttribution: Sutharsan commentedRerolled.
Comment #39
mgifford38: 1912886-install-language-messages-38.patch queued for re-testing.
Comment #42
Gábor HojtsyComment #43
adci_contributor CreditAttribution: adci_contributor commentedTrying to reroll.
Comment #44
YesCT CreditAttribution: YesCT commentedneeds a beta evaluation (especially since this is a normal task). added instructions to the issue summary.
Comment #45
Gábor HojtsyThis 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).
Comment #46
DevElCuy CreditAttribution: DevElCuy commentedComment #47
Gábor Hojtsy@develCuy: are you working on this one?
Comment #48
DevElCuy CreditAttribution: DevElCuy commentedRemoved SprintWeekend2015Queue by mistake.
Comment #49
keopxI am working to reroll
Comment #52
keopxHere reroll
Comment #53
keopxComment #54
Gábor HojtsyLet's make sure we have tests.
Comment #55
keopxComment #56
keopx@gábor-hojtsy
I am revised manually and works correctly.
Test this patch in the following situations:
Here some capture.
We (@jlbellido, @fran-seva) are trying do some test but we do not know if it is possible.
Comment #57
keopxAttached captures, sorry
Comment #58
fran seva CreditAttribution: fran seva commentedComment #59
fran seva CreditAttribution: fran seva commented@Gabor I need more info to implement the tests :S
Comment #60
redsd CreditAttribution: redsd commentedUsing drupal 8.0.6 it also gives the error
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?
Comment #62
redsd CreditAttribution: redsd commentedOkay Apparently coding of the patch got messed up somehow, so we will try again but now an UTF-8 file.
Comment #64
redsd CreditAttribution: redsd commentedanother attempt to get the patch right for the test.
Still regarding issue for comment #60
Comment #65
redsd CreditAttribution: redsd commentedanother attempt to get the patch right for the test (got to love this patch system)
Still regarding issue for comment #60
Comment #68
redsd CreditAttribution: redsd commentedSee comment #60
Comment #71
MaskyS CreditAttribution: MaskyS at Google Code-In commentedThe patch looks good to me and applies cleanly on Drupal 8.2.x
Comment #72
MaskyS CreditAttribution: MaskyS at Google Code-In commentedComment #73
vijaycs85Sorry @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?