\section{Troubleshooting}
\label{sec:troubleshooting}

\subsection{Overview}
\label{sec:troubleshooting:overview}

If you cannot find a problem elsewhere, check here before reporting it.  

Currently, these problems are as follows:
\begin{itemize}
    \item \hyperref[sec:troubleshooting:error1]{APERO processing pauses with no files after whitelisting.}
    \item \hyperref[sec:troubleshooting:error2]{ARI crashes inside \texttt{manual\_trigger}.}
    \item \hyperref[sec:troubleshooting:error3]{APERO Checks Google Sheet has no/few entries.}
    \item \hyperref[sec:troubleshooting:error4]{\texttt{manual\_trigger} is locked.}
\end{itemize}

% ------------------------------------------------------------------------------------------
\newpage
\subsection{APERO processing pauses with no files after whitelisting}
\label{sec:troubleshooting:error1}

You may get the following message: W[10-503-00007]: No files after whitelisting. Skipping 

If for some reason you expected no files for this night please type "N" 

If you expected files re-run the raw checks and then either report no files or try running the manual trigger again 

If you get this message again and expect files please report it to the core team: 

\begin{contacttable}
    \ccNeil{1} & \eeNeil \\
    \ccLison{} & \eeLison \\
    \ccEtienne{} & \eeEtienne \\
    \ccFred{} & \eeFred \\
    \ccThomas{} & \eeThomas \\
    \ccCharles{} & \eeCharles \\
    \hline
\end{contacttable}

Note typing `Y' or `N' will lead to a red error that will be reported in the checks. So recall that you will get that extra error in the error check table.

\subsection{ARI crashes inside manual trigger}
\label{sec:troubleshooting:error2}

Sometimes, ARI will crash in manual trigger,  
mostly when ARI is running in more than one place at once.  

This can be fixed by:
\begin{itemize}
    \item Waiting for other ARI instances to finish.
    \item Running the manual trigger with an added argument.
\end{itemize}

Running the manual trigger with added argument: \lstcode{--only_ari=True}

\subsection{APERO checks Google sheet has no or few entries}
\label{sec:troubleshooting:error3}

Sometimes APERO checks will get confused and delete old entries 

This is normally when multiple APERO checks ran at the same time 

If this happens contact:  

\begin{contacttable}
    \ccNeil{1} & \eeNeil \\
    \ccLison{} & \eeLison \\
    \ccEtienne{} & \eeEtienne \\
    \hline
\end{contacttable}

\subsection{Manual trigger is locked}
\label{sec:troubleshooting:error4}

We have a lock on uploading to the \lstcode{apero_checks} 

You may get the following error: 
\begin{bcodebox}[]{Bash}
\begin{lstlisting}[language=Bash, style=nonumbering]
Lock file timeout. Please remove: {lock file} manually
\end{lstlisting}
\end{bcodebox}

If this happens wait for any other processes to finish (or kill them) and then remove the file above and re-run all codes that were running.

The lock file is located in the \lstcode{apero_check} directory: 

\lstpath{/cosmos99/nirps/git-bin/apero-utils/nirps/apero_check/lock.lock} 
