Core Features
Troubleshooting Guide
Common issues and solutions for m1f
This guide covers common issues and error messages you might encounter when using m1f.
Common Issues
Module Import Error
Problem: Running m1f
results in:
ModuleNotFoundError: No module named 'm1f'
Solution: Use the direct script invocation instead:
m1f [options]
Or set up the alias as described in the Development Workflow.
Permission Denied
Problem: Error when trying to write output file:
PermissionError: [Errno 13] Permission denied: '/path/to/output.txt'
Solutions:
- Check write permissions in the output directory
- Use a different output location
- Run with appropriate permissions (avoid using sudo unless necessary)
File Not Found
Problem: Source directory or input file not found.
Solutions:
- Verify the path exists:
ls -la /path/to/source
- Use absolute paths to avoid confusion
- Check for typos in the path
Encoding Errors
Problem: UnicodeDecodeError
when processing files.
Solutions:
- Use
--convert-to-charset utf-8
to force UTF-8 encoding - Skip problematic files with proper exclusion patterns
- Use
--abort-on-encoding-error
to identify problematic files
Example:
m1f -s . -o output.txt --convert-to-charset utf-8
Memory Issues with Large Projects
Problem: Memory usage is too high or process is killed.
Solutions:
- Use
--max-file-size
to limit individual file sizes - Process specific directories instead of entire project
- Use
--include-extensions
to limit file types - Enable minimal output mode:
--minimal-output
Example:
m1f -s . -o output.txt --max-file-size 1MB --include-extensions .py .md
Symlink Cycles
Problem: Infinite loop when following symlinks.
Solutions:
- Don’t use
--include-symlinks
unless necessary - Exclude directories with circular symlinks
- m1f has built-in cycle detection, but it’s better to avoid the issue
Security Check Failures
Problem: Files contain sensitive information.
Solutions:
- Review the detected secrets
- Use
--security-check skip
to skip files with secrets - Use
--security-check warn
to include but get warnings - Add sensitive files to exclusions
Example:
m1f -s . -o output.txt --security-check warn --excludes ".env" "config/secrets.yml"
Error Messages
”Output file already exists”
Meaning: The specified output file exists and would be overwritten.
Solution: Use -f
or --force
to overwrite, or choose a different output filename.
”No files found to process”
Meaning: No files matched the inclusion criteria.
Solutions:
- Check your source directory contains files
- Verify extension filters aren’t too restrictive
- Check exclusion patterns aren’t excluding everything
- Use
--verbose
to see what’s being processed
”File size exceeds maximum allowed”
Meaning: A file is larger than the specified --max-file-size
.
Solution: The file is automatically skipped. Adjust --max-file-size
if needed.
”Failed to create archive”
Meaning: Archive creation failed (disk space, permissions, etc.).
Solutions:
- Check available disk space
- Verify write permissions
- Try a different archive format
- Skip archive creation and create output file only
”Preset file not found”
Meaning: The specified preset configuration file doesn’t exist.
Solutions:
- Check the preset file path
- Use absolute paths for preset files
- Verify preset file exists:
ls -la presets/
Performance Optimization
Slow Processing
Solutions:
- Use
--include-extensions
to limit file types - Exclude large directories like
node_modules
- Use
--max-file-size
to skip large files - Enable minimal output:
--minimal-output
- Disable security checks if not needed
High Memory Usage
Solutions:
- Process smaller directory trees
- Use file size limits
- Exclude binary files
- Process in batches using input file lists
Debug Mode
For detailed debugging information:
m1f -s . -o output.txt --verbose
This will show:
- Files being processed
- Files being skipped and why
- Processing times
- Detailed error messages
Getting Help
- Check the CLI Reference for parameter details
- Review examples in the main documentation
- Check the preset documentation for configuration issues
- Report issues at the project repository
Exit Codes
Understanding exit codes can help in scripting:
0
: Success1
: General error2
: Invalid arguments3
: File not found4
: Permission denied5
: Security check failed
Use in scripts:
if m1f -s . -o output.txt; then
echo "Success"
else
echo "Failed with exit code: $?"
fi
- Previous
- Web Scraper Backends Guide