The problem is caused by a mis-feature of tabu. In \tabu@init the package redefines several usual LaTeX commands, like \centering, \raggedright, \raggedleft (but also \fbox, \color etc.). For some of the commands this results in problems, if these are used in the page head or page footer while a longtabu is processed. Here is a MWE for this problem without using any page style package:
\documentclass{article}
\usepackage{longtable,tabu}
\usepackage{mwe}
\pagestyle{myheadings}
\begin{document}
\markright{\protect\parbox{2em}{\protect\centering One\\ Two}}
\lipsum[1-5]
\begin{longtabu}{lr}
first & row \\
second & row \\
third & row \\
fourth & row \\
fifth & row \\
sixth & row \\
\end{longtabu}
\end{document}
This also gives the error message from the question:
./test-longtabu.tex:15: Misplaced \cr.
\reserved@c ->\ifnum 0=`{}\fi \cr
l.15 \end{longtabu}
A real correction of the problem can only be done by the tabu maintainer. tabu should either not redefine all those macros or should restore correctly.
However, the easiest workaround for the problem is, not to use \\ but \par:
\documentclass{scrartcl}
\usepackage{longtable,tabu}
\usepackage{lipsum}
\usepackage{scrpage2}
\chead[Headline 1\par Headline 2]{Headline 1\par Headline 2}
\pagestyle{scrheadings}
\begin{document}
\lipsum[1-5]
\begin{longtabu}{XXX}
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
\end{longtabu}
\end{document}
But you should also switch over from deprecated scrpage2 to scrlayer-scrpage. Unfortunately, the current release of scrlayer-scrpage does not allow \par inside the argument of \chead (I've reported this already). This should be fixed in the next release of scrlayer-scrpage. Moreover scrlayer-scrpage v3.27 will provide a workaround for the tabu misfeature. So, with the current version from the subversion repository of KOMA-Script:
\documentclass{scrartcl}
\usepackage{longtable,tabu}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\chead*{Headline 1\\ Headline 2}
\pagestyle{scrheadings}
\begin{document}
\lipsum[1-5]
\begin{longtabu}{XXX}
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
Col1 & Col2 & Col3 \\
\end{longtabu}
\end{document}
does already work.
\@parboxrestorecommand to ensure that it has the correct definition of\\– David Carlisle Mar 27 '12 at 14:05longtableorscrpage2? I didn’t understand which package has the bug, but the redefinition thatlongtabledoes should be local in{longtable}, isn’t it? – Tobi Nov 28 '12 at 11:39\\is local to longtable but the page breaker works asynchonously and fires while longtable is active the header code if it is setting up multiline headers should execute\@parboxrestoreto locally reset the environment including the definition of\\I suppose LT could do this in its output routine wrapper but the proper place really is in the header code, the standard LaTeX headers are in a one line hbox so it is not an issue there. – David Carlisle Nov 28 '12 at 13:01\@outputpagedoes initially call\@parboxrestore. So LaTeX's output routine already restores\\before\@thehead.\cheaduses\centeringto center the element. This also redefines\\again. The problem is, thattaburedefines\centering(and several other usual macros). And this definition is still valid while building the head or foot. So the\centeringof\cheadisn't LaTeX's\centeringwhile thelongtabuis active. So the problem is, thattabudoes not restore the original definitions while the output is active. BTW: It's independent of the class. – Schweinebacke Apr 05 '19 at 06:27