9. Dev Troubleshooting Guide#
This page helps you diagnose and resolve common issues encountered during Maeser development and usage.
9.1. Environment & Installation Issues#
9.1.1. Virtual Environment Activation#
Symptom:
python
orpip
commands refer to system Python, not your.venv
.Solution: Ensure you activate correctly:
macOS/Linux:
source .venv/bin/activate
Windows PowerShell:
.venv\Scripts\Activate.ps1
Verify with
which python
(Unix),Get-Command python
(Windows PowerShell), orwhere.exe python
(Windows CMD). See also Check if the Virtual Environment is Active.
9.1.2. Dependency Conflicts#
Symptom:
pip install -e .
fails, orModuleNotFoundError
for installed packages.Solution:
Remove and recreate
.venv
:deactivate rm -rf .venv python3.10 -m venv .venv source .venv/bin/activate pip install -e .
Run
poetry lock
thenpoetry install --all-extras
to re-install dependencies.
9.2. Configuration & API Key Problems#
9.2.1. Missing OpenAI API Key#
Symptom:
InvalidRequestError
or LLM calls fail silently.Solution:
For scripts that use
config.py
(such as the examples inexample/apps/
) verify that OpenAPI key is set inconfig.yaml
, like so:OPENAI_API_KEY: "<your-key>"
For scripts that do not use
config.py
(such asexample/tools/embeddings_example.py
), set your OpenAPI key as an environment variable. Linux/MacOS:# Set the environment variable $ export OPENAI_API_KEY="<your-key>" # Confirm it was properly assigned $ $echo $OPENAI_API_KEY <your-key>
Windows (Powershell):
# Set the environment variable PS> $Env:OPENAI_API_KEY = '<your-key>' # Confirm it was properly assigned PS> echo $Env:OPENAI_API_KEY <your-key>
9.2.2. Incorrect Paths in config.yaml
#
Symptom:
FileNotFoundError
for vector stores or log directories.Solution:
Look for the following line in your terminal that prints when you start your Maeser application:
Using configuration at path/to/config.yaml (Priority 0)
Ensure that
path/to/config.yaml
is the expected path for yourconfig.yaml
file. If the path is incorrect, openconfig.py
and ensure yourconfig.yaml
file is located at one of theconfig_paths
.Verify the following fields point to existing locations:
vec_store_path
log_source_path
chat_history_path
accounts_db_path
9.3. Vector Store & Embedding Issues#
9.3.1. Empty or Irrelevant Retrievals#
Symptom: RAG returns unrelated or blank responses.
Solution:
In your
chat_logs/chat_history/
, check thecontext
field in your chat logs and verify that context is being retrieved from your vector stores.If your application is using Universal RAG, the chatbot skip context retrieval if no vectorstores are relevant. Check the names of your vectorstores and make sure they are descriptive to their respective topics to ensure that they are properly retrieved.
Confirm your vector store directories are correct and contain
index.faiss
andindex.pkl
files.Check your embedding step (e.g. in your script for embedding new content):
from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings()
Ensure embeddings have completed without errors.
Experiment with
chunk_size
/chunk_overlap
inRecursiveCharacterTextSplitter
.
9.3.2. FAISS Index/Vector Store Load Failures#
Symptom: Errors loading FAISS index (
IOError
,faiss
exceptions).Solution:
Ensure that your rag graphs (e.g.
get_universal_rag
) are configured with the correct paths to your FAISS vector stores.Confirm directory permissions:
chmod -R u+rw <vectorstore_folder>
.
9.4. Testing & Documentation Build Failures#
9.4.1. PyTest Errors#
Symptom:
pytest tests
fails with import or assertion errors.Solution:
Ensure editable install:
pip install -e .
Run pytests with verbose printing (on project root):
make testVerbose
Run individual tests to isolate failures:
pytest tests/test_module.py::test_function
9.4.2. Sphinx Build Errors#
Symptom:
make html
errors on missing references or invalid syntax.Solution:
Confirm that your virtual environment is activated.
Install docs extras:
make deps
(fromsphinx-docs/
directory) orpoetry install --only dev
Ensure that all cross-references in your
.md
/.rst
files are correct.
9.4.3. Sphinx TOCTree Warnings#
Symptom: Building the documentation yields one or more warnings that say,
WARNING: document isn't included in any toctree
.Solution:
Check
index.rst
and make sure that the document has been included in the table of contents.
9.5. Flask & Web Interface Issues#
9.5.1. Server Won’t Start#
Symptom:
Address already in use
orModuleNotFoundError
for controllers.Solution:
Change port: in
app.run(port=...)
.Verify
example/flask_example_user_management.py
uses correct imports and path.
9.5.2. Authentication Failures#
Symptom: GitHub OAuth redirect errors or LDAP bind failures.
Solution (GitHub):
In GitHub OAuth App settings, ensure that Homepage URL matches the url of your app and that Authorization callback URL matches
github_callback_uri
inconfig.py
.Check
github_client_id
andgithub_client_secret
are correct.
Solution (LDAP):
Verify LDAP URLs, base DN, and search filters in config.
Test binding with an LDAP client (e.g.,
ldapsearch
).
9.6. WSL Troubleshooting#
9.6.1. WSL File Permissions#
Symptom: Permission denied when accessing Windows files.
Solution:
Use
chmod
to grant permissions.If your project is set up in the Windows file system (
mnt/c/...
), consider moving it to the Linux file system (~/projects/...
). Be sure to runmake clean_venv
andmake setup
after you do this to reconfigure your virtual environment.
9.7. Getting Help#
GitHub Issues: Check for issues on the Maeser repository or open a new one.
Community Contributions: Submit documentation fixes or feature requests via a Pull Request.