Ticket #1474 (new defect)

Opened 14 months ago

Last modified 2 weeks ago

Bad error message publishing a page if you're not online

Reported by: bfcapell Owned by: ischommer
Priority: minor Milestone: 2.3.1
Component: CMS - General Version:
Severity: medium effort / impact Keywords:
Cc: Hours:

Description

Currently, if you are editing your site offline, you can't publish a page because of the Google Sitemaps support. SilverStripe? will try a ping (unless you explicitly use Sitemap::DisableGoogleNotification?()) and fail showing an "Error saving content" message which in fact is not true since the page has been correctly written.

Full php error message:

Error 2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: php_network_getaddresses

: getaddrinfo failed: host/servname not known. 

 At l203 in C:\lighttpd\htdocs\sapphire\core\HTTP.php

fsockopen(www.google.com,80,0,)

line 203 of HTTP.php

HTTP::sendRequest(www.google.com,/webmasters/sitemaps/ping,sitemap=http%3A%2F%2Flocalhost%3A3000%2F%2Fsitemap

.xml)

line 75 of Sitemap.php

Sitemap::Ping()

line 478 of CMSMain.php

CMSMain->performPublish(Object)

line 536 of LeftAndMain.php

LeftAndMain->save(Array,Object)

Change History

Changed 3 months ago by sminnee

  • priority changed from minor to medium
  • harvest_task set to (Unknown)
  • type changed from enhancement to defect

Changed 4 weeks ago by sminnee

  • milestone set to 2.3.1

This one is still broken. Make HTTP::sendRequest() throw a NetworkException and have GoogleSitemap::ping() or SiteTree::doPublish() catch that exception and ignore it.

Changed 2 weeks ago by ischommer

  • priority changed from medium to minor

I've disabled google notification by default in r66168, which decreases the urgenccy of this problem.

To my knowledge, fsockopen() or curl can't determine if the actual network connection exist *before* a timeout. You can set both to a "non-blocking-mode" which means you fire off the request without waiting for the response - this would have to be added to HTTP::sendRequest().

Changed 2 weeks ago by ischommer

  • owner changed from hsmith to ischommer
Note: See TracTickets for help on using tickets.