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

Update Scheduled Reports with Multiple recipients on 2.16.1 #10096

Closed
mackieee opened this issue Apr 26, 2016 · 4 comments
Closed

Update Scheduled Reports with Multiple recipients on 2.16.1 #10096

mackieee opened this issue Apr 26, 2016 · 4 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@mackieee
Copy link

mackieee commented Apr 26, 2016

I'm getting a direct 500 error when attempting to update a report with multiple recipients. At the following POST URL:

analytics.websitename.com/index.php?date=2016-04-26&period=day&hour=19&idSite=1

With the following POST parameters (Taken literally from Chrome Dev tools):

module:API
method:ScheduledReports.updateReport
format:json
idReport:1
description:Daily Stats
idSegment:
reportType:email
reportFormat:html
reports[]:VisitsSummary_get
reports[]:VisitTime_getVisitInformationPerLocalTime
reports[]:Goals_get_idGoal--ecommerceOrder
reports[]:DevicesDetection_getType
reports[]:DevicesDetection_getBrowserVersions
parameters[displayFormat]:2
parameters[emailMe]:true
parameters[evolutionGraph]:false
parameters[additionalEmails][]:mackieee@gmail.com
token_auth:5bafcbd0838f3ab93f866a90b71d7e47

So when updating a report and adding a recipient 'one per line' at the _Send report to_ field group. Just add one or two then press 'Update Report' then the exception is immediately thrown and it's stuck on "please wait" on the report update.

{
"result":  "error",
"message": 
  "Uncaught TypeError: Argument 1 passed to Piwik\\API\\ResponseBuilder::getResponseException() must be an instance of Exception, instance of Error given, 
  called in \/home\/websitename\/public_html\/001_subdomains\/analytics\/core\/ExceptionHandler.php on line 90 and defined in \/home\/websitename\/public_html\/001_subdomains\/analytics\/core\/API\/ResponseBuilder.php:130 
  Stack trace:#0 \/home\/websitename\/public_html\/001_subdomains\/analytics\/core\/ExceptionHandler.php(90): Piwik\\API\\ResponseBuilder->getResponseException(Object(Error))
  #1 \/home\/websitename\/public_html\/001_subdomains\/analytics\/core\/ExceptionHandler.php(70): Piwik\\ExceptionHandler::getErrorResponse(Object(Error))
  #2 \/home\/websitename\/public_html\/001_subdomains\/analytics\/core\/ExceptionHandler.php(36): Piwik\\ExceptionHandler::dieWithHtmlErrorPage(Object(Error))
  #3 [internal function]: Piwik\\ExceptionHandler::handleException(Object(Error))#4 {main}  thrown"
}

I'm using the latest version of Piwik 2.16.1. I've tested this on:

  • Chrome (On Windows 7 & 10 )
  • Safari 8.0.8 (Mac)

This Piwik is self-hosted and is running on a subdomain.

If you need anything at all to help debug the issue or please point me in the direction if this has already been answered :)

@tsteur
Copy link
Member

tsteur commented Apr 27, 2016

I presume you are using PHP 7? Can you change Exception $e to just $e here https://github.com/piwik/piwik/blob/2.16.1/core/API/ResponseBuilder.php#L130 and see if you get a different error message?

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. and removed Bug For errors / faults / flaws / inconsistencies etc. labels Apr 27, 2016
@mackieee
Copy link
Author

First and foremost @tsteur my apologies for missing out on providing you vital and key information such as PHP Version! Yes indeed, this is running PHP 7.0.5.

Secondly, removing the Exception did start a small trail of removing other methods that also dependant on having Exception type hinted (Such as decorateExceptionWithDebugTrace() and around 4 others) which eventually came down to Piwik\\Plugins\\API\\Renderer\\Json::renderException(). After removing this last typehint, it provided this message gracefully:

image

Which I already immediately knew, I had seen an error message once before on the System check which had warned me of the missing iconv module. I hadn't rushed to have this fixed as the site is on a Shared VDS host - lazily!

Hence obviously it's not a bug, configuration error - sorry!

@mackieee
Copy link
Author

mackieee commented May 3, 2016

@tsteur I had iconv installed today by the shared host and no problem whatsoever since. My only suggestion is having the error more gracefully shown - regardless thank you for your time in commenting & helping.

Thank you for the awesome application too Piwik team! :)

@tsteur
Copy link
Member

tsteur commented May 3, 2016

Thanks for letting us know. I've created a follow up issue #10115 to tackle the error message problem.

@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label May 3, 2016
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

2 participants