Information Required ?
avatar nineoo
nineoo
11 Jan 2021

Steps to reproduce the issue

Following Install of J4 Beta 6, Allow stats to be sent to Joomla throws Runtime Exception:

Expected result

Choice to be accepted

Actual result

RuntimeException: Could not send site statistics to remote server: Invalid data submission.

System information (as much as possible)

PHP Built On Linux 2.6.32-954.3.5.lve1.4.78.el6.x86_64 #1 SMP Thu Mar 26 08:20:27 EDT 2020 x86_64
Database Type mysql
Database Version 10.3.25-MariaDB
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption No
PHP Version 7.4.13
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 4.0.0-beta6 Beta [ Mañana ] 7-January-2021 18:42 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36

Additional comments

Harald - attached is screenshot.
j4_error

As per specs above I changed the database collation from latin1_swedish_ci to utf8mb4_general_ci.

This was another fresh installation. I thought debugging might help but when I enabled it the error was gone. When I disabled debugging the error did not come back.

This has happened ever since I have been installing J4 and have ignored it in the past.

Note that this error does not occur with J3 installs in the same server environment (shared hosting with Rochen).

Thank you.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar nineoo nineoo - open - 11 Jan 2021
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Jan 2021
avatar HLeithner
HLeithner - comment - 11 Jan 2021

Can't replicate the issue, can you please click on "Select here to see the information that will be sent." and post a screenshot of the information? thx

avatar nineoo nineoo - change - 12 Jan 2021
The description was changed
avatar nineoo nineoo - edited - 12 Jan 2021
avatar Quy Quy - change - 14 Jan 2021
Labels Added: Information Required
avatar Quy Quy - labeled - 14 Jan 2021
avatar PhilETaylor
PhilETaylor - comment - 15 Jan 2021

I have been trying to replicate this and I can't, however, the underlying problem is that if the Joomla Statistics Server is down, in error, or just having a bad day, (Eg, throws an exception of 3 different types or doesnt return a 200 OK header) then the user is informed with a scary red error message.

see

private function sendStats()
{
try
{
// Don't let the request take longer than 2 seconds to avoid page timeout issues
$response = HttpFactory::getHttp()->post($this->serverUrl, $this->getStatsData(), [], 2);
}
catch (UnexpectedValueException $e)
{
// There was an error sending stats. Should we do anything?
throw new RuntimeException('Could not send site statistics to remote server: ' . $e->getMessage(), 500);
}
catch (RuntimeException $e)
{
// There was an error connecting to the server or in the post request
throw new RuntimeException('Could not connect to statistics server: ' . $e->getMessage(), 500);
}
catch (Exception $e)
{
// An unexpected error in processing; don't let this failure kill the site
throw new RuntimeException('Unexpected error connecting to statistics server: ' . $e->getMessage(), 500);
}
if ($response->code !== 200)
{
$data = json_decode($response->body);
throw new RuntimeException('Could not send site statistics to remote server: ' . $data->message, $response->code);
}
return true;

As the collection of stats is optional, a nice-to-have, and is in no way connected with a Joomla admins use of their site, I propose that the code above is changed to remove the throwing of exceptions that report to the user, unless in debug mode.

That way people using Joomla are not getting errors if the stats server is down (or other errors) unless they really want to by being in debug mode.

thoughts?

avatar nineoo
nineoo - comment - 18 Jan 2021

I only flagged this up as I felt that stats collection might be especially useful when moving from j3 to j4.

That said, some people will not send them anyway so your nice-to-have point is well made and in this instance with 2 out of 3 unable to replicate the issue it would still render a decent stats return rate.

Seems a sensible approach to me to remove the exception message as for me that error was my first impression of j4 after installation was completed.

Thank you both - it's good to see that all feed back on Joomla projects is considered which sadly, in other communities is not always the case.

I'm not a developer but am keen to see j4 make a great impression when it arrives and experience the greater adoption it deserves.

Well done to everyone working on this project - it's looking good!

avatar crimle
crimle - comment - 14 Feb 2021

I am on Joomla 4.0.0-beta8-dev and I am experiencing the same issue.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32005.
avatar sandramay0905
sandramay0905 - comment - 13 Apr 2021

Similar topic and part of solution #32022

avatar nineoo nineoo - change - 13 Apr 2021
The description was changed
avatar nineoo nineoo - edited - 13 Apr 2021
avatar PhilETaylor
PhilETaylor - comment - 15 Apr 2021

PR #33149

avatar alikon alikon - change - 16 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-16 06:22:38
Closed_By alikon
avatar alikon alikon - close - 16 Apr 2021
avatar alikon
alikon - comment - 16 Apr 2021

please test #33149

Add a Comment

Login with GitHub to post a comment