Codebeat
Codebeat

Reputation: 6610

Only mobile safari cannot open the page, no internet message

At first, I don't own an iPad but some clients reports some weird problem with a website of mine on the iPad. They cannot open any page on the website, they end up with a blank page with the message: "Safari cannot open webpage as it is not connected to internet".

The message is a kind of weird because the user can open other websites and they are connected to the internet. Sometimes you will see the webpage for a split second and then the same message.

Yesterday a friend of mine (he is not a programmer) brings his iPad 3 with IOS7 to test it but we cannot figure out what the problem is because Safari do not share some debug info (at least you need a mac to see debug info and I don't own a mac either).

I test the same version of the website locally on a Windows machine to be sure it is not a hosting problem. The same error on iPad Safari, so there is a problem with the served files.

The website is programmed with PHP. What I have tested so far (and didn't lead to solution):

The problem is still there. It is very difficult to test what is going wrong without any debug info of Safari, can somebody see what going on in the safari browser that cause this error?

The website: http://www.meezingeninrotterdam.nl

And does this error also occur on the MAC version of Safari?

EDIT: Report the error to Apple: Apple Safari Error Bug Report

UPDATE:

Think I find the reason, see also my solution. If you have an iDevice, do you want to test it to confirm? See my solution below.

UPDATE 2

See answer, answer from Apple. No solution. If you know the solution or workaround, please let me know.

Upvotes: 4

Views: 15962

Answers (8)

Gregory Rusakov
Gregory Rusakov

Reputation: 33

I've stumbled upon the similar problem today. Safari was unable to open my https website on Mac and iPhone as well, but other browsers open it pretty good. Safari resets the connection and shows the message like this "Safari can't open the page because the network connection was reset" The problem was solved by adding this line

ssl_session_cache shared:SSL:1m;

to nginx config file in the "server {..}" block

Upvotes: 0

SammyK
SammyK

Reputation: 993

I was having this issue where Safari would return the message Safari cannot open the page because the network connection was lost. My client was having the issue but it was working fine for me. I was eventually able to replicate the issue using the iOS Simulator for an iPhone 7 on iOS 10.2.

The server is running Ubuntu 14.04 (trusty) using nginx 1.4.6 and the site is using a SSL/TLS cert from Let's Encrypt.

I monitored the error log using sudo tail -f /var/log/nginx/error.log

Each time I refreshed the site in the iPhone simulator, it generated three new error messages on the server:

2016/12/22 17:48:39 [alert] 8071#0: worker process 12812 exited on signal 11 (core dumped)
2016/12/22 17:48:39 [alert] 8071#0: worker process 12848 exited on signal 11 (core dumped)
2016/12/22 17:48:40 [alert] 8071#0: worker process 12846 exited on signal 11 (core dumped)

After some digging it turns out there's a bug with how nginx talks to OpenSSL.

Obvious workaround is to use the same session cache for all server blocks, e.g. to configure it on the http{} level.

We had the following ssl_session_cache option set in each virtual host's server scope in /etc/nginx/sites-available/:

ssl_session_cache shared:SSL:50m;

I removed this configuration line from each of the virtual host configurations under /etc/nginx/sites-available/ and added it back under the http scope in the main /etc/nginx/nginx.conf config file.

After restarting nginx with sudo service nginx restart, the problem was resolved for us. :)

Upvotes: 6

bbrinck
bbrinck

Reputation: 416

Is there any chance that you're using gzip compression for your pages? I had a similar issue where my CSS would appear for a split second on mobile Safari on iOS 7, but then I'd get the error "Safari cannot open the page because the network connection was lost."

Once I turned off gzip compression for my site, the page started working fine again.

It's a long shot, but it's worth a try.

Upvotes: 0

Codebeat
Codebeat

Reputation: 6610

Oh really, now I know it for sure, Apple support sucks.

This is the e-mail I received today in my mailbox.

Hello Erwinus,

Engineering has determined that your bug report is a duplicate of another issue and will be closed. 

The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.

Example:

13556600 User interface anomaly in OS X

State: Duplicate                   Product: OS X
Rank: 3 - Medium
---------------------------------------------------------------
Duplicate of 10535951 (Open)
---------------------------------------------------------------

Okay, now I know it is a bug but what kind of workaround can I use? Nope, no answer. When I search for the issue ID #10535951 in the Bug Reporter it cannot find it!

This is the answer my friends, don't waste your time register and to report a bug to help these guys.

Problem unsolved!

If you know a workaround or a solution better than this awful piece of support, please let me know.

Upvotes: 0

Codebeat
Codebeat

Reputation: 6610

All right, think I got it but must be confirmed by Apple iDevice users since I didn't own such device.

I get access to the error log files on the server. There are some interesting lines to find, such one as this:

[error] [client 81.204.47.42] mod_security: Access denied with code 500. Pattern match "Mozilla/(4|5)\\\\.0$" at HEADER("USER-AGENT") [hostname "www.meezingeninrotterdam.nl"] [uri "/data:image/x-icon;base64,AAABAAEAICAAAAAAAACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////ACCB2AA/TVgAjMPXAG ... etc etc

The favicon in the html page is base64 encoded, but Safari on the iDevice tries to load it from the server. Such encoded icon works perfectly on a old Safari version for Windows for example. Because in the URL you see path slashes (for example the string '////'), the server sees this as an abnormal encoding and throws an internal server error (code 500).

This doesn't have to be a problem when not the base content such as the html file throws this error. This is a serious bug in Safari, when one piece (file that belongs to the page) of the page throws a 500 error it doesn't display the whole page.

I have not tested this yet because I don't own an iDevice. I want also test it with a page that throws a 500 error to check if the same error message ("Safari cannot open webpage as it is not connected to internet") appear on Safari. When true, it is a stupid message because there is an internet connection but only the page is not accessible.

I have removed the base64 encoded favicon and apple-touch-icon from the page so I think it must load normally now.

Can somebody with an iDevice (iPad/iPhone etc) confirm this? If it loads normally, the case description of above is the problem.

Website address is: http://www.meezingeninrotterdam.nl (don't forget to refresh the content if you have been there once).

Upvotes: 0

Aaron Hall
Aaron Hall

Reputation: 1

I had this same problem on one of my own sites. I noticed that it worked on my development server, and that it was running a newer version the FastCGI (2.4.7 vs. 2.4.6) module. As a shot in the dark, I installed the newer FastCGI 2.4.7 on my production system and it solved the problem.

If you aren't using FastCGI, maybe the changelog will at least point you in the right direction: http://files.directadmin.com/services/custombuild/mod_fastcgi-2.4.7/CHANGES

Upvotes: 0

Charlie74
Charlie74

Reputation: 2903

I can also confirm the same errors in Safari for Mac:

4event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."

Looks like a jQuery / webkit issue you're having? Take a look at this post over here regarding the same thing...

WebKit issues with event.layerX and event.layerY

Also, when I open the site on my iPhone 5 running iOS7 in Safari, I get this error:

Safari cannot open the page because the network connection was lost.

If I open it in Chrome on the iPhone, it says:

The webpage is not available

Hope all that info helps... looks like a definite code issue with some properties on the site... or the way jQuery is being used.

UPDATE

Looking through your CSS code, I think the problem may be some bad CSS the browsers don't like. This line has a problem:

.dialog .error .err{color:#FFF;text-shadow:0px 0px 10px; #FF0000;padding:0 0 0 2px;clear:both;}

Look at the section I have in bold. You have a color specified but no matching property with it. I can't say that's the ONLY problem... but fixing that would be a good start.

Upvotes: 1

kevindeleon
kevindeleon

Reputation: 1924

I can confirm that this is broken on my iPhone 5S in iOS7. I will say that in Safari on Mac I am receiving the following warning:

"4event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."

Not sure if that is your problem or not, but that is the only error I see on safari for mac.

I hooked the phone up to my mac and tried using the developer console...The only errors I am seeing are:

Failed to load resource: the network connection was lost Invalid CSS property declaration #FF0000 in general.css

Hope something in there helps. The only thing else I could think is that maybe your server is sending a header that iOS7 doesn't like.

Upvotes: 1

Related Questions