Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception has been thrown during the rendering of a template #17707

Closed
issuesreporting opened this issue Jun 24, 2021 · 12 comments
Closed

An exception has been thrown during the rendering of a template #17707

issuesreporting opened this issue Jun 24, 2021 · 12 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@issuesreporting
Copy link

We upgraded Matomo from version 3.14.0 to 4.1.0 and observed a bug.
After upgrading to 4.2.1 and later 4.3.1 bug is still there.

The error message we observe after upgrade to 4.1.0 and every version mentioned is following:


   An exception has been thrown during the rendering of a template ("Segment cannot be added because no sql segment is set").
   in /usr/local/www/matomo/plugins/CoreHome/templates/getDefaultIndexView.twig line 7  

  • Matomo Version: 4.1.0, 4.2.1, 4.3.1
  • PHP Version:7.2
  • Server Operating System: Free BSD 12.2-RELEASE amd64
@issuesreporting issuesreporting added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jun 24, 2021
@sgiehl
Copy link
Member

sgiehl commented Jun 24, 2021

Hi @issuesreporting. How exactly did you perform the update? Using the auto update or did you perform it manually?

@issuesreporting
Copy link
Author

Using
php72 console core:update --yes

@diosmosis
Copy link
Member

Hi @issuesreporting, are you using any plugins that aren't provided by default with Matomo? Can you access the system report and provide the result here (either through the UI or via the diagnostics:run command)?

@issuesreporting
Copy link
Author

With third party plugins and without third party plugins behavior is the same. No changes has been observed.

Here is log of diagnostic:run



% php72 console diagnostics:run
INFO [2021-06-28 23:23:03] 99888  Unable to test if mod_pagespeed is enabled: the request to http://unknown/console?module=Installation&action=getEmptyPageForSystemCheck failed
Required Private Directories:
	- WARNING Unable to execute check for https://statistics0.editedaddress.com/config/config.ini.php: curl_exec: SSL: no alternative certificate subject name matches target host name 'statistics0.editedaddress.com'. Hostname requested was: statistics0.editedaddress.com
	- WARNING Unable to execute check for https://statistics0.editedaddress.com/tmp/: curl_exec: SSL: no alternative certificate subject name matches target host name 'statistics0.editedaddress.com'. Hostname requested was: statistics0.editedaddress.com
	- WARNING Unable to execute check for https://statistics0.editedaddress.com/tmp/empty: curl_exec: SSL: no alternative certificate subject name matches target host name 'statistics0.editedaddress.com'. Hostname requested was: statistics0.editedaddress.com
	- WARNING Unable to execute check for https://statistics0.editedaddress.com/lang/en.json: curl_exec: SSL: no alternative certificate subject name matches target host name 'statistics0.editedaddress.com'. Hostname requested was: statistics0.editedaddress.com
	- OK All private directories are inaccessible from the internet.
File integrity: WARNING File integrity check failed and reported some errors. You should fix this issue and then refresh this page until it shows no error.Directories were found in your Matomo, but we didn't expect them.
--> Please delete these directories to prevent errors. <--Directory to delete: libs/bower_componentsTo delete all these directories at once, you can run this command:
rm -Rf /usr/local/www/matomo/libs/bower_componentsFiles were found in your Matomo, but we didn't expect them.
--> Please delete these files to prevent errors. <--File to delete: robots.txt.pkgsaveTo delete all these files at once, you can run this command:
rm "/usr/local/www/matomo/robots.txt.pkgsave"Errors below may be due to a partial or failed upload of Matomo files.
--> Try to reupload all the Matomo files in BINARY mode. <--File size mismatch: /usr/local/www/matomo/misc/log-analytics/import_logs.py (expected length: 106454, found: 106460)
Setup Cron (faster report loading): WARNING For optimal performance and a speedy Matomo, it is highly recommended to set up a crontab to automatically archive your reports, and to disable browser triggering in the Matomo settings. Learn more.
Browser and Auto-archiving enabled: WARNING It looks like both browser and auto archiving are enabled. Auto archiving last started 22 hours 23 min ago. If auto archiving is enabled, you should disable browser archiving in "General Settings".
Database abilities:
	- WARNING UTF8mb4 charsetYour database supports utf8mb4 charset, but your database tables have not been converted yet. You can do this by executing the command /usr/local/www/matomo/console core:convert-to-utf8mb4 or activating the automatic conversion in General Settings.This is required to be able to store 4-byte UTF8 characters. Unless utf8mb4 is available special characters, such as emojis, less common characters of asian languages, various historic scripts or mathematical symbols will be replaced with �. You can read more details about this topic in this FAQ.	- OK LOAD DATA INFILE
	- OK CREATE TEMPORARY TABLES
	- OK Changing transaction isolation level
Forced SSL Connection: WARNING We recommend using Matomo over secure SSL connections only. To prevent insecure access over http, add force_ssl = 1 to the General section in your Matomo config/config.ini.php file.Attention: Doing this without having set up a SSL certificate for using HTTPS will break Matomo.
6 warnings detected


@diosmosis
Copy link
Member

@issuesreporting there doesn't seem to be anything of interest in the system report. And unfortunately the error doesn't have much context there. Would you be able to apply this patch: https://github.com/matomo-org/matomo/compare/17707-patch?expand=1 and provide the error message?

@issuesreporting
Copy link
Author

Segment cannot be added because no sql segment is set (for dimension Custom Variable name, ID = CustomVariables.CustomVariableName)

@sgiehl
Copy link
Member

sgiehl commented Jul 28, 2021

@issuesreporting was the custom variables plugin maybe disabled?

@issuesreporting
Copy link
Author

It was enabled. Disabling pluging CustomVariables solved problem. Is this the expected behavior?

@diosmosis
Copy link
Member

@issuesreporting are there any custom_var_v*, custom_var_k* columns in your log_visit or log_link_visit_action tables? I think this could happen if you have CustomVariables activated, but have no custom variable columns in your database.

@issuesreporting
Copy link
Author

There only are custom_dimension_1 custom_dimension_2 custom_dimension_3 custom_dimension_4 custom_dimension_5 and no custom_var* at all.

@sgiehl
Copy link
Member

sgiehl commented Aug 9, 2021

@issuesreporting Those columns would have been added when installing the CustomVariables plugin. Might been an edge case though. Guess you never had the CustomVariables plugin active? It was included in Matomo prior version 4.0. And was then moved to the marketplace. For existing installs it should have simply been updated to the latest version when updating Matomo. Not sure why it was activated during update or the columns were never installed in the first place.

@sgiehl
Copy link
Member

sgiehl commented Nov 13, 2022

@issuesreporting I hope you managed to solve that problem for you. As there hadn't been any similar reports and no activity within a year, I'm closing this issue now.

@sgiehl sgiehl closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2022
@sgiehl sgiehl added answered For when a question was asked and we referred to forum or answered it. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants