Error Handling and Categorization Guide¶
Overview¶
The Jupyter Notebook Validator Operator implements comprehensive error categorization to help users quickly identify and resolve issues. This guide explains the error categories, how to interpret them, and recommended solutions.
Error Categories¶
1. configuration_error¶
Description: Issues with the NotebookValidationJob configuration or notebook file location.
Common Causes: - Notebook file not found at specified path - Invalid Git repository URL - Missing required configuration fields - Invalid service account name
Example Error:
Resolution:
- Verify the notebook path in your NotebookValidationJob spec
- Check that the Git repository URL is correct
- Ensure the notebook exists in the specified branch
- Review the sample configurations in config/samples/
2. dependency_install_failed¶
Description: Papermill or other Python dependencies failed to install.
Common Causes: - Permission issues in the container (most common on OpenShift) - Missing Python development tools (pip, setuptools) - Network connectivity issues - Incompatible Python version
Example Error:
Failed to install Papermill. This may be due to:
1) Insufficient permissions in the container
2) Missing Python development tools
3) Network connectivity issues
Check that the base image supports user-level pip installs or consider using a custom image with Papermill pre-installed.
Resolution:
Option A: Use a Custom Image (Recommended)¶
Create a custom Jupyter image with Papermill pre-installed:
FROM quay.io/jupyter/scipy-notebook:latest
USER root
RUN pip install --no-cache-dir papermill nbformat nbconvert
USER ${NB_UID}
Build and push:
podman build -t quay.io/your-org/jupyter-papermill:latest .
podman push quay.io/your-org/jupyter-papermill:latest
Update your NotebookValidationJob:
Option B: Verify Environment Variables¶
The operator sets these environment variables for OpenShift compatibility:
- HOME=/workspace
- PYTHONUSERBASE=/workspace/.local
- PIP_USER=1
- PIP_NO_CACHE_DIR=1
If you're still seeing permission errors, check the pod logs:
Look for the environment diagnostics:
Environment: HOME=/workspace, PYTHONUSERBASE=/workspace/.local
User: 1000920000:1000920000
Writable check: YES
3. environment_setup_failed¶
Description: The validation environment could not be properly configured.
Common Causes: - Permission errors writing to directories - Security Context Constraints (SCC) violations on OpenShift - Volume mount issues - Insufficient disk space
Example Error:
Notebook execution failed due to permission errors.
Check that the container has write access to required directories.
Resolution:
For OpenShift Users:¶
-
Verify SCC Compliance: The operator is designed to work with OpenShift's
restricted-v2SCC. Do NOT useanyuidSCC. -
Check Service Account: Ensure you're using the correct service account:
-
Verify Volume Mounts: Check that the workspace volume is writable:
For Kubernetes Users:¶
-
Check Security Context: Verify the pod's security context allows writing to
/workspace -
Verify PVC: If using persistent volumes, ensure they're writable
4. notebook_execution_failed¶
Description: The notebook code itself failed during execution.
Common Causes: - Python code errors (NameError, TypeError, AttributeError) - Missing Python modules not caught by dependency check - Logic errors in notebook cells - Resource constraints (OOM, timeout)
Example Error:
Resolution:
-
Review Execution Logs: Check the detailed execution log:
-
Check Cell Results: The results JSON includes per-cell execution status:
-
Test Locally: Run the notebook locally with Papermill:
-
Check Resource Limits: Increase memory/CPU if needed:
Status Conditions¶
The operator sets Kubernetes conditions to track validation progress:
Condition Types¶
Ready: Overall readiness of the validation jobGitCloned: Git repository clone statusValidationStarted: Validation execution startedValidationComplete: Validation finished (success or failure)EnvironmentReady: Environment setup status
Condition Reasons¶
Initializing: Job is being initializedGitCloneInProgress: Cloning Git repositoryGitCloneSucceeded: Git clone completed successfullyGitCloneFailed: Git clone failedPodCreated: Validation pod createdPodRunning: Validation pod is runningPodSucceeded: Validation completed successfullyPodFailed: Validation failedEnvironmentSetupFailed: Environment setup failedDependencyInstallFailed: Dependency installation failedNotebookExecutionFailed: Notebook execution failedConfigurationError: Configuration error detected
Checking Conditions¶
Example output:
conditions:
- lastTransitionTime: "2025-11-08T10:00:00Z"
message: "Failed to install Papermill. Consider using a custom image."
reason: DependencyInstallFailed
status: "False"
type: EnvironmentReady
Best Practices¶
1. Use Custom Images for Production¶
Pre-install all dependencies in a custom image:
FROM quay.io/jupyter/scipy-notebook:latest
USER root
# Install Papermill and common ML libraries
RUN pip install --no-cache-dir \
papermill \
nbformat \
nbconvert \
scikit-learn \
pandas \
numpy \
matplotlib
USER ${NB_UID}
2. Test Notebooks Locally First¶
Before deploying to the operator, test with Papermill locally:
3. Use Appropriate Resource Limits¶
Set realistic resource limits based on your notebook's requirements:
spec:
podConfig:
resources:
limits:
memory: "8Gi" # For ML training
cpu: "4"
requests:
memory: "4Gi"
cpu: "2"
4. Monitor Validation Jobs¶
Use the operator's observability features:
# Check job status
oc get notebookvalidationjob
# View detailed status
oc describe notebookvalidationjob <job-name>
# Check pod logs
oc logs <validation-pod-name>
5. Handle Transient Failures¶
The operator automatically retries transient failures with exponential backoff. For persistent failures, check the error category and follow the resolution steps above.
Troubleshooting Workflow¶
-
Check Job Status:
-
Identify Error Category: Look for
error_categoryin the status message or results JSON -
Review Pod Logs:
-
Check Conditions:
-
Apply Resolution: Follow the resolution steps for the specific error category
-
Retest: Delete and recreate the NotebookValidationJob:
Getting Help¶
If you encounter issues not covered in this guide:
- Check the ADR documentation for architectural decisions
- Review the OpenShift compatibility guide
- Open an issue on GitHub with:
- Error category
- Full error message
- Pod logs
- NotebookValidationJob YAML (sanitized)