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

Create assets folder if it is missing when writing Report #19088

Merged
merged 2 commits into from Apr 13, 2022

Conversation

samjf
Copy link
Contributor

@samjf samjf commented Apr 13, 2022

Description:

We are receiving errors such as:

  • Scheduler: Error Unable to create output file
  • Scheduler: Error ReportRenderer: Could not write to file

This appears to happen when the assets directory doesn't exist in the tmp folder when the Scheduled reports task is run via ./console core:run-scheduled-task. This has been observed for pdf and csv.

It appears you can recreate this as such:

  • Create a report that can be generated
  • breakpoint if ($shouldExecuteTask) in Scheduler.php
  • Set $shouldExecuteTask to true.
  • if tmp/assets is missing at \Piwik\ReportRenderer::writeFile then the error will occur. This will also occur at $this->Error('Unable to create output file: '.$name); in tcpdf

Review

@samjf samjf added the Needs Review PRs that need a code review label Apr 13, 2022
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though that folder normally should already exist, it shouldn't hurt to double check that.

@sgiehl sgiehl removed the Needs Review PRs that need a code review label Apr 13, 2022
@sgiehl sgiehl added this to the 4.10.0 milestone Apr 13, 2022
@sgiehl sgiehl added the Stability For issues that make Matomo more stable and reliable to run for sys admins. label Apr 13, 2022
@sgiehl sgiehl merged commit fb27f95 into 4.x-dev Apr 13, 2022
@sgiehl sgiehl deleted the fix-report-renderer-output-failures branch April 13, 2022 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stability For issues that make Matomo more stable and reliable to run for sys admins.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants