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

Exception: Trying to log a message that is not a string #7535

Closed
mattab opened this issue Mar 25, 2015 · 2 comments
Closed

Exception: Trying to log a message that is not a string #7535

mattab opened this issue Mar 25, 2015 · 2 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Mar 25, 2015

The goal of this issue is to solve the problem where when an error occurs in schedule task, the core:archive throws an exception message: Trying to log a message that is not a string. Instead logger should not throw so the console command can handle and report to user the error.

Reproduce:

  • do not setup mail server on your server
  • create a scheduled daily report
  • run core:archive command

Output:

ERROR CoreConsole[2015-03-25 22:51:04] Got invalid response from API request: http://locahost/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=removed&trigger=archivephp. Response was 'sendmail: fatal: open /etc/postfix/main.cf: No such file or directory task,output Piwik\Plugins\CoreAdminHome\Tasks.purgeOutdatedArchives,Time elapsed: 0.419s Piwik\Plugins\ScheduledReports\API.sendReport_1,ERROR: An error occured while sending 'HTML Email Report - 1.2015-03-18.1.en.html'  to test@test.com. Error was 'Unable to send mail. ' Piwik\Plugins\CoreAdminHome\Tasks.purgeInvalidatedArchives,Time elapsed: 0.003s Piwik\Plugins\PrivacyManager\Tasks.deleteReportData,Time elapsed: 0.004s Piwik\Plugins\PrivacyManager\Tasks.deleteLogData,Time elapsed: 0.003s Piwik\Plugins\CorePluginsAdmin\Tasks.clearAllCacheEntries,Time elapsed: 0.000s Piwik\Plugins\CorePluginsAdmin\Tasks.sendNotificationIfUpdatesAvailable,Time elapsed: 0.001s Piwik\Plugins\CoreAdminHome\Tasks.optimizeArchiveTable,Time elapsed: 0.070s Piwik\Plugins\CoreUpdater\Tasks.sendNotificationIfUpdateAvailable,Time elapsed: 0.000s'
ERROR CoreConsole[2015-03-25 22:51:04] Trying to log a message that is not a string

  [Exception]                                   
  Trying to log a message that is not a string  
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 25, 2015
@mattab mattab added this to the Piwik 2.13.0 milestone Mar 25, 2015
@mnapoli mnapoli self-assigned this Mar 26, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Mar 26, 2015

#7542 prevents the logger from throwing an exception now (it will just log a warning). However I couldn't reproduce locally, if you can just run the same command with -v and paste the stack trace that would help to fix the original issue, thanks.

@mattab mattab modified the milestones: Piwik 2.12.1, Piwik 2.13.0 Mar 26, 2015
@mattab
Copy link
Member Author

mattab commented Mar 26, 2015

Looks good! I will try with -v and if it happens again will put stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants