Troubleshooting Guide
This guide covers common issues you might encounter while developing or using the DZDK CLI, along with their solutions.Installation Issues
Python Version Error
Problem:-
Check your Python version:
-
Install Python 3.8 or higher:
- macOS:
brew install python@3.10 - Ubuntu/Debian:
sudo apt install python3.10 - Windows: Download from python.org
- macOS:
-
Use the correct Python version:
Virtual Environment Not Activating
Problem:Dependency Installation Fails
Problem:-
Ensure you’re in a virtual environment:
-
Upgrade pip:
-
Install dependencies:
-
If specific packages fail, try installing them individually:
CLI Command Not Found After Installation
Problem:-
Ensure the package is installed:
-
Verify the installation:
-
Check if the entry point is registered:
-
Try running directly:
API Connection Problems
Connection Refused Error
Problem:-
Check API URL configuration:
-
Verify the API URL is correct:
-
Test API connectivity manually:
-
Check your internet connection:
- Check firewall settings - Ensure outbound connections are allowed
Timeout Errors
Problem:-
Increase timeout setting:
-
Check network latency:
-
Test with a longer timeout:
SSL Certificate Errors
Problem:-
Update your CA certificates:
- macOS:
brew install ca-certificates - Ubuntu:
sudo apt-get install ca-certificates - Windows: Update Windows or install certificates manually
- macOS:
-
Update certifi package:
- Check system time - Incorrect system time can cause SSL errors
HTTP Error 404
Problem:-
Verify API URL format:
URL should be:
https://services.dzaleka.com/api -
Check endpoint availability:
-
Verify resource ID when accessing specific items:
HTTP Error 500/502/503
Problem:-
Check API health:
- Wait and retry - Server may be temporarily unavailable
-
Contact support if the issue persists:
- Email: contact@mail.dzaleka.com
- Check status page at services.dzaleka.com
Configuration Issues
Config File Not Found
Problem:-
Check config location:
-
Recreate config file:
-
Verify config permissions:
Invalid YAML Configuration
Problem:-
View current config:
-
Backup and recreate:
-
Valid config format:
Configuration Not Persisting
Problem: Configuration changes don’t persist after restart. Solution:-
Check file permissions:
-
Ensure config directory is writable:
-
Check for environment variable override:
Permission Errors
Config Directory Permission Denied
Problem:-
Fix directory permissions:
-
Use custom config location:
File Upload Permission Error
Problem:-
Check file permissions:
-
Make file readable:
-
Verify file exists and path is correct:
Testing Issues
Tests Failing Locally
Problem: Tests pass in CI but fail locally. Solution:-
Ensure clean environment:
-
Run tests with verbose output:
-
Check for environment-specific issues:
Import Errors in Tests
Problem:-
Install package in editable mode:
-
Verify installation:
-
Check PYTHONPATH:
Mock Not Working as Expected
Problem: Mocks are not intercepting calls. Solution:-
Patch at the correct location:
-
Use correct import path:
-
Ensure patch order matches parameter order:
Development Issues
Code Formatting Errors
Problem:-
Run Black to auto-format:
-
Check formatting without changes:
-
Set up pre-commit hook to auto-format:
Linting Errors
Problem:-
Run flake8 to see all issues:
-
Common fixes:
- E501 (line too long): Break long lines
- F401 (unused import): Remove unused imports
- E302 (expected 2 blank lines): Add blank lines
-
Configure flake8 in
.flake8orsetup.cfg:
Type Checking Errors
Problem:-
Run mypy to see all type issues:
-
Add type hints:
-
Use
Optionalfor nullable types:
Common Error Messages
”Endpoint returned HTML instead of JSON”
Cause: API endpoint returned a web page instead of JSON data. Solution:- Verify the correct API endpoint
- Check if API requires authentication
- Ensure base URL ends with
/api - Check API documentation for correct endpoint paths
”File size exceeds 10MB limit”
Cause: Attempting to upload a file larger than 10MB. Solution:-
Compress the image:
-
Resize the image:
-
Check file size:
“No services match the specified filters”
Cause: Search or filter criteria are too restrictive. Solution:-
Try broader search:
-
List all services first:
-
Check available categories:
Error Handling Patterns in Source
When debugging or adding new features, reference these error handling patterns fromdzdk.py:
API Request Error Handling
File Operation Error Handling
Configuration Error Handling
Getting Additional Help
If you’re still experiencing issues:1. Check the Logs
Enable verbose output:2. Search Existing Issues
Check GitHub Issues for similar problems.3. Create a Bug Report
If you found a bug, create an issue with:- DZDK CLI version:
dzdk --version - Python version:
python --version - Operating system
- Full error message and traceback
- Steps to reproduce
- Expected vs actual behavior
4. Contact Support
- Email: contact@mail.dzaleka.com
- Website: https://services.dzaleka.com
- GitHub: https://github.com/Dzaleka-Connect/dzdk-cli
5. Community Resources
- Documentation: DZDK CLI Docs
- Contributing Guide: /development/contributing
- Testing Guide: /development/testing