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

Add more debug information for some specific archiving errors #16387

Merged
merged 4 commits into from Sep 10, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 4, 2020

We are currently troubleshooting some archiving issue and this code we are customer to add in order to troubleshoot what is happening. This be great to have in general.

@tsteur tsteur added the Needs Review PRs that need a code review label Sep 4, 2020
@tsteur tsteur added this to the 4.0.0 RC milestone Sep 4, 2020
@@ -180,7 +180,7 @@ public function callAggregateAllPlugins($visits, $visitsConverted, $forceArchivi
$this->params->getSegment() ? sprintf("(for segment = '%s')", $this->params->getSegment()->getString()) : ''
);
} catch (Exception $e) {
throw new PluginsArchiverException($e->getMessage() . " - in plugin $pluginName", $e->getCode(), $e);
throw new PluginsArchiverException($e->getMessage() . " - in plugin $pluginName with trace: " . $e->getTraceAsString(), $e->getCode(), $e);
Copy link
Member

Choose a reason for hiding this comment

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

Note: this should be handled when printing out an exception via ExceptionToTextProcessor::getWholeBacktrace

@@ -1894,7 +1894,7 @@ protected function aggregateRowWithLabel(Row $row, $columnAggregationOps)
{
$labelToLookFor = $row->getColumn('label');
if ($labelToLookFor === false) {
throw new Exception("Label column not found in the table to add in addDataTable()");
throw new Exception("Label column not found in the table to add in addDataTable() for row " . var_export($row, 1));
Copy link
Member

Choose a reason for hiding this comment

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

This happened in the GA importer, when debugging I found it would be more useful to have archiver params here, ie idSite/period/date and maybe report name. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds good @diosmosis

btw is that bug issue fixed in the importer? I think the customer might have actually the issue with the importer

Copy link
Member

Choose a reason for hiding this comment

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

If it's the same bug, then yes, it was an issue in the Referrers.getWebsites report, one of them will have a blank label causing period aggregation to fail this way. Can be fixed by re-importing the specific day(s).

Do you want to add the debug code or should I?

@tsteur
Copy link
Member Author

tsteur commented Sep 6, 2020

@diosmosis added some code for this. Is this what you meant?

$message = sprintf("Label column not found in the table to add in addDataTable(). idSite: %s, Period: %s, Row: %s",
DataTableFactory::getSiteIdFromMetadata($this),
DataTableFactory::getPeriodStringFromMetadata($this),
var_export($row, 1)
Copy link
Member

Choose a reason for hiding this comment

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

This data is added after querying, I don't think it will be available at this point in the Archiver. I haven't tested though, just saw this.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's needed to get the archive processor params being used, perhaps throwing a custom exception, then catching and decorating it would work. Just thinking off the top of my head.

@tsteur
Copy link
Member Author

tsteur commented Sep 6, 2020

@diosmosis removed that information again. I don't want to spend too much time on this as we don't have the problem anymore and we never really before had that issue. Getting data from archiveProcessor would require a lot of changes by the looks.

@diosmosis
Copy link
Member

diosmosis commented Sep 6, 2020

👍 looks good, will merge if build passes

EDIT: actually it could be useful to have eventually... for example, someone could archive a year report and see this because a single day has the problem and needs to be re-imported. Having the request string wouldn't say which day has the problem, but having the archive params might.

I think I could add it pretty quickly (~15 mins at most) if it's still worth it. Let me know or feel free to merge.

@tsteur tsteur merged commit 748ac97 into 4.x-dev Sep 10, 2020
@tsteur tsteur deleted the debuginformation branch September 10, 2020 23:01
@mattab mattab modified the milestones: 4.0.0-RC, 4.0.0 Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants