Skip to main content
This guide covers common problems you might encounter when using Retina and how to resolve them.

Installation issues

Command not found after installation

Problem: Running retina after installation shows “command not found”.
1

Check installation location

Verify Retina was installed correctly:
ls -la ~/.retina/bin/retina
2

Add to PATH

The installation script should add Retina to your PATH. If not, add it manually:Bash:
echo 'export PATH="$HOME/.retina/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Zsh:
echo 'export PATH="$HOME/.retina/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
3

Verify

retina --version

PHP version mismatch

Problem: Error message about PHP version requirements.
Retina requires PHP 8.1 or higher
1

Check PHP version

php --version
2

Update PHP

Ubuntu/Debian:
sudo apt-get update
sudo apt-get install php8.1-cli
macOS (Homebrew):
brew install php@8.1
3

Set default PHP

If you have multiple PHP versions:
sudo update-alternatives --set php /usr/bin/php8.1

Composer dependencies missing

Problem: Errors about missing classes or autoloader.
1

Navigate to Retina directory

cd ~/.retina
2

Install dependencies

composer install --no-dev --optimize-autoloader

Configuration issues

”Invalid directory path specified”

Problem: Retina can’t find the plugin directory.
Make sure you’re running Retina from the plugin root directory or specifying the correct path:
# Run from plugin root
cd /path/to/plugin
retina run

# Or specify path
retina run /path/to/plugin
Verify the directory contains a plugin.yml file:
ls -la plugin.yml

“No plugin.yml found”

Problem: Retina reports missing plugin.yml file.
No plugin.yml found in /path. Is this a PocketMine-MP plugin?
1

Verify plugin structure

PocketMine-MP plugins must have a plugin.yml in the root directory:
my-plugin/
├── plugin.yml    ← Must exist here
├── src/
└── resources/
2

Check file name

The file must be named exactly plugin.yml (lowercase, with .yml extension).
3

Verify permissions

ls -la plugin.yml
chmod 644 plugin.yml

Configuration file not being read

Problem: Settings in retina.yml are being ignored.
Command line options always override configuration file settings.
1

Check file location

retina.yml must be in the plugin root directory:
ls -la retina.yml
2

Validate YAML syntax

Use a YAML validator to check for syntax errors:
php -r "print_r(yaml_parse_file('retina.yml'));"
3

Check indentation

YAML is sensitive to indentation. Use spaces, not tabs:
# Correct
paths:
  - src
  - lib

# Wrong (mixed tabs/spaces)
paths:
	- src
  - lib

Invalid category/analyzer names

Problem: Error about invalid categories or analyzers.
Invalid category: unused_varible
Category and analyzer names are case-sensitive and must match exactly.
Common category names:
  • undefined_variable (not undefined_var)
  • unused_variable (not unused_var)
  • deprecated_api (not deprecatedApi)
  • thread_safety (not threadsafety)
Valid analyzer names:
  • PluginYml, MainClass, PhpFile
  • EventHandler, Listener, Command
  • DeprecatedApi, ThreadSafety, PHPStan
See the configuration guide for complete lists.

Analysis issues

Memory limit errors

Problem: PHP runs out of memory during analysis.
Fatal error: Allowed memory size of 134217728 bytes exhausted
1

Increase PHP memory limit

Run Retina with a higher memory limit:
php -d memory_limit=512M ~/.retina/bin/retina run
2

Update php.ini

For a permanent fix, edit php.ini:
memory_limit = 512M
Find your php.ini:
php --ini | grep "Loaded Configuration File"
3

Exclude large directories

Add large directories to excludePaths:
excludePaths:
  - vendor
  - node_modules
  - build
  - cache

Scan takes too long

Problem: Analysis is very slow on large plugins.
Exclude directories that don’t need scanning:
excludePaths:
  - vendor
  - tests
  - docs
  - examples

False positives

Problem: Retina reports issues that aren’t actually problems.
1

Lower strictness level

Higher levels produce more false positives:
level: 5  # More lenient
2

Ignore specific errors

Use ignoreErrors to suppress false positives:
ignoreErrors:
  - "#Variable \$logger is never read#"
  - "#Property.*is never read#"
3

Exclude categories

Exclude entire categories if they’re problematic:
excludeCategories:
  - unused_parameter  # Common false positive
4

Use baseline

For existing codebases with many false positives:
baseline: retina-baseline.neon

Missing expected issues

Problem: Retina doesn’t catch issues you know exist.
1

Increase strictness level

level: 8  # More thorough analysis
2

Enable all rules

Make sure the relevant rules are enabled:
rules:
  deprecatedApiUsage: true
  threadSafetyViolation: true
  # ... enable other rules
3

Check exclude filters

Remove or adjust filters that might be hiding issues:
excludeCategories: []  # Remove all exclusions
excludeSeverities: []  # Show all severity levels
4

Verify scan paths

Ensure the file is in a scanned directory:
paths:
  - src
  - lib  # Make sure this includes the file

Report generation issues

Empty or missing reports

Problem: Report file isn’t created or is empty.
If you used -c or --console-only, no file is created:
# This creates a file
retina run -f md -o report.md

# This doesn't
retina run -c
Check write permissions in the output directory:
ls -la .
chmod 755 .
Some formats only create files when issues are found. Use --console-only to verify:
retina run -c

Corrupted JSON output

Problem: JSON report can’t be parsed.
1

Validate JSON

jq . retina-report.json
2

Check for mixed output

If running with --console-only and redirecting, you might have mixed console output:
# Wrong - mixes console output with JSON
retina run -f json -c > output.json

# Right - saves only JSON
retina run -f json -o output.json
3

Use simple format

Simple format is smaller and less prone to issues:
retina run -f json -s -o output.json

HTML report not displaying properly

Problem: HTML report shows unstyled content or doesn’t render.
1

Check file encoding

Ensure the file is UTF-8 encoded:
file retina-report.html
2

Try different browser

Some browsers have strict local file policies. Try:
  • Opening in a different browser
  • Serving via a local web server:
php -S localhost:8000
# Then visit http://localhost:8000/retina-report.html
3

Check for truncation

Ensure the file was completely written:
tail -n 20 retina-report.html
# Should end with </html>

CI/CD issues

Exit code always 0 or always 1

Problem: Retina’s exit code doesn’t match expected results.
Retina returns exit code 1 if ANY issues are found, regardless of severity.
1

Filter issues for CI

Exclude low-severity issues to control when builds fail:
retina run --exclude-severities=hint,info
2

Use continue-on-error

Allow the pipeline to continue:
- name: Run Retina
  continue-on-error: true
  run: retina run
3

Parse JSON for custom logic

Extract specific metrics and decide when to fail:
ERRORS=$(jq '.summary.bySeverity.error // 0' retina-report.json)
if [ "$ERRORS" -gt 0 ]; then
  exit 1
fi

Installation fails in CI

Problem: Can’t install Retina in CI environment.
Install required packages first:
- name: Install dependencies
  run: apt-get update && apt-get install -y git curl php8.1-cli
Use a writable directory:
curl -sSL https://raw.githubusercontent.com/chinmay505/retina/main/install.sh | bash
export PATH="$HOME/.retina/bin:$PATH"
If the CI environment blocks external downloads:
  1. Pre-install Retina in a Docker image
  2. Cache the installation
  3. Include Retina in your repository

Reports not uploaded as artifacts

Problem: CI doesn’t save or display reports.
1

Use when: always

Ensure artifacts are uploaded even on failure:
- name: Upload report
  if: always()
  uses: actions/upload-artifact@v4
  with:
    name: retina-report
    path: retina-report.json
2

Verify report was created

Add a verification step:
- name: Verify report exists
  run: |
    if [ ! -f retina-report.json ]; then
      echo "Report not created!"
      exit 1
    fi
3

Check artifact paths

Ensure the path matches where Retina creates the file:
# Default location
path: retina-report.md

# Custom location
path: custom/path/report.json

Performance issues

High memory usage

Problem: Retina uses too much RAM.
1

Use simple reports

Simple reports use less memory:
simpleReport: true
2

Exclude large files

excludePaths:
  - vendor
  - node_modules
  - "*.min.php"
3

Lower strictness

Lower levels require less memory:
level: 4

Slow on Windows

Problem: Retina is significantly slower on Windows.
Windows file I/O is generally slower than Unix systems. This is expected.
1

Exclude Windows Defender

Add the plugin directory to Windows Defender exclusions.
2

Use WSL2

For better performance, run Retina in WSL2:
wsl
cd /mnt/c/path/to/plugin
retina run
3

Disable real-time scanning

Temporarily disable antivirus during analysis.

Getting help

If you’re still experiencing issues:
1

Enable verbose output

Run with verbose flag for more details:
retina run -v
2

Check the logs

Look for error messages in the console output.
3

Create a minimal reproduction

Try running Retina on a simple test plugin to isolate the issue.
4

Report the issue

If you’ve found a bug, report it on GitHub:https://github.com/chinmay505/retina/issuesInclude:
  • Retina version (retina --version)
  • PHP version (php --version)
  • Operating system
  • Command you ran
  • Full error message
  • Configuration file (if applicable)

See also

Build docs developers (and LLMs) love